fullcourtdefense-cli 1.34.4 → 1.34.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actionPolicyEngine.js +9 -3
- package/dist/version.json +1 -1
- package/package.json +1 -1
|
@@ -686,7 +686,7 @@ const PLACEHOLDER_WORD_RE = /example|sample|placeholder|redacted|dummy|changeme|
|
|
|
686
686
|
* ~ 1 in 62^6 per position. Structural — no vocabulary.
|
|
687
687
|
*/
|
|
688
688
|
const REPEATED_CHUNK_RE = /(.{3,})\1{2,}/;
|
|
689
|
-
function isHighEntropySecretToken(token) {
|
|
689
|
+
function isHighEntropySecretToken(token, allowWordSlug = false) {
|
|
690
690
|
if (token.length < 24 || token.length > 512)
|
|
691
691
|
return false;
|
|
692
692
|
// `NAME=value` / `--flag=value` is an assignment expression, not a value: the
|
|
@@ -695,7 +695,7 @@ function isHighEntropySecretToken(token) {
|
|
|
695
695
|
// is a reference; `GITHUB_TOKEN=<40 random chars>` is still a secret).
|
|
696
696
|
const assignment = /^-{0,2}[A-Za-z_][\w.-]*=(.+)$/.exec(token);
|
|
697
697
|
if (assignment)
|
|
698
|
-
return isHighEntropySecretToken(assignment[1]);
|
|
698
|
+
return isHighEntropySecretToken(assignment[1], allowWordSlug);
|
|
699
699
|
// Any URI (postgres://, redis://, amqp://, https://…) is configuration; only
|
|
700
700
|
// the password inside its userinfo can be a secret — judged as a value.
|
|
701
701
|
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(token))
|
|
@@ -723,6 +723,12 @@ function isHighEntropySecretToken(token) {
|
|
|
723
723
|
return false; // url / path
|
|
724
724
|
if (/^[a-z]+(?:[A-Z][a-z0-9]+)+$/.test(token) || /^[a-z]+(?:_[a-z0-9]+)+$/.test(token))
|
|
725
725
|
return false; // camelCase / snake_case identifiers
|
|
726
|
+
// Lowercase word slugs with a numeric suffix are identifiers (for example
|
|
727
|
+
// a dated customer/run ID). Separators and the suffix alone do not turn
|
|
728
|
+
// those words into random credential material. Known credential formats
|
|
729
|
+
// and explicitly named secret assignments are checked before this fallback.
|
|
730
|
+
if (allowWordSlug && /^[a-z]+(?:-[a-z]+)+(?:-\d+)?$/.test(token))
|
|
731
|
+
return false;
|
|
726
732
|
let classes = 0;
|
|
727
733
|
if (/[a-z]/.test(token))
|
|
728
734
|
classes++;
|
|
@@ -847,7 +853,7 @@ function detectSecretKind(raw) {
|
|
|
847
853
|
re.lastIndex = 0;
|
|
848
854
|
let m;
|
|
849
855
|
while ((m = re.exec(value)) !== null) {
|
|
850
|
-
if (isHighEntropySecretToken(m[1].replace(/[\\"'`]+$/, '')))
|
|
856
|
+
if (isHighEntropySecretToken(m[1].replace(/[\\"'`]+$/, ''), re === GENERIC_VALUE_RE))
|
|
851
857
|
return 'high_entropy';
|
|
852
858
|
}
|
|
853
859
|
}
|
package/dist/version.json
CHANGED