Skip to content

feat(ci): add auto-fix workflow for transitive dependency vulnerabilities#6

Merged
justanothersynth merged 3 commits intomainfrom
naurasj/amr-1897-create-auto-fix-transitive-dependency-workflow-in-github
Apr 6, 2026
Merged

feat(ci): add auto-fix workflow for transitive dependency vulnerabilities#6
justanothersynth merged 3 commits intomainfrom
naurasj/amr-1897-create-auto-fix-transitive-dependency-workflow-in-github

Conversation

@justanothersynth
Copy link
Copy Markdown
Member

Description

Adds a new centralized GitHub Actions workflow (auto_fix_transitive_dep.yml) that automates fixing transitive dependency vulnerabilities across all org repos.

  • Triggered by: the amera-dependabot Lambda via workflow_dispatch when an alert is classified as fixable_manual
  • Python (pip): checks out target repo, authenticates CodeArtifact inline, runs poetry update, verifies with pip-audit, opens a PR
  • npm: checks out target repo, runs npm update, verifies with npm audit, opens a PR
  • PR metadata: includes severity, GHSA advisory link, Linear ticket reference, security/automated-fix labels
  • Staging retarget: if the target repo has a staging branch, the PR base is retargeted automatically
  • Concurrency: keyed on {target_repo}-{ghsa_ids} to prevent duplicate runs from webhook retries
  • README: updated overview diagram, prerequisites (Actions permission for AMERABOT), and new section documenting the workflow

Resolves AMR-1897

Risk Level

  • Low — minor change, no impact on production data or security

Rollback Plan

Revert this PR. The workflow is only triggered by explicit workflow_dispatch calls from the Lambda, so removing it simply disables the automation — alerts continue to be tracked as before.

PHI Impact

  • This change affects systems that create, receive, maintain, or transmit PHI — HIPAA impact reviewed

Testing

  • Tested in non-production environment

…ties

When the amera-dependabot Lambda classifies a Dependabot alert as
fixable_manual, it dispatches this workflow to check out the target
repo, update the vulnerable transitive dependency via poetry/npm,
verify the fix, and open a PR with security metadata.

Supports pip (Poetry + CodeArtifact auth + pip-audit) and npm
(npm update + npm audit) ecosystems. PRs are retargeted to staging
when available and include GHSA advisory links, severity, and
optional Linear ticket references.

Resolves AMR-1897
@justanothersynth justanothersynth self-assigned this Apr 6, 2026
Pass `inputs.packages` and `inputs.target_repo` via env variables
instead of interpolating directly into shell commands, preventing
GitHub Actions expression injection. Also surface `alert_url` input
in the PR body so it's not declared but unused.

AMR-1897
Set `permissions: { contents: read }` on all three workflows to
restrict the default GITHUB_TOKEN scope. All write operations already
use the AMERABOT app token, so this is pure least-privilege hardening.

Resolves CodeQL "workflow does not contain permissions" findings.

AMR-1897
@justanothersynth justanothersynth merged commit 55d5753 into main Apr 6, 2026
2 checks passed
@justanothersynth justanothersynth deleted the naurasj/amr-1897-create-auto-fix-transitive-dependency-workflow-in-github branch April 6, 2026 20:02
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.

3 participants