Skip to content

NR-575201: Add Trivy security scan and Dependabot config - #248

Merged
satya-nr merged 3 commits into
mainfrom
NR-575201-trivy-dependabot
Jul 28, 2026
Merged

NR-575201: Add Trivy security scan and Dependabot config#248
satya-nr merged 3 commits into
mainfrom
NR-575201-trivy-dependabot

Conversation

@satya-nr

@satya-nr satya-nr commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds standard security scanning to this repo. Ticket: NR-575201.

  • Trivy filesystem scan — gates PRs on HIGH/CRITICAL CVEs, runs daily at 11:30 AM IST on main, uploads SARIF to Security → Code scanning.
  • Dependabot — weekly Monday updates for github-actions + npm (covers both test-suite and controller-scripts package.json).
  • Slack alerts — scheduled Trivy failures and new Dependabot PRs post to #logging-integrations-notifications via SLACK_TRIVY_WEBHOOK_URL.
  • No trivy-image job — this repo has no Dockerfile, so nothing to build/scan.

Files

File Change
.github/dependabot.yml New
.github/workflows/security_scan_pr_schedule.yaml New
integration-tests/controller-scripts/package-lock.json Fix 9 HIGH/CRITICAL CVEs (fast-xml-parser, handlebars, lodash — all transitive) via npm update

Prerequisite

  • SLACK_TRIVY_WEBHOOK_URL repo secret added.

Test plan

  • Ran Trivy fs scan locally — surfaced 9 HIGH/CRITICAL CVEs in controller-scripts/package-lock.json, fixed via npm update, rescanned locally → 0 findings.
  • Trivy scan on PR CI is green after the fix.
  • Slack webhook validated with curl — messages land correctly in #logging-integrations-notifications (both Trivy alert and Dependabot notify formats).
  • After merge: enable Dependabot version updates in Settings → Code security.
  • After merge: verify daily scheduled Trivy run appears in Actions.
  • After merge: verify Dependabot opens weekly PRs and each posts to Slack.

Tested locally: ran strategyMatrix.py with pinned vs unpinned deps of requirements.txt in isolated venvs — outputs are byte-identical, so pinning has zero behavior impact on the build matrix.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@satya-nr
satya-nr marked this pull request as ready for review July 17, 2026 09:25
@@ -28,767 +28,374 @@
"junit-report-merger": "^6.0.2"
}
},
"node_modules/@aws-crypto/crc32": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only package-lock.json is updated without package.json?

@satya-nr satya-nr Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the versions in package.json has caret symbol (^) whicjh permits minor and patch updates, so by there is no need to update package.json simply we are doing npm update which updates next minor versions in package-lock.json.

- Enable Trivy misconfig scanner (Terraform IaC coverage)
- Exclude node_modules from scan (third-party Dockerfiles are noise)
- Pin versions/requirements.txt (PyYAML, requests) so Trivy/Dependabot can track them
- Add pip and terraform ecosystems to Dependabot (existing dirs)
@satya-nr
satya-nr merged commit 794a59d into main Jul 28, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants