aura-security 1.0.2 → 1.0.3
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.
|
@@ -545,8 +545,21 @@ function calculateScore(checks) {
|
|
|
545
545
|
const isAbandoned = checks.some(c => c.id === 'activity' && c.status === 'bad');
|
|
546
546
|
// Apply caps based on critical issues
|
|
547
547
|
if (hasSecrets) {
|
|
548
|
-
|
|
549
|
-
|
|
548
|
+
const secretsCheck = checks.find(c => c.id === 'secrets');
|
|
549
|
+
const secretCount = secretsCheck ? Math.abs(secretsCheck.points) / 10 : 1;
|
|
550
|
+
if (secretCount >= 5) {
|
|
551
|
+
// Many secrets = definitely compromised, hard cap RISKY
|
|
552
|
+
score = Math.min(score, 40);
|
|
553
|
+
}
|
|
554
|
+
else if (secretCount >= 3) {
|
|
555
|
+
// Several secrets = serious concern
|
|
556
|
+
score = Math.min(score, 50);
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
// 1-2 secrets = concerning but could be marginal detection
|
|
560
|
+
// Cap at DYOR, let other signals weigh in
|
|
561
|
+
score = Math.min(score, 65);
|
|
562
|
+
}
|
|
550
563
|
}
|
|
551
564
|
if (hasNoCode) {
|
|
552
565
|
// No code = max score 40 (RISKY)
|
|
@@ -632,16 +645,24 @@ function generateSummary(checks, score, verdict) {
|
|
|
632
645
|
*/
|
|
633
646
|
function scanForSecrets(content) {
|
|
634
647
|
const secretPatterns = [
|
|
635
|
-
/AKIA[0-9A-Z]{16}/, // AWS Access Key
|
|
636
|
-
/[
|
|
637
|
-
/
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
/
|
|
648
|
+
/AKIA[0-9A-Z]{16}/, // AWS Access Key (always starts with AKIA)
|
|
649
|
+
/gh[pousr]_[A-Za-z0-9_]{36,}/, // GitHub tokens (prefixed)
|
|
650
|
+
/sk_live_[A-Za-z0-9]{24,}/, // Stripe live keys
|
|
651
|
+
/-----BEGIN\s*(?:RSA|EC|DSA|OPENSSH)?\s*PRIVATE KEY-----/, // Private keys (PEM format)
|
|
652
|
+
/password\s*[:=]\s*["'][^"']{8,}["']/i, // Hardcoded passwords with real values
|
|
653
|
+
/xox[bprs]-[0-9]{10,}-[A-Za-z0-9-]+/, // Slack tokens
|
|
654
|
+
/(?:api[_-]?key|secret[_-]?key|auth[_-]?token)\s*[:=]\s*["'][A-Za-z0-9+\/=]{20,}["']/i, // Secret assignments
|
|
641
655
|
];
|
|
656
|
+
// Skip data files (token lists, address registries)
|
|
657
|
+
if (/["'](tokens|addresses|mints|constituents|verified)["']\s*:/i.test(content)) {
|
|
658
|
+
return 0;
|
|
659
|
+
}
|
|
660
|
+
// Placeholder values are not real secrets
|
|
661
|
+
const placeholderPattern = /your[_-]?api[_-]?key|REPLACE[_-]?ME|TODO|CHANGEME|xxxx|placeholder|example/i;
|
|
642
662
|
let count = 0;
|
|
643
663
|
for (const pattern of secretPatterns) {
|
|
644
|
-
|
|
664
|
+
const match = content.match(pattern);
|
|
665
|
+
if (match && !placeholderPattern.test(match[0])) {
|
|
645
666
|
count++;
|
|
646
667
|
}
|
|
647
668
|
}
|
|
@@ -884,11 +905,28 @@ export async function performTrustScan(gitUrl) {
|
|
|
884
905
|
}
|
|
885
906
|
}
|
|
886
907
|
codeRedFlags = scanCodeForRedFlags(scannedFiles);
|
|
887
|
-
// Quick secret scan on
|
|
888
|
-
const sensitiveFiles = files.filter((f) =>
|
|
889
|
-
f.path.
|
|
890
|
-
|
|
891
|
-
|
|
908
|
+
// Quick secret scan on files that could plausibly contain secrets
|
|
909
|
+
const sensitiveFiles = files.filter((f) => {
|
|
910
|
+
const p = f.path.toLowerCase();
|
|
911
|
+
// Only scan files that could contain secrets
|
|
912
|
+
const isSensitive = p.includes('.env') ||
|
|
913
|
+
p.includes('config') ||
|
|
914
|
+
p.endsWith('.yml') ||
|
|
915
|
+
p.endsWith('.yaml');
|
|
916
|
+
// Exclude known safe files that produce false positives
|
|
917
|
+
const isSafe = p === 'package.json' ||
|
|
918
|
+
p === 'package-lock.json' ||
|
|
919
|
+
p.includes('tsconfig') ||
|
|
920
|
+
p.includes('eslint') ||
|
|
921
|
+
p.includes('prettier') ||
|
|
922
|
+
p.endsWith('.lock') ||
|
|
923
|
+
p.includes('token-list') ||
|
|
924
|
+
p.includes('tokenlist') ||
|
|
925
|
+
p.includes('/test') ||
|
|
926
|
+
p.includes('/example') ||
|
|
927
|
+
p.includes('/fixture');
|
|
928
|
+
return isSensitive && !isSafe;
|
|
929
|
+
}).slice(0, 5);
|
|
892
930
|
for (const file of sensitiveFiles) {
|
|
893
931
|
try {
|
|
894
932
|
const fileRes = await fetch(`https://api.github.com/repos/${owner}/${repo}/contents/${file.path}`, { headers });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aura-security",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "AI-powered security scanner with 9-agent swarm. Detect secrets, vulnerabilities, attack paths. CLI, API, or cloud dashboard at app.aurasecurity.io",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|