-
Notifications
You must be signed in to change notification settings - Fork 6
Add Swift rules and tests for hard-coded encryption secrets #167
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
Add Swift rules and tests for hard-coded encryption secrets #167
Conversation
…tials into rule-blowfish_chacha20_aes_rabbit-hardcoded-secret-swift
WalkthroughThis pull request introduces four new security rule configuration files for Swift—targeting AES, Blowfish, ChaCha20, and Rabbit—to detect hard-coded encryption secrets. In addition, snapshot test files and test configuration files have been added for these rules, along with a Ruby-based snapshot for an empty password scenario using mysql2. The rules use multiple pattern matching utilities and constraints to identify hard-coded secrets, advising developers to use environment variables or secure vaults for secret management. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant SC as Source Code
participant RS as Rules Scanner
participant RE as Rules Engine
participant Alert as Alert System
Dev->>SC: Write Swift code with encryption logic
SC->>RS: Submit code for security scanning
RS->>RE: Load applicable secret detection rules (AES, Blowfish, ChaCha20, Rabbit)
RE-->>RS: Return pattern match results
RS->>Dev: Notify about hard-coded secret detections
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 (28)
tests/swift/chacha20-hardcoded-secret-swift-test.yml (1)
15-15
: Ensure Newline at End-of-FileYAMLlint flagged a missing newline at the end of the file. Please add a newline character (e.g., pressing Enter after line 15) to ensure compliance with YAML formatting standards.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
tests/swift/rabbit-hardcoded-secret-swift-test.yml (1)
15-15
: Add Newline at End-of-FileThe static analysis tool indicates that there is no newline at the end of this file. Please add one to conform to YAMLlint standards.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
tests/swift/blowfish-hardcoded-secret-swift-test.yml (1)
15-15
: Conform to YAML Formatting StandardsA newline at the end of the file is required according to YAMLlint. Please ensure that a newline character is added at the end of line 15.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
tests/__snapshots__/chacha20-hardcoded-secret-swift-snapshot.yml (4)
1-185
: Indentation and Formatting Cleanup RequiredSeveral YAMLlint warnings have been noted throughout this file (e.g., expected indentations and trailing spaces). Please review and adjust the overall indentation and remove any trailing whitespace to ensure proper YAML formatting and maintainability.
6-37
: Validate Label Duplications in the First SnapshotThe first snapshot block (lines 3–37) for
ChaCha20(key: "hello", iv: "123")
contains some duplicate label entries (e.g., the two similar entries for(key: "hello", iv: "123")
). Verify that these duplications are intentional and add value to the test assertions.
38-89
: Consistency Check for Labels in Dynamic Key SnapshotIn the dynamic key snapshot block (lines 38–89), multiple labels reference the conversion of
"s33krit"
to an array and repeated mentions ofpassword
. Please confirm all label ranges accurately capture the intended code segments and that any redundancy is deliberate.
90-185
: Review the Use of 'try' Statement in the Final SnapshotThe final snapshot block (lines 90–185) employs the
try
keyword with a ChaCha20 call. Double-check that the labels (covering both primary and secondary sources) correctly delineate the different segments of the code snippet for error handling scenarios.rules/swift/security/chacha20-hardcoded-secret-swift.yml (5)
1-59
: Indentation and Formatting Cleanup RequiredThis security rule file shows several YAML formatting warnings. Please review and correct the indentation (as well as any extraneous spaces) in the header and the early sections to comply with YAML standards.
🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 19-19: wrong indentation: expected 12 but found 13
(indentation)
[warning] 20-20: wrong indentation: expected 17 but found 15
(indentation)
[warning] 23-23: wrong indentation: expected 19 but found 18
(indentation)
[warning] 49-49: wrong indentation: expected 22 but found 20
(indentation)
[warning] 50-50: wrong indentation: expected 24 but found 22
(indentation)
[warning] 53-53: wrong indentation: expected 22 but found 20
(indentation)
[warning] 54-54: wrong indentation: expected 24 but found 22
(indentation)
[warning] 58-58: wrong indentation: expected 8 but found 5
(indentation)
60-102
: Review Tree-Sitter Pattern in 'match_pattern_try_expression_directly'The definition of the
match_pattern_try_expression_directly
pattern uses a regex (^ChaCha20$) and several nested conditions. Please verify that these criteria precisely capture the intended try-expression constructs without introducing false positives.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 60-60: wrong indentation: expected 9 but found 13
(indentation)
[warning] 61-61: wrong indentation: expected 17 but found 15
(indentation)
[warning] 64-64: wrong indentation: expected 19 but found 18
(indentation)
[warning] 67-67: wrong indentation: expected 9 but found 16
(indentation)
[warning] 95-95: wrong indentation: expected 22 but found 20
(indentation)
[warning] 96-96: wrong indentation: expected 24 but found 22
(indentation)
[warning] 99-99: wrong indentation: expected 22 but found 20
(indentation)
[warning] 100-100: wrong indentation: expected 24 but found 22
(indentation)
103-159
: Evaluate Pattern Definitions for 'match_pattern_ChaCha20_statement_directly'Ensure that the pattern matching for ChaCha20 statements (including call expressions and their suffixes) effectively identifies the intended constructs. Consider validating against sample Swift code to verify that these patterns function as required.
🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 103-103: wrong indentation: expected 22 but found 20
(indentation)
[warning] 107-107: wrong indentation: expected 8 but found 6
(indentation)
[warning] 109-109: wrong indentation: expected 10 but found 13
(indentation)
[warning] 110-110: wrong indentation: expected 17 but found 15
(indentation)
[warning] 113-113: wrong indentation: expected 19 but found 18
(indentation)
[warning] 116-116: wrong indentation: expected 10 but found 16
(indentation)
[warning] 139-139: wrong indentation: expected 22 but found 18
(indentation)
[warning] 140-140: wrong indentation: expected 24 but found 22
(indentation)
[warning] 154-154: wrong indentation: expected 24 but found 22
(indentation)
[warning] 156-156: wrong indentation: expected 26 but found 23
(indentation)
[warning] 159-159: wrong indentation: expected 27 but found 26
(indentation)
160-220
: Assess the Patterns for Try Expressions with InstancesBoth
match_pattern_try_expression_with_instance
andmatch_pattern_try_expression_with_utf8
incorporate nuanced conditions (e.g. exclusions for throw keywords). Please double-check that these specifications accurately filter out undesired cases while capturing valid instances of hard-coded ChaCha20 usage.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 169-169: wrong indentation: expected 22 but found 20
(indentation)
[warning] 170-170: wrong indentation: expected 24 but found 22
(indentation)
[warning] 173-173: wrong indentation: expected 22 but found 20
(indentation)
[warning] 174-174: wrong indentation: expected 24 but found 22
(indentation)
[warning] 177-177: wrong indentation: expected 22 but found 20
(indentation)
[warning] 181-181: wrong indentation: expected 8 but found 5
(indentation)
[warning] 183-183: wrong indentation: expected 9 but found 13
(indentation)
[warning] 184-184: wrong indentation: expected 17 but found 15
(indentation)
[warning] 187-187: wrong indentation: expected 19 but found 18
(indentation)
[warning] 190-190: wrong indentation: expected 9 but found 6
(indentation)
[warning] 191-191: wrong indentation: expected 12 but found 9
(indentation)
[warning] 194-194: wrong indentation: expected 13 but found 16
(indentation)
[warning] 213-213: wrong indentation: expected 22 but found 20
(indentation)
[warning] 214-214: wrong indentation: expected 24 but found 22
(indentation)
[warning] 217-217: wrong indentation: expected 22 but found 20
(indentation)
[warning] 218-218: wrong indentation: expected 24 but found 22
(indentation)
221-359
: General Rule and Constraint ValidationThe rule block correctly aggregates multiple matching patterns, and the constraints section (lines 351–357) defines SECRET as a line string literal. It is advisable to review these intricate nested configurations and, if possible, add inline comments to aid future maintainers.
🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 221-221: wrong indentation: expected 12 but found 18
(indentation)
[warning] 222-222: wrong indentation: expected 24 but found 22
(indentation)
[warning] 235-235: wrong indentation: expected 24 but found 22
(indentation)
[warning] 237-237: wrong indentation: expected 26 but found 23
(indentation)
[warning] 240-240: wrong indentation: expected 27 but found 26
(indentation)
[error] 249-249: trailing spaces
(trailing-spaces)
[warning] 251-251: wrong indentation: expected 8 but found 6
(indentation)
[warning] 253-253: wrong indentation: expected 10 but found 13
(indentation)
[warning] 254-254: wrong indentation: expected 17 but found 15
(indentation)
[warning] 257-257: wrong indentation: expected 19 but found 18
(indentation)
[warning] 263-263: wrong indentation: expected 14 but found 12
(indentation)
[warning] 264-264: wrong indentation: expected 18 but found 16
(indentation)
[warning] 265-265: wrong indentation: expected 20 but found 18
(indentation)
[warning] 268-268: wrong indentation: expected 18 but found 16
(indentation)
[warning] 269-269: wrong indentation: expected 20 but found 18
(indentation)
[warning] 272-272: wrong indentation: expected 18 but found 20
(indentation)
[warning] 276-276: wrong indentation: expected 18 but found 15
(indentation)
[warning] 279-279: wrong indentation: expected 19 but found 21
(indentation)
[warning] 282-282: wrong indentation: expected 25 but found 22
(indentation)
[warning] 283-283: wrong indentation: expected 28 but found 30
(indentation)
[warning] 287-287: wrong indentation: expected 28 but found 25
(indentation)
[error] 290-290: trailing spaces
(trailing-spaces)
[warning] 292-292: wrong indentation: expected 8 but found 6
(indentation)
[warning] 294-294: wrong indentation: expected 10 but found 13
(indentation)
[warning] 295-295: wrong indentation: expected 17 but found 15
(indentation)
[warning] 298-298: wrong indentation: expected 19 but found 18
(indentation)
[warning] 301-301: wrong indentation: expected 10 but found 7
(indentation)
[warning] 302-302: wrong indentation: expected 13 but found 12
(indentation)
[warning] 305-305: wrong indentation: expected 13 but found 10
(indentation)
[warning] 306-306: wrong indentation: expected 14 but found 12
(indentation)
[warning] 309-309: wrong indentation: expected 13 but found 10
(indentation)
[warning] 310-310: wrong indentation: expected 14 but found 12
(indentation)
[warning] 313-313: wrong indentation: expected 13 but found 20
(indentation)
[warning] 314-314: wrong indentation: expected 24 but found 26
(indentation)
[warning] 317-317: wrong indentation: expected 13 but found 15
(indentation)
[warning] 321-321: wrong indentation: expected 13 but found 15
(indentation)
[warning] 324-324: wrong indentation: expected 19 but found 21
(indentation)
[warning] 327-327: wrong indentation: expected 25 but found 22
(indentation)
[warning] 328-328: wrong indentation: expected 28 but found 30
(indentation)
[warning] 332-332: wrong indentation: expected 28 but found 25
(indentation)
[error] 335-335: trailing spaces
(trailing-spaces)
[warning] 341-341: too many spaces after colon
(colons)
[error] 343-343: trailing spaces
(trailing-spaces)
[warning] 346-346: wrong indentation: expected 14 but found 12
(indentation)
[warning] 351-351: wrong indentation: expected 4 but found 6
(indentation)
[warning] 352-352: wrong indentation: expected 10 but found 8
(indentation)
[warning] 354-354: wrong indentation: expected 12 but found 14
(indentation)
[warning] 358-358: too many blank lines
(2 > 0) (empty-lines)
rules/swift/security/blowfish-hardcoded-secret-swift.yml (5)
1-59
: Indentation and Formatting Cleanup RequiredSimilar to other YAML files, this file also shows multiple YAMLlint formatting issues (incorrect indentation and trailing spaces). Please resolve these formatting warnings to ensure clarity and consistency.
🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 19-19: wrong indentation: expected 12 but found 13
(indentation)
[warning] 20-20: wrong indentation: expected 17 but found 15
(indentation)
[warning] 23-23: wrong indentation: expected 19 but found 18
(indentation)
[warning] 49-49: wrong indentation: expected 22 but found 20
(indentation)
[warning] 50-50: wrong indentation: expected 24 but found 22
(indentation)
[warning] 53-53: wrong indentation: expected 22 but found 20
(indentation)
[warning] 54-54: wrong indentation: expected 24 but found 22
(indentation)
[warning] 58-58: wrong indentation: expected 8 but found 5
(indentation)
60-102
: Double-Check Pattern Matching for Try ExpressionsWithin the
match_pattern_try_expression_directly
block for Blowfish, the regex usage (^Blowfish$
) and structural conditions should be carefully validated to ensure they correctly identify hard-coded secret instances related to Blowfish without generating false positives.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 60-60: wrong indentation: expected 9 but found 13
(indentation)
[warning] 61-61: wrong indentation: expected 17 but found 15
(indentation)
[warning] 64-64: wrong indentation: expected 19 but found 18
(indentation)
[warning] 67-67: wrong indentation: expected 9 but found 16
(indentation)
[warning] 95-95: wrong indentation: expected 22 but found 20
(indentation)
[warning] 96-96: wrong indentation: expected 24 but found 22
(indentation)
[warning] 99-99: wrong indentation: expected 22 but found 20
(indentation)
[warning] 100-100: wrong indentation: expected 24 but found 22
(indentation)
103-159
: Review Pattern Definitions for Blowfish StatementsExamine the rules defined under
match_pattern_Blowfish_statement_directly
and others that follow. Confirm that the matching logic—including exclusions for try expressions and throw keywords—is both comprehensive and precise for detecting hard-coded secrets in Blowfish usage.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 103-103: wrong indentation: expected 22 but found 20
(indentation)
[warning] 107-107: wrong indentation: expected 8 but found 6
(indentation)
[warning] 109-109: wrong indentation: expected 10 but found 13
(indentation)
[warning] 110-110: wrong indentation: expected 17 but found 15
(indentation)
[warning] 113-113: wrong indentation: expected 19 but found 18
(indentation)
[warning] 116-116: wrong indentation: expected 10 but found 16
(indentation)
[warning] 139-139: wrong indentation: expected 22 but found 18
(indentation)
[warning] 140-140: wrong indentation: expected 24 but found 22
(indentation)
[warning] 154-154: wrong indentation: expected 24 but found 22
(indentation)
[warning] 156-156: wrong indentation: expected 26 but found 23
(indentation)
[warning] 159-159: wrong indentation: expected 27 but found 26
(indentation)
160-220
: Assessment of Try Expression Patterns with Instances and UTF-8For the patterns
match_pattern_try_expression_with_instance
andmatch_pattern_try_expression_with_utf8
, ensure that the configurations (including nested conditions and neighbor-based stopping criteria) are robust. Testing with representative Swift code examples is recommended.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 169-169: wrong indentation: expected 22 but found 20
(indentation)
[warning] 170-170: wrong indentation: expected 24 but found 22
(indentation)
[warning] 173-173: wrong indentation: expected 22 but found 20
(indentation)
[warning] 174-174: wrong indentation: expected 24 but found 22
(indentation)
[warning] 177-177: wrong indentation: expected 22 but found 20
(indentation)
[warning] 181-181: wrong indentation: expected 8 but found 5
(indentation)
[warning] 183-183: wrong indentation: expected 9 but found 13
(indentation)
[warning] 184-184: wrong indentation: expected 17 but found 15
(indentation)
[warning] 187-187: wrong indentation: expected 19 but found 18
(indentation)
[warning] 190-190: wrong indentation: expected 9 but found 6
(indentation)
[warning] 191-191: wrong indentation: expected 12 but found 9
(indentation)
[warning] 194-194: wrong indentation: expected 13 but found 16
(indentation)
[warning] 213-213: wrong indentation: expected 22 but found 20
(indentation)
[warning] 214-214: wrong indentation: expected 24 but found 22
(indentation)
[warning] 217-217: wrong indentation: expected 22 but found 20
(indentation)
[warning] 218-218: wrong indentation: expected 24 but found 22
(indentation)
337-358
: General Rule and Constraint ValidationVerify that the aggregated rule block (lines 337–349) properly combines the defined patterns and that the constraints (lines 351–357) correctly enforce the expected structure for line string literals holding secrets.
🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 341-341: too many spaces after colon
(colons)
[error] 343-343: trailing spaces
(trailing-spaces)
[warning] 346-346: wrong indentation: expected 14 but found 12
(indentation)
[warning] 351-351: wrong indentation: expected 4 but found 6
(indentation)
[warning] 352-352: wrong indentation: expected 10 but found 8
(indentation)
[warning] 354-354: wrong indentation: expected 12 but found 14
(indentation)
[warning] 357-357: too many blank lines
(1 > 0) (empty-lines)
tests/__snapshots__/aes-hardcoded-secret-swift-snapshot.yml (4)
1-185
: Indentation and Formatting Cleanup RequiredThis AES snapshot file exhibits several formatting issues similar to other YAML files in this PR. Please address all reported indentation inconsistencies and remove trailing whitespaces for clarity and consistency.
3-37
: Validate Static Snapshot Labels for Hardcoded AES KeyFor the initial snapshot block with
AES(key: "hello", iv: "123")
,
the set of secondary labels (covering the key, IV, and composite expressions) should be reviewed for redundancy—ensure each label serves a clear purpose in validating the snapshot.
38-89
: Consistency Check for Dynamic Key Snapshot in AESThe block showing
let password: Array<UInt8> = Array("s33krit".utf8)
followed by
AES(key: password, iv: "123")
includes multiple detailed labels. Confirm that these labels accurately represent the dynamic key conversion and that their ranges are consistent with the intended test scenario.
90-146
: Review 'try' Snapshot for AES with Error HandlingThe final snapshot that uses the
try
keyword (lines 90–146) should be verified for proper error-handling representation. Ensure that the associated labels clearly capture the separate elements of the call, including the error propagation mechanism.tests/__snapshots__/ruby-mysql2-empty-password-ruby-snapshot.yml (3)
1-68
: Review Ruby Snapshot for Mysql2 Client (Empty Password with Direct String)The first snapshot demonstrates initializing the Mysql2 client with an explicit empty password (
""
). Confirm that this example properly illustrates the risk of hard-coded empty passwords and that the labels accurately highlight the client instantiation parts.
69-147
: Review Ruby Snapshot for Mysql2 Client (Empty Password via Variable)In the second snapshot block, the empty password is assigned to a variable (
pw = ""
) before being used in the client initialization. Please ensure that the labels and code differentiate this scenario clearly from the direct empty string usage, providing comprehensive test coverage.
1-147
: Indentation and Formatting Cleanup RequiredAs with other YAML files in this PR, please check and correct any indentation issues and remove trailing spaces across this file to ensure consistency with YAML best practices.
rules/swift/security/rabbit-hardcoded-secret-swift.yml (2)
15-335
: Address YAML Indentation InconsistenciesStatic analysis tools have flagged several indentation issues (for instance, line 19 expected 12 spaces but found 13, line 20 expected 17 but found 15, and others throughout this block). These inconsistencies may lead to parsing issues in some YAML parsers. It is recommended to standardize the indentation (e.g. use 2 spaces per level) for clarity and to avoid potential misinterpretation of the configuration.
For example, you can consider a diff like:
-utils: - match_pattern_try_expression_directly: - kind: try_expression - not: - inside: - stopBy: end - kind: call_expression - has: - kind: simple_identifier - regex: ^Rabbit$ +utils: + match_pattern_try_expression_directly: + kind: try_expression + not: + inside: + stopBy: end + kind: call_expression + has: + kind: simple_identifier + regex: ^Rabbit$Please review all nested blocks (e.g. under keys like
not:
,has:
,all:
, andfollows:
) to ensure that the indentation is consistent throughout the file.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 19-19: wrong indentation: expected 12 but found 13
(indentation)
[warning] 20-20: wrong indentation: expected 17 but found 15
(indentation)
[warning] 23-23: wrong indentation: expected 19 but found 18
(indentation)
[warning] 49-49: wrong indentation: expected 22 but found 20
(indentation)
[warning] 50-50: wrong indentation: expected 24 but found 22
(indentation)
[warning] 53-53: wrong indentation: expected 22 but found 20
(indentation)
[warning] 54-54: wrong indentation: expected 24 but found 22
(indentation)
[warning] 58-58: wrong indentation: expected 8 but found 5
(indentation)
[warning] 60-60: wrong indentation: expected 9 but found 13
(indentation)
[warning] 61-61: wrong indentation: expected 17 but found 15
(indentation)
[warning] 64-64: wrong indentation: expected 19 but found 18
(indentation)
[warning] 67-67: wrong indentation: expected 9 but found 16
(indentation)
[warning] 95-95: wrong indentation: expected 22 but found 20
(indentation)
[warning] 96-96: wrong indentation: expected 24 but found 22
(indentation)
[warning] 99-99: wrong indentation: expected 22 but found 20
(indentation)
[warning] 100-100: wrong indentation: expected 24 but found 22
(indentation)
[warning] 103-103: wrong indentation: expected 22 but found 20
(indentation)
[warning] 107-107: wrong indentation: expected 8 but found 6
(indentation)
[warning] 109-109: wrong indentation: expected 10 but found 13
(indentation)
[warning] 110-110: wrong indentation: expected 17 but found 15
(indentation)
[warning] 113-113: wrong indentation: expected 19 but found 18
(indentation)
[warning] 116-116: wrong indentation: expected 10 but found 16
(indentation)
[warning] 139-139: wrong indentation: expected 22 but found 18
(indentation)
[warning] 140-140: wrong indentation: expected 24 but found 22
(indentation)
[warning] 154-154: wrong indentation: expected 24 but found 22
(indentation)
[warning] 156-156: wrong indentation: expected 26 but found 23
(indentation)
[warning] 159-159: wrong indentation: expected 27 but found 26
(indentation)
[warning] 169-169: wrong indentation: expected 22 but found 20
(indentation)
[warning] 170-170: wrong indentation: expected 24 but found 22
(indentation)
[warning] 173-173: wrong indentation: expected 22 but found 20
(indentation)
[warning] 174-174: wrong indentation: expected 24 but found 22
(indentation)
[warning] 177-177: wrong indentation: expected 22 but found 20
(indentation)
[warning] 181-181: wrong indentation: expected 8 but found 5
(indentation)
[warning] 183-183: wrong indentation: expected 9 but found 13
(indentation)
[warning] 184-184: wrong indentation: expected 17 but found 15
(indentation)
[warning] 187-187: wrong indentation: expected 19 but found 18
(indentation)
[warning] 190-190: wrong indentation: expected 9 but found 6
(indentation)
[warning] 191-191: wrong indentation: expected 12 but found 9
(indentation)
[warning] 194-194: wrong indentation: expected 13 but found 16
(indentation)
[warning] 213-213: wrong indentation: expected 22 but found 20
(indentation)
[warning] 214-214: wrong indentation: expected 24 but found 22
(indentation)
[warning] 217-217: wrong indentation: expected 22 but found 20
(indentation)
[warning] 218-218: wrong indentation: expected 24 but found 22
(indentation)
[warning] 221-221: wrong indentation: expected 12 but found 18
(indentation)
[warning] 222-222: wrong indentation: expected 24 but found 22
(indentation)
[warning] 235-235: wrong indentation: expected 24 but found 22
(indentation)
[warning] 237-237: wrong indentation: expected 26 but found 23
(indentation)
[warning] 240-240: wrong indentation: expected 27 but found 26
(indentation)
[error] 249-249: trailing spaces
(trailing-spaces)
[warning] 251-251: wrong indentation: expected 8 but found 6
(indentation)
[warning] 253-253: wrong indentation: expected 10 but found 13
(indentation)
[warning] 254-254: wrong indentation: expected 17 but found 15
(indentation)
[warning] 257-257: wrong indentation: expected 19 but found 18
(indentation)
[warning] 263-263: wrong indentation: expected 14 but found 12
(indentation)
[warning] 264-264: wrong indentation: expected 18 but found 16
(indentation)
[warning] 265-265: wrong indentation: expected 20 but found 18
(indentation)
[warning] 268-268: wrong indentation: expected 18 but found 16
(indentation)
[warning] 269-269: wrong indentation: expected 20 but found 18
(indentation)
[warning] 272-272: wrong indentation: expected 18 but found 20
(indentation)
[warning] 276-276: wrong indentation: expected 18 but found 15
(indentation)
[warning] 279-279: wrong indentation: expected 19 but found 21
(indentation)
[warning] 282-282: wrong indentation: expected 25 but found 22
(indentation)
[warning] 283-283: wrong indentation: expected 28 but found 30
(indentation)
[warning] 287-287: wrong indentation: expected 28 but found 25
(indentation)
[error] 290-290: trailing spaces
(trailing-spaces)
[warning] 292-292: wrong indentation: expected 8 but found 6
(indentation)
[warning] 294-294: wrong indentation: expected 10 but found 13
(indentation)
[warning] 295-295: wrong indentation: expected 17 but found 15
(indentation)
[warning] 298-298: wrong indentation: expected 19 but found 18
(indentation)
[warning] 301-301: wrong indentation: expected 10 but found 7
(indentation)
[warning] 302-302: wrong indentation: expected 13 but found 12
(indentation)
[warning] 305-305: wrong indentation: expected 13 but found 10
(indentation)
[warning] 306-306: wrong indentation: expected 14 but found 12
(indentation)
[warning] 309-309: wrong indentation: expected 13 but found 10
(indentation)
[warning] 310-310: wrong indentation: expected 14 but found 12
(indentation)
[warning] 313-313: wrong indentation: expected 13 but found 20
(indentation)
[warning] 314-314: wrong indentation: expected 24 but found 26
(indentation)
[warning] 317-317: wrong indentation: expected 13 but found 15
(indentation)
[warning] 321-321: wrong indentation: expected 13 but found 15
(indentation)
[warning] 324-324: wrong indentation: expected 19 but found 21
(indentation)
[warning] 327-327: wrong indentation: expected 25 but found 22
(indentation)
[warning] 328-328: wrong indentation: expected 28 but found 30
(indentation)
[warning] 332-332: wrong indentation: expected 28 but found 25
(indentation)
[error] 335-335: trailing spaces
(trailing-spaces)
249-249
: Remove Trailing SpacesTrailing whitespace was detected on lines 249, 290, and 343. Removing these will keep the file clean and prevent potential issues with version control or YAML parsers.
Also applies to: 290-290, 343-343
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 249-249: trailing spaces
(trailing-spaces)
rules/swift/security/aes-hardcoded-secret-swift.yml (2)
15-335
: Standardize YAML Indentation in the Utils BlockSimilar to the Rabbit rule file, the utils block in this file presents indentation inconsistencies (e.g. warnings on lines 19, 20, 23, etc.). To ensure the YAML is parsed correctly and remains maintainable, please reformat the file by standardizing the indentation (suggested: 2 spaces per level). For instance, you might adjust the block as follows:
-utils: - match_pattern_try_expression_directly: - kind: try_expression - not: - inside: - stopBy: end - kind: call_expression - has: - kind: simple_identifier - regex: ^AES$ +utils: + match_pattern_try_expression_directly: + kind: try_expression + not: + inside: + stopBy: end + kind: call_expression + has: + kind: simple_identifier + regex: ^AES$Be sure to review similar nested blocks (e.g. under
match_pattern_AES_statement_directly
,match_pattern_AES_expression_with_instance
, etc.) to address all reported indentation warnings.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 19-19: wrong indentation: expected 12 but found 13
(indentation)
[warning] 20-20: wrong indentation: expected 17 but found 15
(indentation)
[warning] 23-23: wrong indentation: expected 19 but found 18
(indentation)
[warning] 49-49: wrong indentation: expected 22 but found 20
(indentation)
[warning] 50-50: wrong indentation: expected 24 but found 22
(indentation)
[warning] 53-53: wrong indentation: expected 22 but found 20
(indentation)
[warning] 54-54: wrong indentation: expected 24 but found 22
(indentation)
[warning] 58-58: wrong indentation: expected 8 but found 5
(indentation)
[warning] 60-60: wrong indentation: expected 9 but found 13
(indentation)
[warning] 61-61: wrong indentation: expected 17 but found 15
(indentation)
[warning] 64-64: wrong indentation: expected 19 but found 18
(indentation)
[warning] 67-67: wrong indentation: expected 9 but found 16
(indentation)
[warning] 95-95: wrong indentation: expected 22 but found 20
(indentation)
[warning] 96-96: wrong indentation: expected 24 but found 22
(indentation)
[warning] 99-99: wrong indentation: expected 22 but found 20
(indentation)
[warning] 100-100: wrong indentation: expected 24 but found 22
(indentation)
[warning] 103-103: wrong indentation: expected 22 but found 20
(indentation)
[warning] 107-107: wrong indentation: expected 8 but found 6
(indentation)
[warning] 109-109: wrong indentation: expected 10 but found 13
(indentation)
[warning] 110-110: wrong indentation: expected 17 but found 15
(indentation)
[warning] 113-113: wrong indentation: expected 19 but found 18
(indentation)
[warning] 116-116: wrong indentation: expected 10 but found 16
(indentation)
[warning] 139-139: wrong indentation: expected 22 but found 18
(indentation)
[warning] 140-140: wrong indentation: expected 24 but found 22
(indentation)
[warning] 154-154: wrong indentation: expected 24 but found 22
(indentation)
[warning] 156-156: wrong indentation: expected 26 but found 23
(indentation)
[warning] 159-159: wrong indentation: expected 27 but found 26
(indentation)
[warning] 169-169: wrong indentation: expected 22 but found 20
(indentation)
[warning] 170-170: wrong indentation: expected 24 but found 22
(indentation)
[warning] 173-173: wrong indentation: expected 22 but found 20
(indentation)
[warning] 174-174: wrong indentation: expected 24 but found 22
(indentation)
[warning] 177-177: wrong indentation: expected 22 but found 20
(indentation)
[warning] 181-181: wrong indentation: expected 8 but found 5
(indentation)
[warning] 183-183: wrong indentation: expected 9 but found 13
(indentation)
[warning] 184-184: wrong indentation: expected 17 but found 15
(indentation)
[warning] 187-187: wrong indentation: expected 19 but found 18
(indentation)
[warning] 190-190: wrong indentation: expected 9 but found 6
(indentation)
[warning] 191-191: wrong indentation: expected 12 but found 9
(indentation)
[warning] 194-194: wrong indentation: expected 13 but found 16
(indentation)
[warning] 213-213: wrong indentation: expected 22 but found 20
(indentation)
[warning] 214-214: wrong indentation: expected 24 but found 22
(indentation)
[warning] 217-217: wrong indentation: expected 22 but found 20
(indentation)
[warning] 218-218: wrong indentation: expected 24 but found 22
(indentation)
[warning] 221-221: wrong indentation: expected 12 but found 18
(indentation)
[warning] 222-222: wrong indentation: expected 24 but found 22
(indentation)
[warning] 235-235: wrong indentation: expected 24 but found 22
(indentation)
[warning] 237-237: wrong indentation: expected 26 but found 23
(indentation)
[warning] 240-240: wrong indentation: expected 27 but found 26
(indentation)
[error] 249-249: trailing spaces
(trailing-spaces)
[warning] 251-251: wrong indentation: expected 8 but found 6
(indentation)
[warning] 253-253: wrong indentation: expected 10 but found 13
(indentation)
[warning] 254-254: wrong indentation: expected 17 but found 15
(indentation)
[warning] 257-257: wrong indentation: expected 19 but found 18
(indentation)
[warning] 263-263: wrong indentation: expected 14 but found 12
(indentation)
[warning] 264-264: wrong indentation: expected 18 but found 16
(indentation)
[warning] 265-265: wrong indentation: expected 20 but found 18
(indentation)
[warning] 268-268: wrong indentation: expected 18 but found 16
(indentation)
[warning] 269-269: wrong indentation: expected 20 but found 18
(indentation)
[warning] 272-272: wrong indentation: expected 18 but found 20
(indentation)
[warning] 276-276: wrong indentation: expected 18 but found 15
(indentation)
[warning] 279-279: wrong indentation: expected 19 but found 21
(indentation)
[warning] 282-282: wrong indentation: expected 25 but found 22
(indentation)
[warning] 283-283: wrong indentation: expected 28 but found 30
(indentation)
[warning] 287-287: wrong indentation: expected 28 but found 25
(indentation)
[error] 290-290: trailing spaces
(trailing-spaces)
[warning] 292-292: wrong indentation: expected 8 but found 6
(indentation)
[warning] 294-294: wrong indentation: expected 10 but found 13
(indentation)
[warning] 295-295: wrong indentation: expected 17 but found 15
(indentation)
[warning] 298-298: wrong indentation: expected 19 but found 18
(indentation)
[warning] 301-301: wrong indentation: expected 10 but found 7
(indentation)
[warning] 302-302: wrong indentation: expected 13 but found 12
(indentation)
[warning] 305-305: wrong indentation: expected 13 but found 10
(indentation)
[warning] 306-306: wrong indentation: expected 14 but found 12
(indentation)
[warning] 309-309: wrong indentation: expected 13 but found 10
(indentation)
[warning] 310-310: wrong indentation: expected 14 but found 12
(indentation)
[warning] 313-313: wrong indentation: expected 13 but found 20
(indentation)
[warning] 314-314: wrong indentation: expected 24 but found 26
(indentation)
[warning] 317-317: wrong indentation: expected 13 but found 15
(indentation)
[warning] 321-321: wrong indentation: expected 13 but found 15
(indentation)
[warning] 324-324: wrong indentation: expected 19 but found 21
(indentation)
[warning] 327-327: wrong indentation: expected 25 but found 22
(indentation)
[warning] 328-328: wrong indentation: expected 28 but found 30
(indentation)
[warning] 332-332: wrong indentation: expected 28 but found 25
(indentation)
[error] 335-335: trailing spaces
(trailing-spaces)
249-249
: Eliminate Trailing WhitespacesTrailing spaces were flagged on lines 249, 290, 335, and 343. Removing these will keep the file clean and avoid potential issues in processing.
Also applies to: 290-290, 335-335, 343-343
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 249-249: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (13)
rules/swift/security/aes-hardcoded-secret-swift.yml
(1 hunks)rules/swift/security/blowfish-hardcoded-secret-swift.yml
(1 hunks)rules/swift/security/chacha20-hardcoded-secret-swift.yml
(1 hunks)rules/swift/security/rabbit-hardcoded-secret-swift.yml
(1 hunks)tests/__snapshots__/aes-hardcoded-secret-swift-snapshot.yml
(1 hunks)tests/__snapshots__/blowfish-hardcoded-secret-swift-snapshot.yml
(1 hunks)tests/__snapshots__/chacha20-hardcoded-secret-swift-snapshot.yml
(1 hunks)tests/__snapshots__/rabbit-hardcoded-secret-swift-snapshot.yml
(1 hunks)tests/__snapshots__/ruby-mysql2-empty-password-ruby-snapshot.yml
(1 hunks)tests/swift/aes-hardcoded-secret-swift-test.yml
(1 hunks)tests/swift/blowfish-hardcoded-secret-swift-test.yml
(1 hunks)tests/swift/chacha20-hardcoded-secret-swift-test.yml
(1 hunks)tests/swift/rabbit-hardcoded-secret-swift-test.yml
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- tests/snapshots/blowfish-hardcoded-secret-swift-snapshot.yml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
tests/swift/chacha20-hardcoded-secret-swift-test.yml
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
tests/swift/rabbit-hardcoded-secret-swift-test.yml
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
tests/swift/blowfish-hardcoded-secret-swift-test.yml
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
rules/swift/security/chacha20-hardcoded-secret-swift.yml
[warning] 19-19: wrong indentation: expected 12 but found 13
(indentation)
[warning] 20-20: wrong indentation: expected 17 but found 15
(indentation)
[warning] 23-23: wrong indentation: expected 19 but found 18
(indentation)
[warning] 49-49: wrong indentation: expected 22 but found 20
(indentation)
[warning] 50-50: wrong indentation: expected 24 but found 22
(indentation)
[warning] 53-53: wrong indentation: expected 22 but found 20
(indentation)
[warning] 54-54: wrong indentation: expected 24 but found 22
(indentation)
[warning] 58-58: wrong indentation: expected 8 but found 5
(indentation)
[warning] 60-60: wrong indentation: expected 9 but found 13
(indentation)
[warning] 61-61: wrong indentation: expected 17 but found 15
(indentation)
[warning] 64-64: wrong indentation: expected 19 but found 18
(indentation)
[warning] 67-67: wrong indentation: expected 9 but found 16
(indentation)
[warning] 95-95: wrong indentation: expected 22 but found 20
(indentation)
[warning] 96-96: wrong indentation: expected 24 but found 22
(indentation)
[warning] 99-99: wrong indentation: expected 22 but found 20
(indentation)
[warning] 100-100: wrong indentation: expected 24 but found 22
(indentation)
[warning] 103-103: wrong indentation: expected 22 but found 20
(indentation)
[warning] 107-107: wrong indentation: expected 8 but found 6
(indentation)
[warning] 109-109: wrong indentation: expected 10 but found 13
(indentation)
[warning] 110-110: wrong indentation: expected 17 but found 15
(indentation)
[warning] 113-113: wrong indentation: expected 19 but found 18
(indentation)
[warning] 116-116: wrong indentation: expected 10 but found 16
(indentation)
[warning] 139-139: wrong indentation: expected 22 but found 18
(indentation)
[warning] 140-140: wrong indentation: expected 24 but found 22
(indentation)
[warning] 154-154: wrong indentation: expected 24 but found 22
(indentation)
[warning] 156-156: wrong indentation: expected 26 but found 23
(indentation)
[warning] 159-159: wrong indentation: expected 27 but found 26
(indentation)
[warning] 169-169: wrong indentation: expected 22 but found 20
(indentation)
[warning] 170-170: wrong indentation: expected 24 but found 22
(indentation)
[warning] 173-173: wrong indentation: expected 22 but found 20
(indentation)
[warning] 174-174: wrong indentation: expected 24 but found 22
(indentation)
[warning] 177-177: wrong indentation: expected 22 but found 20
(indentation)
[warning] 181-181: wrong indentation: expected 8 but found 5
(indentation)
[warning] 183-183: wrong indentation: expected 9 but found 13
(indentation)
[warning] 184-184: wrong indentation: expected 17 but found 15
(indentation)
[warning] 187-187: wrong indentation: expected 19 but found 18
(indentation)
[warning] 190-190: wrong indentation: expected 9 but found 6
(indentation)
[warning] 191-191: wrong indentation: expected 12 but found 9
(indentation)
[warning] 194-194: wrong indentation: expected 13 but found 16
(indentation)
[warning] 213-213: wrong indentation: expected 22 but found 20
(indentation)
[warning] 214-214: wrong indentation: expected 24 but found 22
(indentation)
[warning] 217-217: wrong indentation: expected 22 but found 20
(indentation)
[warning] 218-218: wrong indentation: expected 24 but found 22
(indentation)
[warning] 221-221: wrong indentation: expected 12 but found 18
(indentation)
[warning] 222-222: wrong indentation: expected 24 but found 22
(indentation)
[warning] 235-235: wrong indentation: expected 24 but found 22
(indentation)
[warning] 237-237: wrong indentation: expected 26 but found 23
(indentation)
[warning] 240-240: wrong indentation: expected 27 but found 26
(indentation)
[error] 249-249: trailing spaces
(trailing-spaces)
[warning] 251-251: wrong indentation: expected 8 but found 6
(indentation)
[warning] 253-253: wrong indentation: expected 10 but found 13
(indentation)
[warning] 254-254: wrong indentation: expected 17 but found 15
(indentation)
[warning] 257-257: wrong indentation: expected 19 but found 18
(indentation)
[warning] 263-263: wrong indentation: expected 14 but found 12
(indentation)
[warning] 264-264: wrong indentation: expected 18 but found 16
(indentation)
[warning] 265-265: wrong indentation: expected 20 but found 18
(indentation)
[warning] 268-268: wrong indentation: expected 18 but found 16
(indentation)
[warning] 269-269: wrong indentation: expected 20 but found 18
(indentation)
[warning] 272-272: wrong indentation: expected 18 but found 20
(indentation)
[warning] 276-276: wrong indentation: expected 18 but found 15
(indentation)
[warning] 279-279: wrong indentation: expected 19 but found 21
(indentation)
[warning] 282-282: wrong indentation: expected 25 but found 22
(indentation)
[warning] 283-283: wrong indentation: expected 28 but found 30
(indentation)
[warning] 287-287: wrong indentation: expected 28 but found 25
(indentation)
[error] 290-290: trailing spaces
(trailing-spaces)
[warning] 292-292: wrong indentation: expected 8 but found 6
(indentation)
[warning] 294-294: wrong indentation: expected 10 but found 13
(indentation)
[warning] 295-295: wrong indentation: expected 17 but found 15
(indentation)
[warning] 298-298: wrong indentation: expected 19 but found 18
(indentation)
[warning] 301-301: wrong indentation: expected 10 but found 7
(indentation)
[warning] 302-302: wrong indentation: expected 13 but found 12
(indentation)
[warning] 305-305: wrong indentation: expected 13 but found 10
(indentation)
[warning] 306-306: wrong indentation: expected 14 but found 12
(indentation)
[warning] 309-309: wrong indentation: expected 13 but found 10
(indentation)
[warning] 310-310: wrong indentation: expected 14 but found 12
(indentation)
[warning] 313-313: wrong indentation: expected 13 but found 20
(indentation)
[warning] 314-314: wrong indentation: expected 24 but found 26
(indentation)
[warning] 317-317: wrong indentation: expected 13 but found 15
(indentation)
[warning] 321-321: wrong indentation: expected 13 but found 15
(indentation)
[warning] 324-324: wrong indentation: expected 19 but found 21
(indentation)
[warning] 327-327: wrong indentation: expected 25 but found 22
(indentation)
[warning] 328-328: wrong indentation: expected 28 but found 30
(indentation)
[warning] 332-332: wrong indentation: expected 28 but found 25
(indentation)
[error] 335-335: trailing spaces
(trailing-spaces)
[warning] 341-341: too many spaces after colon
(colons)
[error] 343-343: trailing spaces
(trailing-spaces)
[warning] 346-346: wrong indentation: expected 14 but found 12
(indentation)
[warning] 351-351: wrong indentation: expected 4 but found 6
(indentation)
[warning] 352-352: wrong indentation: expected 10 but found 8
(indentation)
[warning] 354-354: wrong indentation: expected 12 but found 14
(indentation)
[warning] 358-358: too many blank lines
(2 > 0) (empty-lines)
rules/swift/security/aes-hardcoded-secret-swift.yml
[warning] 19-19: wrong indentation: expected 12 but found 13
(indentation)
[warning] 20-20: wrong indentation: expected 17 but found 15
(indentation)
[warning] 23-23: wrong indentation: expected 19 but found 18
(indentation)
[warning] 49-49: wrong indentation: expected 22 but found 20
(indentation)
[warning] 50-50: wrong indentation: expected 24 but found 22
(indentation)
[warning] 53-53: wrong indentation: expected 22 but found 20
(indentation)
[warning] 54-54: wrong indentation: expected 24 but found 22
(indentation)
[warning] 58-58: wrong indentation: expected 8 but found 5
(indentation)
[warning] 60-60: wrong indentation: expected 9 but found 13
(indentation)
[warning] 61-61: wrong indentation: expected 17 but found 15
(indentation)
[warning] 64-64: wrong indentation: expected 19 but found 18
(indentation)
[warning] 67-67: wrong indentation: expected 9 but found 16
(indentation)
[warning] 95-95: wrong indentation: expected 22 but found 20
(indentation)
[warning] 96-96: wrong indentation: expected 24 but found 22
(indentation)
[warning] 99-99: wrong indentation: expected 22 but found 20
(indentation)
[warning] 100-100: wrong indentation: expected 24 but found 22
(indentation)
[warning] 103-103: wrong indentation: expected 22 but found 20
(indentation)
[warning] 107-107: wrong indentation: expected 8 but found 6
(indentation)
[warning] 109-109: wrong indentation: expected 10 but found 13
(indentation)
[warning] 110-110: wrong indentation: expected 17 but found 15
(indentation)
[warning] 113-113: wrong indentation: expected 19 but found 18
(indentation)
[warning] 116-116: wrong indentation: expected 10 but found 16
(indentation)
[warning] 139-139: wrong indentation: expected 22 but found 18
(indentation)
[warning] 140-140: wrong indentation: expected 24 but found 22
(indentation)
[warning] 154-154: wrong indentation: expected 24 but found 22
(indentation)
[warning] 156-156: wrong indentation: expected 26 but found 23
(indentation)
[warning] 159-159: wrong indentation: expected 27 but found 26
(indentation)
[warning] 169-169: wrong indentation: expected 22 but found 20
(indentation)
[warning] 170-170: wrong indentation: expected 24 but found 22
(indentation)
[warning] 173-173: wrong indentation: expected 22 but found 20
(indentation)
[warning] 174-174: wrong indentation: expected 24 but found 22
(indentation)
[warning] 177-177: wrong indentation: expected 22 but found 20
(indentation)
[warning] 181-181: wrong indentation: expected 8 but found 5
(indentation)
[warning] 183-183: wrong indentation: expected 9 but found 13
(indentation)
[warning] 184-184: wrong indentation: expected 17 but found 15
(indentation)
[warning] 187-187: wrong indentation: expected 19 but found 18
(indentation)
[warning] 190-190: wrong indentation: expected 9 but found 6
(indentation)
[warning] 191-191: wrong indentation: expected 12 but found 9
(indentation)
[warning] 194-194: wrong indentation: expected 13 but found 16
(indentation)
[warning] 213-213: wrong indentation: expected 22 but found 20
(indentation)
[warning] 214-214: wrong indentation: expected 24 but found 22
(indentation)
[warning] 217-217: wrong indentation: expected 22 but found 20
(indentation)
[warning] 218-218: wrong indentation: expected 24 but found 22
(indentation)
[warning] 221-221: wrong indentation: expected 12 but found 18
(indentation)
[warning] 222-222: wrong indentation: expected 24 but found 22
(indentation)
[warning] 235-235: wrong indentation: expected 24 but found 22
(indentation)
[warning] 237-237: wrong indentation: expected 26 but found 23
(indentation)
[warning] 240-240: wrong indentation: expected 27 but found 26
(indentation)
[error] 249-249: trailing spaces
(trailing-spaces)
[warning] 251-251: wrong indentation: expected 8 but found 6
(indentation)
[warning] 253-253: wrong indentation: expected 10 but found 13
(indentation)
[warning] 254-254: wrong indentation: expected 17 but found 15
(indentation)
[warning] 257-257: wrong indentation: expected 19 but found 18
(indentation)
[warning] 263-263: wrong indentation: expected 14 but found 12
(indentation)
[warning] 264-264: wrong indentation: expected 18 but found 16
(indentation)
[warning] 265-265: wrong indentation: expected 20 but found 18
(indentation)
[warning] 268-268: wrong indentation: expected 18 but found 16
(indentation)
[warning] 269-269: wrong indentation: expected 20 but found 18
(indentation)
[warning] 272-272: wrong indentation: expected 18 but found 20
(indentation)
[warning] 276-276: wrong indentation: expected 18 but found 15
(indentation)
[warning] 279-279: wrong indentation: expected 19 but found 21
(indentation)
[warning] 282-282: wrong indentation: expected 25 but found 22
(indentation)
[warning] 283-283: wrong indentation: expected 28 but found 30
(indentation)
[warning] 287-287: wrong indentation: expected 28 but found 25
(indentation)
[error] 290-290: trailing spaces
(trailing-spaces)
[warning] 292-292: wrong indentation: expected 8 but found 6
(indentation)
[warning] 294-294: wrong indentation: expected 10 but found 13
(indentation)
[warning] 295-295: wrong indentation: expected 17 but found 15
(indentation)
[warning] 298-298: wrong indentation: expected 19 but found 18
(indentation)
[warning] 301-301: wrong indentation: expected 10 but found 7
(indentation)
[warning] 302-302: wrong indentation: expected 13 but found 12
(indentation)
[warning] 305-305: wrong indentation: expected 13 but found 10
(indentation)
[warning] 306-306: wrong indentation: expected 14 but found 12
(indentation)
[warning] 309-309: wrong indentation: expected 13 but found 10
(indentation)
[warning] 310-310: wrong indentation: expected 14 but found 12
(indentation)
[warning] 313-313: wrong indentation: expected 13 but found 20
(indentation)
[warning] 314-314: wrong indentation: expected 24 but found 26
(indentation)
[warning] 317-317: wrong indentation: expected 13 but found 15
(indentation)
[warning] 321-321: wrong indentation: expected 13 but found 15
(indentation)
[warning] 324-324: wrong indentation: expected 19 but found 21
(indentation)
[warning] 327-327: wrong indentation: expected 25 but found 22
(indentation)
[warning] 328-328: wrong indentation: expected 28 but found 30
(indentation)
[warning] 332-332: wrong indentation: expected 28 but found 25
(indentation)
[error] 335-335: trailing spaces
(trailing-spaces)
[warning] 341-341: too many spaces after colon
(colons)
[error] 343-343: trailing spaces
(trailing-spaces)
[warning] 346-346: wrong indentation: expected 14 but found 12
(indentation)
[warning] 351-351: wrong indentation: expected 4 but found 6
(indentation)
[warning] 352-352: wrong indentation: expected 10 but found 8
(indentation)
[warning] 354-354: wrong indentation: expected 12 but found 14
(indentation)
[warning] 357-357: too many blank lines
(1 > 0) (empty-lines)
rules/swift/security/rabbit-hardcoded-secret-swift.yml
[warning] 19-19: wrong indentation: expected 12 but found 13
(indentation)
[warning] 20-20: wrong indentation: expected 17 but found 15
(indentation)
[warning] 23-23: wrong indentation: expected 19 but found 18
(indentation)
[warning] 49-49: wrong indentation: expected 22 but found 20
(indentation)
[warning] 50-50: wrong indentation: expected 24 but found 22
(indentation)
[warning] 53-53: wrong indentation: expected 22 but found 20
(indentation)
[warning] 54-54: wrong indentation: expected 24 but found 22
(indentation)
[warning] 58-58: wrong indentation: expected 8 but found 5
(indentation)
[warning] 60-60: wrong indentation: expected 9 but found 13
(indentation)
[warning] 61-61: wrong indentation: expected 17 but found 15
(indentation)
[warning] 64-64: wrong indentation: expected 19 but found 18
(indentation)
[warning] 67-67: wrong indentation: expected 9 but found 16
(indentation)
[warning] 95-95: wrong indentation: expected 22 but found 20
(indentation)
[warning] 96-96: wrong indentation: expected 24 but found 22
(indentation)
[warning] 99-99: wrong indentation: expected 22 but found 20
(indentation)
[warning] 100-100: wrong indentation: expected 24 but found 22
(indentation)
[warning] 103-103: wrong indentation: expected 22 but found 20
(indentation)
[warning] 107-107: wrong indentation: expected 8 but found 6
(indentation)
[warning] 109-109: wrong indentation: expected 10 but found 13
(indentation)
[warning] 110-110: wrong indentation: expected 17 but found 15
(indentation)
[warning] 113-113: wrong indentation: expected 19 but found 18
(indentation)
[warning] 116-116: wrong indentation: expected 10 but found 16
(indentation)
[warning] 139-139: wrong indentation: expected 22 but found 18
(indentation)
[warning] 140-140: wrong indentation: expected 24 but found 22
(indentation)
[warning] 154-154: wrong indentation: expected 24 but found 22
(indentation)
[warning] 156-156: wrong indentation: expected 26 but found 23
(indentation)
[warning] 159-159: wrong indentation: expected 27 but found 26
(indentation)
[warning] 169-169: wrong indentation: expected 22 but found 20
(indentation)
[warning] 170-170: wrong indentation: expected 24 but found 22
(indentation)
[warning] 173-173: wrong indentation: expected 22 but found 20
(indentation)
[warning] 174-174: wrong indentation: expected 24 but found 22
(indentation)
[warning] 177-177: wrong indentation: expected 22 but found 20
(indentation)
[warning] 181-181: wrong indentation: expected 8 but found 5
(indentation)
[warning] 183-183: wrong indentation: expected 9 but found 13
(indentation)
[warning] 184-184: wrong indentation: expected 17 but found 15
(indentation)
[warning] 187-187: wrong indentation: expected 19 but found 18
(indentation)
[warning] 190-190: wrong indentation: expected 9 but found 6
(indentation)
[warning] 191-191: wrong indentation: expected 12 but found 9
(indentation)
[warning] 194-194: wrong indentation: expected 13 but found 16
(indentation)
[warning] 213-213: wrong indentation: expected 22 but found 20
(indentation)
[warning] 214-214: wrong indentation: expected 24 but found 22
(indentation)
[warning] 217-217: wrong indentation: expected 22 but found 20
(indentation)
[warning] 218-218: wrong indentation: expected 24 but found 22
(indentation)
[warning] 221-221: wrong indentation: expected 12 but found 18
(indentation)
[warning] 222-222: wrong indentation: expected 24 but found 22
(indentation)
[warning] 235-235: wrong indentation: expected 24 but found 22
(indentation)
[warning] 237-237: wrong indentation: expected 26 but found 23
(indentation)
[warning] 240-240: wrong indentation: expected 27 but found 26
(indentation)
[error] 249-249: trailing spaces
(trailing-spaces)
[warning] 251-251: wrong indentation: expected 8 but found 6
(indentation)
[warning] 253-253: wrong indentation: expected 10 but found 13
(indentation)
[warning] 254-254: wrong indentation: expected 17 but found 15
(indentation)
[warning] 257-257: wrong indentation: expected 19 but found 18
(indentation)
[warning] 263-263: wrong indentation: expected 14 but found 12
(indentation)
[warning] 264-264: wrong indentation: expected 18 but found 16
(indentation)
[warning] 265-265: wrong indentation: expected 20 but found 18
(indentation)
[warning] 268-268: wrong indentation: expected 18 but found 16
(indentation)
[warning] 269-269: wrong indentation: expected 20 but found 18
(indentation)
[warning] 272-272: wrong indentation: expected 18 but found 20
(indentation)
[warning] 276-276: wrong indentation: expected 18 but found 15
(indentation)
[warning] 279-279: wrong indentation: expected 19 but found 21
(indentation)
[warning] 282-282: wrong indentation: expected 25 but found 22
(indentation)
[warning] 283-283: wrong indentation: expected 28 but found 30
(indentation)
[warning] 287-287: wrong indentation: expected 28 but found 25
(indentation)
[error] 290-290: trailing spaces
(trailing-spaces)
[warning] 292-292: wrong indentation: expected 8 but found 6
(indentation)
[warning] 294-294: wrong indentation: expected 10 but found 13
(indentation)
[warning] 295-295: wrong indentation: expected 17 but found 15
(indentation)
[warning] 298-298: wrong indentation: expected 19 but found 18
(indentation)
[warning] 301-301: wrong indentation: expected 10 but found 7
(indentation)
[warning] 302-302: wrong indentation: expected 13 but found 12
(indentation)
[warning] 305-305: wrong indentation: expected 13 but found 10
(indentation)
[warning] 306-306: wrong indentation: expected 14 but found 12
(indentation)
[warning] 309-309: wrong indentation: expected 13 but found 10
(indentation)
[warning] 310-310: wrong indentation: expected 14 but found 12
(indentation)
[warning] 313-313: wrong indentation: expected 13 but found 20
(indentation)
[warning] 314-314: wrong indentation: expected 24 but found 26
(indentation)
[warning] 317-317: wrong indentation: expected 13 but found 15
(indentation)
[warning] 321-321: wrong indentation: expected 13 but found 15
(indentation)
[warning] 324-324: wrong indentation: expected 19 but found 21
(indentation)
[warning] 327-327: wrong indentation: expected 25 but found 22
(indentation)
[warning] 328-328: wrong indentation: expected 28 but found 30
(indentation)
[warning] 332-332: wrong indentation: expected 28 but found 25
(indentation)
[error] 335-335: trailing spaces
(trailing-spaces)
[warning] 341-341: too many spaces after colon
(colons)
[error] 343-343: trailing spaces
(trailing-spaces)
[warning] 346-346: wrong indentation: expected 14 but found 12
(indentation)
[warning] 351-351: wrong indentation: expected 4 but found 6
(indentation)
[warning] 352-352: wrong indentation: expected 10 but found 8
(indentation)
[warning] 354-354: wrong indentation: expected 12 but found 14
(indentation)
[warning] 357-357: too many blank lines
(1 > 0) (empty-lines)
rules/swift/security/blowfish-hardcoded-secret-swift.yml
[warning] 19-19: wrong indentation: expected 12 but found 13
(indentation)
[warning] 20-20: wrong indentation: expected 17 but found 15
(indentation)
[warning] 23-23: wrong indentation: expected 19 but found 18
(indentation)
[warning] 49-49: wrong indentation: expected 22 but found 20
(indentation)
[warning] 50-50: wrong indentation: expected 24 but found 22
(indentation)
[warning] 53-53: wrong indentation: expected 22 but found 20
(indentation)
[warning] 54-54: wrong indentation: expected 24 but found 22
(indentation)
[warning] 58-58: wrong indentation: expected 8 but found 5
(indentation)
[warning] 60-60: wrong indentation: expected 9 but found 13
(indentation)
[warning] 61-61: wrong indentation: expected 17 but found 15
(indentation)
[warning] 64-64: wrong indentation: expected 19 but found 18
(indentation)
[warning] 67-67: wrong indentation: expected 9 but found 16
(indentation)
[warning] 95-95: wrong indentation: expected 22 but found 20
(indentation)
[warning] 96-96: wrong indentation: expected 24 but found 22
(indentation)
[warning] 99-99: wrong indentation: expected 22 but found 20
(indentation)
[warning] 100-100: wrong indentation: expected 24 but found 22
(indentation)
[warning] 103-103: wrong indentation: expected 22 but found 20
(indentation)
[warning] 107-107: wrong indentation: expected 8 but found 6
(indentation)
[warning] 109-109: wrong indentation: expected 10 but found 13
(indentation)
[warning] 110-110: wrong indentation: expected 17 but found 15
(indentation)
[warning] 113-113: wrong indentation: expected 19 but found 18
(indentation)
[warning] 116-116: wrong indentation: expected 10 but found 16
(indentation)
[warning] 139-139: wrong indentation: expected 22 but found 18
(indentation)
[warning] 140-140: wrong indentation: expected 24 but found 22
(indentation)
[warning] 154-154: wrong indentation: expected 24 but found 22
(indentation)
[warning] 156-156: wrong indentation: expected 26 but found 23
(indentation)
[warning] 159-159: wrong indentation: expected 27 but found 26
(indentation)
[warning] 169-169: wrong indentation: expected 22 but found 20
(indentation)
[warning] 170-170: wrong indentation: expected 24 but found 22
(indentation)
[warning] 173-173: wrong indentation: expected 22 but found 20
(indentation)
[warning] 174-174: wrong indentation: expected 24 but found 22
(indentation)
[warning] 177-177: wrong indentation: expected 22 but found 20
(indentation)
[warning] 181-181: wrong indentation: expected 8 but found 5
(indentation)
[warning] 183-183: wrong indentation: expected 9 but found 13
(indentation)
[warning] 184-184: wrong indentation: expected 17 but found 15
(indentation)
[warning] 187-187: wrong indentation: expected 19 but found 18
(indentation)
[warning] 190-190: wrong indentation: expected 9 but found 6
(indentation)
[warning] 191-191: wrong indentation: expected 12 but found 9
(indentation)
[warning] 194-194: wrong indentation: expected 13 but found 16
(indentation)
[warning] 213-213: wrong indentation: expected 22 but found 20
(indentation)
[warning] 214-214: wrong indentation: expected 24 but found 22
(indentation)
[warning] 217-217: wrong indentation: expected 22 but found 20
(indentation)
[warning] 218-218: wrong indentation: expected 24 but found 22
(indentation)
[warning] 221-221: wrong indentation: expected 12 but found 18
(indentation)
[warning] 222-222: wrong indentation: expected 24 but found 22
(indentation)
[warning] 235-235: wrong indentation: expected 24 but found 22
(indentation)
[warning] 237-237: wrong indentation: expected 26 but found 23
(indentation)
[warning] 240-240: wrong indentation: expected 27 but found 26
(indentation)
[error] 249-249: trailing spaces
(trailing-spaces)
[warning] 251-251: wrong indentation: expected 8 but found 6
(indentation)
[warning] 253-253: wrong indentation: expected 10 but found 13
(indentation)
[warning] 254-254: wrong indentation: expected 17 but found 15
(indentation)
[warning] 257-257: wrong indentation: expected 19 but found 18
(indentation)
[warning] 263-263: wrong indentation: expected 14 but found 12
(indentation)
[warning] 264-264: wrong indentation: expected 18 but found 16
(indentation)
[warning] 265-265: wrong indentation: expected 20 but found 18
(indentation)
[warning] 268-268: wrong indentation: expected 18 but found 16
(indentation)
[warning] 269-269: wrong indentation: expected 20 but found 18
(indentation)
[warning] 272-272: wrong indentation: expected 18 but found 20
(indentation)
[warning] 276-276: wrong indentation: expected 18 but found 15
(indentation)
[warning] 279-279: wrong indentation: expected 19 but found 21
(indentation)
[warning] 282-282: wrong indentation: expected 25 but found 22
(indentation)
[warning] 283-283: wrong indentation: expected 28 but found 30
(indentation)
[warning] 287-287: wrong indentation: expected 28 but found 25
(indentation)
[error] 290-290: trailing spaces
(trailing-spaces)
[warning] 292-292: wrong indentation: expected 8 but found 6
(indentation)
[warning] 294-294: wrong indentation: expected 10 but found 13
(indentation)
[warning] 295-295: wrong indentation: expected 17 but found 15
(indentation)
[warning] 298-298: wrong indentation: expected 19 but found 18
(indentation)
[warning] 301-301: wrong indentation: expected 10 but found 7
(indentation)
[warning] 302-302: wrong indentation: expected 13 but found 12
(indentation)
[warning] 305-305: wrong indentation: expected 13 but found 10
(indentation)
[warning] 306-306: wrong indentation: expected 14 but found 12
(indentation)
[warning] 309-309: wrong indentation: expected 13 but found 10
(indentation)
[warning] 310-310: wrong indentation: expected 14 but found 12
(indentation)
[warning] 313-313: wrong indentation: expected 13 but found 20
(indentation)
[warning] 314-314: wrong indentation: expected 24 but found 26
(indentation)
[warning] 317-317: wrong indentation: expected 13 but found 15
(indentation)
[warning] 321-321: wrong indentation: expected 13 but found 15
(indentation)
[warning] 324-324: wrong indentation: expected 19 but found 21
(indentation)
[warning] 327-327: wrong indentation: expected 25 but found 22
(indentation)
[warning] 328-328: wrong indentation: expected 28 but found 30
(indentation)
[warning] 332-332: wrong indentation: expected 28 but found 25
(indentation)
[error] 335-335: trailing spaces
(trailing-spaces)
[warning] 341-341: too many spaces after colon
(colons)
[error] 343-343: trailing spaces
(trailing-spaces)
[warning] 346-346: wrong indentation: expected 14 but found 12
(indentation)
[warning] 351-351: wrong indentation: expected 4 but found 6
(indentation)
[warning] 352-352: wrong indentation: expected 10 but found 8
(indentation)
[warning] 354-354: wrong indentation: expected 12 but found 14
(indentation)
[warning] 357-357: too many blank lines
(1 > 0) (empty-lines)
🔇 Additional comments (11)
tests/swift/chacha20-hardcoded-secret-swift-test.yml (1)
1-15
: Comprehensive ChaCha20 Test Configuration DefinedThe new YAML file clearly distinguishes valid and invalid test cases for the ChaCha20 usage. The examples demonstrate both proper usage (with a password-derived key) and multiple invalid cases (hardcoded strings and improper formatting). Overall, the structure is clear and aligns with the security rule guidelines.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
tests/swift/aes-hardcoded-secret-swift-test.yml (1)
1-15
: Well-Structured AES Test ConfigurationThis file defines valid and invalid scenarios for the AES encryption functionality. The test cases are consistent with the ChaCha20 file and clearly show correct usage versus insecure hardcoded keys. The file appears well formatted and effective for its intended purpose.
tests/swift/rabbit-hardcoded-secret-swift-test.yml (1)
1-15
: Clear and Detailed Rabbit Test CasesThe Rabbit test configuration successfully covers both valid and invalid initializations. The structure mirrors the other test files, ensuring consistency across encryption tests.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
tests/swift/blowfish-hardcoded-secret-swift-test.yml (1)
1-15
: Thorough Blowfish Test ConfigurationThis new file establishes test cases for the Blowfish encryption scenario, effectively differentiating between secure (password-derived key) and insecure (hardcoded string) implementations. Its structure is clear and mirrors the other test files.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 15-15: no new line character at the end of file
(new-line-at-end-of-file)
tests/__snapshots__/rabbit-hardcoded-secret-swift-snapshot.yml (1)
1-185
: Detailed Snapshot File for Rabbit Security RuleThe snapshot file provides extensive details for multiple scenarios of the Rabbit function, including both hardcoded and dynamic key cases. The labels with source, style, and position information are very thorough. Please verify that the specified start and end positions accurately reflect the intended segments in the source code. Additionally, ensure consistency in formatting (including a newline at the end if needed) to adhere to YAML standards.
rules/swift/security/rabbit-hardcoded-secret-swift.yml (3)
1-9
: General Rule Metadata is ClearThe rule’s metadata (id, severity, language, and message) is clearly defined and explains the security concern effectively.
10-13
: Note Block Provides Useful ContextThe note block appropriately references the CWE and gives a good reference URL. This aids in understanding the underlying risk.
336-358
: Rule and Constraints Block ReviewThe
rule:
andconstraints:
sections (lines 336–358) are well organized and clearly state the matching logic and secret constraints. Once the indentation issues are resolved, this section should work as expected.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 341-341: too many spaces after colon
(colons)
[error] 343-343: trailing spaces
(trailing-spaces)
[warning] 346-346: wrong indentation: expected 14 but found 12
(indentation)
[warning] 351-351: wrong indentation: expected 4 but found 6
(indentation)
[warning] 352-352: wrong indentation: expected 10 but found 8
(indentation)
[warning] 354-354: wrong indentation: expected 12 but found 14
(indentation)
[warning] 357-357: too many blank lines
(1 > 0) (empty-lines)
rules/swift/security/aes-hardcoded-secret-swift.yml (3)
1-9
: AES Rule Metadata Looks GoodThe new rule for detecting hard-coded AES secrets is clearly defined with appropriate severity and a detailed message advising secure practices.
10-13
: Note Block Effectively Conveys Security GuidanceThe note block correctly documents the associated CWE and provides a reference link for further reading.
336-358
: Rule and Constraints Section is Well-StructuredThe
rule:
andconstraints:
sections (lines 336–358) clearly define the matching criteria and constraints for a hard-coded AES secret. Once the indentation and trailing space issues are resolved, this configuration is solid.🧰 Tools
🪛 YAMLlint (1.35.1)
[warning] 341-341: too many spaces after colon
(colons)
[error] 343-343: trailing spaces
(trailing-spaces)
[warning] 346-346: wrong indentation: expected 14 but found 12
(indentation)
[warning] 351-351: wrong indentation: expected 4 but found 6
(indentation)
[warning] 352-352: wrong indentation: expected 10 but found 8
(indentation)
[warning] 354-354: wrong indentation: expected 12 but found 14
(indentation)
[warning] 357-357: too many blank lines
(1 > 0) (empty-lines)
Summary by CodeRabbit