-
Notifications
You must be signed in to change notification settings - Fork 9
Add Java rules for detecting hardcoded secrets in System.setProperty and OkHttp #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis pull request adds two new rule configuration files with accompanying snapshot and test files to detect hardcoded secrets in Java applications. One rule targets insecure use of Changes
Sequence Diagram(s)sequenceDiagram
participant Code
participant Analyzer
participant Rule_System
participant Rule_Credentials
Code->>Analyzer: Submit Java source code
Analyzer->>Rule_System: Evaluate System.setProperty rule
Rule_System-->>Analyzer: Return match results (if any)
Analyzer->>Rule_Credentials: Evaluate Credentials.basic rule
Rule_Credentials-->>Analyzer: Return match results (if any)
Analyzer->>Code: Report any security warnings
Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (9)
tests/java/hardcoded-secret-in-credentials-java-test.yml (3)
9-9
: Trailing Spaces Detected
There are trailing spaces at line 9. Please remove these extra whitespace characters to adhere to YAMLlint guidelines.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 9-9: trailing spaces
(trailing-spaces)
17-17
: Trailing Spaces Detected
Line 17 also contains trailing spaces. Removing these will help maintain clean formatting.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 17-17: trailing spaces
(trailing-spaces)
20-20
: Missing Newline at End of File
The file is missing a newline character at the end (line 20). Adding a newline will resolve the YAMLlint error and improve file consistency.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 20-20: no new line character at the end of file
(new-line-at-end-of-file)
tests/java/system-setproperty-hardcoded-secret-java-test.yml (1)
9-9
: Missing Newline at End of File
A newline is missing at the end of the file (line 9). Please add a newline to conform with YAML formatting best practices.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 9-9: no new line character at the end of file
(new-line-at-end-of-file)
rules/java/security/system-setproperty-hardcoded-secret-java.yml (1)
17-315
: YAML Formatting Issues in theutils
Block
Multiple YAMLlint warnings have been reported throughout theutils
block (e.g., indentation warnings on lines 18, 20, 22, and trailing spaces on several lines).
It is recommended to reformat this section so that each nested level uses a consistent 4-space indentation and to remove any trailing whitespace. For example, you may apply a diff similar to the following for the initial part of the block:-utils: - match_string_literal: - kind: string_fragment - inside: - kind: string_literal - all: - - nthChild: - position: 2 - ofRule: - not: - kind: line_comment +utils: + match_string_literal: + kind: string_fragment + inside: + kind: string_literal + all: + - nthChild: + position: 2 + ofRule: + not: + kind: line_commentPlease review the entire
utils
section and adjust the indentation and remove trailing spaces as needed.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 18-18: wrong indentation: expected 4 but found 3
(indentation)
[warning] 20-20: wrong indentation: expected 5 but found 4
(indentation)
[warning] 22-22: wrong indentation: expected 6 but found 5
(indentation)
[error] 22-22: trailing spaces
(trailing-spaces)
[warning] 23-23: wrong indentation: expected 9 but found 8
(indentation)
[warning] 25-25: wrong indentation: expected 10 but found 9
(indentation)
[warning] 26-26: wrong indentation: expected 11 but found 10
(indentation)
[error] 32-32: trailing spaces
(trailing-spaces)
[warning] 33-33: wrong indentation: expected 19 but found 18
(indentation)
[error] 42-42: trailing spaces
(trailing-spaces)
[warning] 43-43: wrong indentation: expected 17 but found 16
(indentation)
[error] 58-58: trailing spaces
(trailing-spaces)
[warning] 63-63: wrong indentation: expected 6 but found 5
(indentation)
[error] 63-63: trailing spaces
(trailing-spaces)
[warning] 64-64: wrong indentation: expected 9 but found 8
(indentation)
[warning] 66-66: wrong indentation: expected 10 but found 9
(indentation)
[warning] 67-67: wrong indentation: expected 11 but found 10
(indentation)
[error] 73-73: trailing spaces
(trailing-spaces)
[warning] 74-74: wrong indentation: expected 19 but found 18
(indentation)
[error] 83-83: trailing spaces
(trailing-spaces)
[warning] 84-84: wrong indentation: expected 17 but found 16
(indentation)
[warning] 103-103: wrong indentation: expected 27 but found 28
(indentation)
[warning] 118-118: wrong indentation: expected 25 but found 28
(indentation)
[error] 132-132: trailing spaces
(trailing-spaces)
[error] 133-133: trailing spaces
(trailing-spaces)
[warning] 135-135: wrong indentation: expected 4 but found 3
(indentation)
[warning] 137-137: wrong indentation: expected 5 but found 4
(indentation)
[warning] 139-139: wrong indentation: expected 6 but found 5
(indentation)
[error] 139-139: trailing spaces
(trailing-spaces)
[warning] 140-140: wrong indentation: expected 9 but found 8
(indentation)
[warning] 142-142: wrong indentation: expected 10 but found 9
(indentation)
[warning] 143-143: wrong indentation: expected 11 but found 10
(indentation)
[error] 149-149: trailing spaces
(trailing-spaces)
[warning] 150-150: wrong indentation: expected 19 but found 18
(indentation)
[error] 157-157: trailing spaces
(trailing-spaces)
[warning] 158-158: wrong indentation: expected 17 but found 16
(indentation)
[warning] 177-177: wrong indentation: expected 27 but found 28
(indentation)
[warning] 193-193: wrong indentation: expected 25 but found 28
(indentation)
[warning] 213-213: wrong indentation: expected 6 but found 5
(indentation)
[error] 213-213: trailing spaces
(trailing-spaces)
[warning] 214-214: wrong indentation: expected 9 but found 8
(indentation)
[warning] 216-216: wrong indentation: expected 10 but found 9
(indentation)
[warning] 217-217: wrong indentation: expected 11 but found 10
(indentation)
[error] 223-223: trailing spaces
(trailing-spaces)
[warning] 224-224: wrong indentation: expected 19 but found 18
(indentation)
[error] 231-231: trailing spaces
(trailing-spaces)
[warning] 232-232: wrong indentation: expected 17 but found 16
(indentation)
[warning] 251-251: wrong indentation: expected 27 but found 28
(indentation)
[warning] 267-267: wrong indentation: expected 25 but found 28
(indentation)
[warning] 286-286: wrong indentation: expected 27 but found 28
(indentation)
[warning] 301-301: wrong indentation: expected 25 but found 28
(indentation)
rules/java/security/hardcoded-secret-in-credentials-java.yml (4)
1-292
: Fix YAML Formatting to Meet Lint Standards
There are several YAMLlint warnings throughout the file regarding indentation and trailing whitespace (e.g., warnings on lines 18, 31–34, 39–40, and many others). Please review and adjust the indentation to use a consistent spacing level (typically 4 spaces per level) and remove any trailing spaces.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 18-18: wrong indentation: expected 4 but found 3
(indentation)
[warning] 31-31: wrong indentation: expected 11 but found 9
(indentation)
[error] 33-33: trailing spaces
(trailing-spaces)
[warning] 34-34: wrong indentation: expected 17 but found 16
(indentation)
[warning] 39-39: wrong indentation: expected 13 but found 12
(indentation)
[error] 40-40: trailing spaces
(trailing-spaces)
[warning] 48-48: wrong indentation: expected 9 but found 8
(indentation)
[warning] 53-53: wrong indentation: expected 12 but found 10
(indentation)
[error] 55-55: trailing spaces
(trailing-spaces)
[warning] 57-57: wrong indentation: expected 4 but found 3
(indentation)
[warning] 70-70: wrong indentation: expected 11 but found 9
(indentation)
[error] 72-72: trailing spaces
(trailing-spaces)
[warning] 73-73: wrong indentation: expected 17 but found 16
(indentation)
[warning] 78-78: wrong indentation: expected 13 but found 12
(indentation)
[error] 80-80: trailing spaces
(trailing-spaces)
[warning] 86-86: wrong indentation: expected 9 but found 8
(indentation)
[warning] 91-91: wrong indentation: expected 12 but found 10
(indentation)
[warning] 96-96: wrong indentation: expected 11 but found 10
(indentation)
[warning] 98-98: wrong indentation: expected 12 but found 10
(indentation)
[error] 98-98: trailing spaces
(trailing-spaces)
[warning] 111-111: wrong indentation: expected 4 but found 3
(indentation)
[warning] 120-120: wrong indentation: expected 11 but found 9
(indentation)
[error] 122-122: trailing spaces
(trailing-spaces)
[warning] 123-123: wrong indentation: expected 17 but found 16
(indentation)
[warning] 128-128: wrong indentation: expected 13 but found 12
(indentation)
[error] 129-129: trailing spaces
(trailing-spaces)
[warning] 137-137: wrong indentation: expected 9 but found 8
(indentation)
[warning] 142-142: wrong indentation: expected 12 but found 10
(indentation)
[warning] 145-145: wrong indentation: expected 4 but found 3
(indentation)
[warning] 154-154: wrong indentation: expected 11 but found 9
(indentation)
[error] 156-156: trailing spaces
(trailing-spaces)
[warning] 157-157: wrong indentation: expected 17 but found 16
(indentation)
[warning] 162-162: wrong indentation: expected 13 but found 12
(indentation)
[error] 164-164: trailing spaces
(trailing-spaces)
[warning] 170-170: wrong indentation: expected 9 but found 8
(indentation)
[warning] 175-175: wrong indentation: expected 12 but found 10
(indentation)
[warning] 178-178: wrong indentation: expected 4 but found 3
(indentation)
[warning] 198-198: wrong indentation: expected 11 but found 9
(indentation)
[error] 200-200: trailing spaces
(trailing-spaces)
[warning] 201-201: wrong indentation: expected 17 but found 16
(indentation)
[warning] 206-206: wrong indentation: expected 13 but found 12
(indentation)
[error] 207-207: trailing spaces
(trailing-spaces)
[warning] 215-215: wrong indentation: expected 9 but found 8
(indentation)
[warning] 220-220: wrong indentation: expected 12 but found 10
(indentation)
[warning] 221-221: too many spaces after colon
(colons)
[warning] 224-224: wrong indentation: expected 4 but found 3
(indentation)
[warning] 244-244: wrong indentation: expected 11 but found 9
(indentation)
[error] 246-246: trailing spaces
(trailing-spaces)
[warning] 247-247: wrong indentation: expected 17 but found 16
(indentation)
[warning] 252-252: wrong indentation: expected 13 but found 12
(indentation)
[error] 254-254: trailing spaces
(trailing-spaces)
[warning] 260-260: wrong indentation: expected 9 but found 8
(indentation)
[warning] 265-265: wrong indentation: expected 12 but found 10
(indentation)
[warning] 266-266: too many spaces after colon
(colons)
[warning] 270-270: wrong indentation: expected 11 but found 10
(indentation)
[warning] 272-272: wrong indentation: expected 12 but found 10
(indentation)
[error] 272-272: trailing spaces
(trailing-spaces)
[warning] 292-292: too many blank lines
(1 > 0) (empty-lines)
90-92
: Review Import Pattern in the Utils Block
The pattern on line 92 (- pattern: import okhttp3?;
) appears potentially incorrect. It likely should match a broader or different pattern (for example, it may be intended to beimport okhttp3.*;
). Please verify the intended import pattern for the OkHttp library to avoid false negatives.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 91-91: wrong indentation: expected 12 but found 10
(indentation)
220-222
: Standardize Spacing in Import Declaration
Extra spaces after the colon (as seen on line 221) can lead to inconsistencies in YAML parsing. Please adjust the spacing to adhere to a consistent style.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 220-220: wrong indentation: expected 12 but found 10
(indentation)
[warning] 221-221: too many spaces after colon
(colons)
292-292
: Remove Extra Blank Lines
There are extra blank lines at the end of the file that should be removed to clean up the file formatting.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 292-292: too many blank lines
(1 > 0) (empty-lines)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
rules/java/security/system-setproperty-hardcoded-secret-java.yml
(1 hunks)tests/__snapshots__/system-setproperty-hardcoded-secret-java-snapshot.yml
(1 hunks)tests/java/system-setproperty-hardcoded-secret-java-test.yml
(1 hunks)rules/java/security/hardcoded-secret-in-credentials-java.yml
(1 hunks)tests/__snapshots__/hardcoded-secret-in-credentials-java-snapshot.yml
(1 hunks)tests/java/hardcoded-secret-in-credentials-java-test.yml
(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
tests/java/system-setproperty-hardcoded-secret-java-test.yml
[error] 9-9: no new line character at the end of file
(new-line-at-end-of-file)
tests/java/hardcoded-secret-in-credentials-java-test.yml
[error] 9-9: trailing spaces
(trailing-spaces)
[error] 17-17: trailing spaces
(trailing-spaces)
[error] 20-20: no new line character at the end of file
(new-line-at-end-of-file)
rules/java/security/hardcoded-secret-in-credentials-java.yml
[warning] 18-18: wrong indentation: expected 4 but found 3
(indentation)
[warning] 31-31: wrong indentation: expected 11 but found 9
(indentation)
[error] 33-33: trailing spaces
(trailing-spaces)
[warning] 34-34: wrong indentation: expected 17 but found 16
(indentation)
[warning] 39-39: wrong indentation: expected 13 but found 12
(indentation)
[error] 40-40: trailing spaces
(trailing-spaces)
[warning] 48-48: wrong indentation: expected 9 but found 8
(indentation)
[warning] 53-53: wrong indentation: expected 12 but found 10
(indentation)
[error] 55-55: trailing spaces
(trailing-spaces)
[warning] 57-57: wrong indentation: expected 4 but found 3
(indentation)
[warning] 70-70: wrong indentation: expected 11 but found 9
(indentation)
[error] 72-72: trailing spaces
(trailing-spaces)
[warning] 73-73: wrong indentation: expected 17 but found 16
(indentation)
[warning] 78-78: wrong indentation: expected 13 but found 12
(indentation)
[error] 80-80: trailing spaces
(trailing-spaces)
[warning] 86-86: wrong indentation: expected 9 but found 8
(indentation)
[warning] 91-91: wrong indentation: expected 12 but found 10
(indentation)
[warning] 96-96: wrong indentation: expected 11 but found 10
(indentation)
[warning] 98-98: wrong indentation: expected 12 but found 10
(indentation)
[error] 98-98: trailing spaces
(trailing-spaces)
[warning] 111-111: wrong indentation: expected 4 but found 3
(indentation)
[warning] 120-120: wrong indentation: expected 11 but found 9
(indentation)
[error] 122-122: trailing spaces
(trailing-spaces)
[warning] 123-123: wrong indentation: expected 17 but found 16
(indentation)
[warning] 128-128: wrong indentation: expected 13 but found 12
(indentation)
[error] 129-129: trailing spaces
(trailing-spaces)
[warning] 137-137: wrong indentation: expected 9 but found 8
(indentation)
[warning] 142-142: wrong indentation: expected 12 but found 10
(indentation)
[warning] 145-145: wrong indentation: expected 4 but found 3
(indentation)
[warning] 154-154: wrong indentation: expected 11 but found 9
(indentation)
[error] 156-156: trailing spaces
(trailing-spaces)
[warning] 157-157: wrong indentation: expected 17 but found 16
(indentation)
[warning] 162-162: wrong indentation: expected 13 but found 12
(indentation)
[error] 164-164: trailing spaces
(trailing-spaces)
[warning] 170-170: wrong indentation: expected 9 but found 8
(indentation)
[warning] 175-175: wrong indentation: expected 12 but found 10
(indentation)
[warning] 178-178: wrong indentation: expected 4 but found 3
(indentation)
[warning] 198-198: wrong indentation: expected 11 but found 9
(indentation)
[error] 200-200: trailing spaces
(trailing-spaces)
[warning] 201-201: wrong indentation: expected 17 but found 16
(indentation)
[warning] 206-206: wrong indentation: expected 13 but found 12
(indentation)
[error] 207-207: trailing spaces
(trailing-spaces)
[warning] 215-215: wrong indentation: expected 9 but found 8
(indentation)
[warning] 220-220: wrong indentation: expected 12 but found 10
(indentation)
[warning] 221-221: too many spaces after colon
(colons)
[warning] 224-224: wrong indentation: expected 4 but found 3
(indentation)
[warning] 244-244: wrong indentation: expected 11 but found 9
(indentation)
[error] 246-246: trailing spaces
(trailing-spaces)
[warning] 247-247: wrong indentation: expected 17 but found 16
(indentation)
[warning] 252-252: wrong indentation: expected 13 but found 12
(indentation)
[error] 254-254: trailing spaces
(trailing-spaces)
[warning] 260-260: wrong indentation: expected 9 but found 8
(indentation)
[warning] 265-265: wrong indentation: expected 12 but found 10
(indentation)
[warning] 266-266: too many spaces after colon
(colons)
[warning] 270-270: wrong indentation: expected 11 but found 10
(indentation)
[warning] 272-272: wrong indentation: expected 12 but found 10
(indentation)
[error] 272-272: trailing spaces
(trailing-spaces)
[warning] 292-292: too many blank lines
(1 > 0) (empty-lines)
rules/java/security/system-setproperty-hardcoded-secret-java.yml
[warning] 18-18: wrong indentation: expected 4 but found 3
(indentation)
[warning] 20-20: wrong indentation: expected 5 but found 4
(indentation)
[warning] 22-22: wrong indentation: expected 6 but found 5
(indentation)
[error] 22-22: trailing spaces
(trailing-spaces)
[warning] 23-23: wrong indentation: expected 9 but found 8
(indentation)
[warning] 25-25: wrong indentation: expected 10 but found 9
(indentation)
[warning] 26-26: wrong indentation: expected 11 but found 10
(indentation)
[error] 32-32: trailing spaces
(trailing-spaces)
[warning] 33-33: wrong indentation: expected 19 but found 18
(indentation)
[error] 42-42: trailing spaces
(trailing-spaces)
[warning] 43-43: wrong indentation: expected 17 but found 16
(indentation)
[error] 58-58: trailing spaces
(trailing-spaces)
[warning] 63-63: wrong indentation: expected 6 but found 5
(indentation)
[error] 63-63: trailing spaces
(trailing-spaces)
[warning] 64-64: wrong indentation: expected 9 but found 8
(indentation)
[warning] 66-66: wrong indentation: expected 10 but found 9
(indentation)
[warning] 67-67: wrong indentation: expected 11 but found 10
(indentation)
[error] 73-73: trailing spaces
(trailing-spaces)
[warning] 74-74: wrong indentation: expected 19 but found 18
(indentation)
[error] 83-83: trailing spaces
(trailing-spaces)
[warning] 84-84: wrong indentation: expected 17 but found 16
(indentation)
[warning] 103-103: wrong indentation: expected 27 but found 28
(indentation)
[warning] 118-118: wrong indentation: expected 25 but found 28
(indentation)
[error] 132-132: trailing spaces
(trailing-spaces)
[error] 133-133: trailing spaces
(trailing-spaces)
[warning] 135-135: wrong indentation: expected 4 but found 3
(indentation)
[warning] 137-137: wrong indentation: expected 5 but found 4
(indentation)
[warning] 139-139: wrong indentation: expected 6 but found 5
(indentation)
[error] 139-139: trailing spaces
(trailing-spaces)
[warning] 140-140: wrong indentation: expected 9 but found 8
(indentation)
[warning] 142-142: wrong indentation: expected 10 but found 9
(indentation)
[warning] 143-143: wrong indentation: expected 11 but found 10
(indentation)
[error] 149-149: trailing spaces
(trailing-spaces)
[warning] 150-150: wrong indentation: expected 19 but found 18
(indentation)
[error] 157-157: trailing spaces
(trailing-spaces)
[warning] 158-158: wrong indentation: expected 17 but found 16
(indentation)
[warning] 177-177: wrong indentation: expected 27 but found 28
(indentation)
[warning] 193-193: wrong indentation: expected 25 but found 28
(indentation)
[warning] 213-213: wrong indentation: expected 6 but found 5
(indentation)
[error] 213-213: trailing spaces
(trailing-spaces)
[warning] 214-214: wrong indentation: expected 9 but found 8
(indentation)
[warning] 216-216: wrong indentation: expected 10 but found 9
(indentation)
[warning] 217-217: wrong indentation: expected 11 but found 10
(indentation)
[error] 223-223: trailing spaces
(trailing-spaces)
[warning] 224-224: wrong indentation: expected 19 but found 18
(indentation)
[error] 231-231: trailing spaces
(trailing-spaces)
[warning] 232-232: wrong indentation: expected 17 but found 16
(indentation)
[warning] 251-251: wrong indentation: expected 27 but found 28
(indentation)
[warning] 267-267: wrong indentation: expected 25 but found 28
(indentation)
[warning] 286-286: wrong indentation: expected 27 but found 28
(indentation)
[warning] 301-301: wrong indentation: expected 25 but found 28
(indentation)
🔇 Additional comments (10)
tests/java/hardcoded-secret-in-credentials-java-test.yml (1)
1-5
: Overall Structure and Coverage
The test file clearly distinguishes between valid and invalid Java code examples for hardcoded credentials. The valid case uses a variable for the keystore password, and the two invalid cases demonstrate different insecure practices (using a hardcoded literal and initializing a variable with a hardcoded value).tests/java/system-setproperty-hardcoded-secret-java-test.yml (2)
1-5
: Clear Definition of Valid Case
The test file properly defines a valid example using a variable for the keystore password. This example effectively contrasts with the insecure practices shown later.
6-9
: Comprehensive Invalid Examples
The invalid examples clearly illustrate the risk by hardcoding values for bothjavax.net.ssl.keyStorePassword
andjavax.net.ssl.trustStorePassword
. This should aid the detection rule’s effectiveness.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 9-9: no new line character at the end of file
(new-line-at-end-of-file)
tests/__snapshots__/system-setproperty-hardcoded-secret-java-snapshot.yml (2)
1-4
: Detailed Snapshot for Keystore Password
The first snapshot entry provides a comprehensive breakdown of the components in theSystem.setProperty
call for setting the keystore password. The labels (with source positions and styles) are detailed and should support precise matching.
38-44
: Detailed Snapshot for TrustStore Password
The snapshot entry for the trustStore password is consistent with the keystore example. The labels clearly capture the relevant parts of the method invocation, ensuring robust detection of hardcoded secrets.tests/__snapshots__/hardcoded-secret-in-credentials-java-snapshot.yml (2)
1-4
: Comprehensive Snapshot Entry (Variable Usage)
The first snapshot entry demonstrates the secure usage where the password is stored as a variable. The detailed labels (including start/end positions) are very useful for the matching engine.
57-61
: Snapshot Entry for Hardcoded Literal
The second snapshot effectively captures a scenario where a hardcoded string ("asdf"
) is passed toCredentials.basic
. The labels for this instance are appropriately detailed, facilitating detection of such insecure practices.rules/java/security/system-setproperty-hardcoded-secret-java.yml (2)
1-14
: Rule Metadata and Description
The metadata section (lines 1–14) is clear and describes the security concern well. The provided message and note reference the proper security guidelines and CWE.
316-322
: Rule Logic Verification
The finalrule
block correctly aggregates multiple matching strategies using theany
operator. The approach is comprehensive; just ensure that the ordering of match definitions is intentional and covers all detection scenarios as expected.rules/java/security/hardcoded-secret-in-credentials-java.yml (1)
284-292
: Validate Comprehensive Rule Matching Logic
The rule’s matching strategy is comprehensive and covers various forms of theCredentials.basic
invocation (including instance and fully qualified usages). Confirm that these patterns correctly capture all intended cases and do not lead to false positives or negatives in practice. Overall, the logic is well-constructed.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 292-292: too many blank lines
(1 > 0) (empty-lines)
Summary by CodeRabbit
New Features
Tests