@secretlint/secretlint-rule-aws
Advanced tools
Comparing version 8.4.0 to 8.5.0
import { SecretLintRuleCreator } from "@secretlint/types"; | ||
export interface Options { | ||
allows?: string[]; | ||
/** | ||
* Enable ID Scan Rule | ||
* Default: true | ||
* TODO: This will be false by default in secretlint v9 | ||
*/ | ||
enableIDScanRule?: boolean; | ||
} | ||
@@ -5,0 +11,0 @@ /** |
@@ -130,2 +130,4 @@ import { matchPatterns } from "@textlint/regexp-string-matcher"; | ||
allows: options.allows || [], | ||
// TODO: This will be false by default in secretlint v9 | ||
enableIDScanRule: options.enableIDScanRule ?? true, | ||
}; | ||
@@ -135,4 +137,6 @@ const t = context.createTranslator(messages); | ||
file(source) { | ||
reportAWSAccessKey({ t, source: source, context: context, options: normalizedOptions }); | ||
reportAWSSecretAccessKey({ t, source: source, context: context, options: normalizedOptions }); | ||
if (normalizedOptions.enableIDScanRule) { | ||
reportAWSAccessKey({ t, source: source, context: context, options: normalizedOptions }); | ||
reportAWSSecretAccessKey({ t, source: source, context: context, options: normalizedOptions }); | ||
} | ||
reportAWSAccountID({ t, source: source, context: context, options: normalizedOptions }); | ||
@@ -139,0 +143,0 @@ }, |
{ | ||
"name": "@secretlint/secretlint-rule-aws", | ||
"version": "8.4.0", | ||
"version": "8.5.0", | ||
"description": "A secretlint rule for AWS.", | ||
@@ -58,7 +58,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@secretlint/types": "^8.4.0", | ||
"@secretlint/types": "^8.5.0", | ||
"@textlint/regexp-string-matcher": "^2.0.2" | ||
}, | ||
"devDependencies": { | ||
"@secretlint/tester": "^8.4.0", | ||
"@secretlint/tester": "^8.5.0", | ||
"@types/node": "^20.16.10", | ||
@@ -77,3 +77,3 @@ "prettier": "^2.8.1", | ||
}, | ||
"gitHead": "8698cc263acc28a38e4bb2f3f4f27b5086669509" | ||
"gitHead": "89bb8beb62231dc7e958702d7c763b37d7123689" | ||
} |
@@ -48,2 +48,8 @@ # @secretlint/secretlint-rule-aws | ||
- Allows a list of [RegExp-like String](https://github.com/textlint/regexp-string-matcher#regexp-like-string) | ||
- `enableIDScanRule: boolean` | ||
- Default: `true` | ||
- Enable ID scan rules | ||
- `AWSAccountID` | ||
- `AWSAccessKeyID` | ||
- These rules may be false-positive. You can disable it by setting `false`. | ||
@@ -50,0 +56,0 @@ ## Examples |
@@ -7,2 +7,8 @@ import { SecretLintRuleContext, SecretLintRuleCreator, SecretLintSourceCode } from "@secretlint/types"; | ||
allows?: string[]; | ||
/** | ||
* Enable ID Scan Rule | ||
* Default: true | ||
* TODO: This will be false by default in secretlint v9 | ||
*/ | ||
enableIDScanRule?: boolean; | ||
} | ||
@@ -176,2 +182,4 @@ | ||
allows: options.allows || [], | ||
// TODO: This will be false by default in secretlint v9 | ||
enableIDScanRule: options.enableIDScanRule ?? true, | ||
}; | ||
@@ -181,4 +189,6 @@ const t = context.createTranslator(messages); | ||
file(source: SecretLintSourceCode) { | ||
reportAWSAccessKey({ t, source: source, context: context, options: normalizedOptions }); | ||
reportAWSSecretAccessKey({ t, source: source, context: context, options: normalizedOptions }); | ||
if (normalizedOptions.enableIDScanRule) { | ||
reportAWSAccessKey({ t, source: source, context: context, options: normalizedOptions }); | ||
reportAWSSecretAccessKey({ t, source: source, context: context, options: normalizedOptions }); | ||
} | ||
reportAWSAccountID({ t, source: source, context: context, options: normalizedOptions }); | ||
@@ -185,0 +195,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24257
370
104
Updated@secretlint/types@^8.5.0