aura-security 0.5.2 → 0.5.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.
Files changed (2) hide show
  1. package/dist/index.js +32 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -344,6 +344,30 @@ async function main() {
344
344
  });
345
345
  console.log(`[AURA] Remote scan complete in ${remoteResult.cloneDuration + remoteResult.scanDuration}ms`);
346
346
  console.log(`[AURA] Found: ${remoteResult.secrets.length} secrets, ${remoteResult.packages.length} vulns`);
347
+ // Save to database and calculate score
348
+ try {
349
+ const db = server.getDatabase();
350
+ const auditId = db.saveAudit('code', gitUrl, remoteResult);
351
+ console.log(`[AURA] Remote scan saved to database: ${auditId}`);
352
+ // Calculate and save security score
353
+ const scoreCounts = {
354
+ critical: (remoteResult.secrets?.filter((s) => s.severity === 'critical').length || 0) +
355
+ (remoteResult.packages?.filter((p) => p.severity === 'critical').length || 0),
356
+ high: (remoteResult.secrets?.filter((s) => s.severity === 'high').length || 0) +
357
+ (remoteResult.packages?.filter((p) => p.severity === 'high').length || 0),
358
+ medium: (remoteResult.secrets?.filter((s) => s.severity === 'medium').length || 0) +
359
+ (remoteResult.packages?.filter((p) => p.severity === 'medium').length || 0) +
360
+ (remoteResult.sastFindings?.length || 0),
361
+ low: (remoteResult.secrets?.filter((s) => s.severity === 'low').length || 0) +
362
+ (remoteResult.packages?.filter((p) => p.severity === 'low').length || 0) +
363
+ (remoteResult.envFiles?.length || 0)
364
+ };
365
+ const score = db.saveScore(gitUrl, auditId, scoreCounts);
366
+ console.log(`[AURA] Security score: ${score.score} (${score.grade})`);
367
+ }
368
+ catch (dbErr) {
369
+ console.error('[AURA] Failed to save remote scan to database:', dbErr);
370
+ }
347
371
  // Convert to audit input and run through pipeline
348
372
  const scanner = new LocalScanner({ targetPath: remoteResult.path });
349
373
  const auditInput = scanner.toAuditorInput(remoteResult);
@@ -500,11 +524,15 @@ async function main() {
500
524
  console.log(`[AURA] Scan result saved to database: ${auditId}`);
501
525
  // Calculate and save security score
502
526
  const scoreCounts = {
503
- critical: scanResult.secrets?.filter((s) => s.severity === 'critical').length || 0,
504
- high: scanResult.secrets?.filter((s) => s.severity === 'high').length || 0,
505
- medium: (scanResult.packages?.filter((p) => p.severity === 'medium').length || 0) +
527
+ critical: (scanResult.secrets?.filter((s) => s.severity === 'critical').length || 0) +
528
+ (scanResult.packages?.filter((p) => p.severity === 'critical').length || 0),
529
+ high: (scanResult.secrets?.filter((s) => s.severity === 'high').length || 0) +
530
+ (scanResult.packages?.filter((p) => p.severity === 'high').length || 0),
531
+ medium: (scanResult.secrets?.filter((s) => s.severity === 'medium').length || 0) +
532
+ (scanResult.packages?.filter((p) => p.severity === 'medium').length || 0) +
506
533
  (scanResult.sastFindings?.length || 0),
507
- low: (scanResult.packages?.filter((p) => p.severity === 'low').length || 0) +
534
+ low: (scanResult.secrets?.filter((s) => s.severity === 'low').length || 0) +
535
+ (scanResult.packages?.filter((p) => p.severity === 'low').length || 0) +
508
536
  (scanResult.envFiles?.length || 0)
509
537
  };
510
538
  const score = db.saveScore(scanResult.path, auditId, scoreCounts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aura-security",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Deterministic security auditing engine with optional AI advisory layer. Run as CLI, CI step, or service. AI does not make enforcement decisions.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",