Skip to content

feat(actions): add trivy-tofu-scan reusable workflow#64

Merged
davidf-null merged 10 commits into
mainfrom
feat/tofutrivy
May 21, 2026
Merged

feat(actions): add trivy-tofu-scan reusable workflow#64
davidf-null merged 10 commits into
mainfrom
feat/tofutrivy

Conversation

@davidf-null

Copy link
Copy Markdown
Collaborator

Summary

  • Adds .github/workflows/trivy-tofu-scan.yml as a reusable workflow (workflow_call) that replaces tfsec.yml
  • Uses aquasecurity/trivy-action@v0.36.0 with scan-type: config to scan OpenTofu/Terraform misconfigurations at CRITICAL,HIGH severity
  • Persists results via SARIF upload to GitHub Security tab (with native PR annotations) and a JSON artifact via actions/upload-artifact@v7

Test plan

  • Invoke from a repo with .tf files — workflow should scan and upload SARIF + artifact
  • Invoke from a repo without .tf files — workflow should skip all scan steps and exit green
  • Introduce a misconfiguration — workflow should fail and appear in the Security tab

🤖 Generated with Claude Code

David Fernandez and others added 9 commits May 20, 2026 13:37
Spec for replacing tfsec.yml with a Trivy-based reusable workflow
for OpenTofu IaC scanning with SARIF, artifact, summary and PR comment output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… scanning

Replaces tfsec with Trivy to scan OpenTofu/Terraform misconfigurations.
Persists results via SARIF upload to GitHub Security tab and JSON artifact.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…canning

Validates GitHub Actions YAML syntax with actionlint and scans for
hardcoded credentials with Trivy on every pull request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ionlint@v0.1.9

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Quote $GITHUB_OUTPUT in trivy-tofu-scan, tfsec, ecr-security-scan,
  docker-build-push-ecr (SC2086)
- Move github.head_ref to env var in pre-release.yml (security hardening)
- Fix useless cat in changelog-release.yml (SC2002)
- Quote GITHUB_REF expansion in changelog-release.yml (SC2086)
- Change single to double quotes for GitHub expressions in ecr-security-scan (SC2016)
- Add shellcheck disable=SC2016 for intentional JMESPath single-quote usage
- Add shellcheck disable=SC2086 for intentional word-splitting in readme-ai-v2
- Fix find | xargs to find -print0 | xargs -0 in shellcheck.yml (SC2038)
- Add actionlint:ignore:permissions for models permission in readme-ai-v2
  and update-readme-actions (GitHub Models not yet in actionlint schema)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace devops-actions/actionlint wrapper with direct CLI install to
pass -ignore for 'models' permission false positive (GitHub Models
permission not yet in actionlint v1.7.7 schema).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…push-ecr

metadata-file input was removed in docker/build-push-action@v7.
Extract digest from steps.build.outputs.metadata instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread .github/workflows/tfsec.yml
@davidf-null davidf-null merged commit b522300 into main May 21, 2026
2 checks passed
@davidf-null davidf-null deleted the feat/tofutrivy branch May 21, 2026 14:39
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.

2 participants