Skip to content

security: add repository hygiene workflow#37

Open
donny-devops wants to merge 1 commit into
mainfrom
security/add-hygiene-workflow
Open

security: add repository hygiene workflow#37
donny-devops wants to merge 1 commit into
mainfrom
security/add-hygiene-workflow

Conversation

@donny-devops

Copy link
Copy Markdown
Owner

Adds a lightweight Security Hygiene workflow that audits outbound calls with Harden Runner and blocks obvious private keys or token patterns on push and pull requests.

This keeps existing CI intact and layers on a focused guardrail appropriate for an API repository.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Security Review Summary

This PR adds a valuable security hygiene workflow to audit outbound calls and detect secrets. However, I've identified 2 critical security vulnerabilities that must be fixed before merge:

Critical Issues:

  1. Supply chain risk: The checkout action uses an unpinned version tag, creating a vector for supply chain attacks
  2. Security bypass: Excluding the workflow file from scanning creates a blind spot where secrets could be hidden

Both issues have actionable fixes provided. Once addressed, this workflow will provide strong security guardrails for the repository.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

SECRET_PATTERN='BEGIN (RSA |OPENSSH |EC |DSA )?PRIVATE KEY|ghp_[A-Za-z0-9_]{20,}|github_pat_[A-Za-z0-9_]{20,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_-]{20,}|sk-[A-Za-z0-9]{20,}'
if grep -RInE "$SECRET_PATTERN" . \
--exclude-dir=.git \
--exclude=.github/workflows/security-hygiene.yml; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Security Vulnerability: Excluding the workflow file from secret scanning creates a blind spot where secrets could be hidden. An attacker with write access could commit secrets within this excluded file, bypassing the security check entirely.

Suggested change
--exclude=.github/workflows/security-hygiene.yml; then
--exclude-dir=.git; then

egress-policy: audit

- name: Checkout repository
uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Security Vulnerability: Using an unpinned action reference (@v4) in a security workflow creates a supply chain attack risk. An attacker who compromises the actions/checkout repository could inject malicious code that executes in your workflow.

Suggested change
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Micro-Learning Topic: Download of Code Without Integrity Check (CWE 494)

Matched on "CWE-494"

What is this? (2min video)

The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.

Try a challenge in Secure Code Warrior

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

1 participant