Skip to content

CI: Add CodeQL workflow for GitHub Actions security scanning#1408

Open
kevinjqliu wants to merge 1 commit intoapache:mainfrom
kevinjqliu:add-codeql-workflow
Open

CI: Add CodeQL workflow for GitHub Actions security scanning#1408
kevinjqliu wants to merge 1 commit intoapache:mainfrom
kevinjqliu:add-codeql-workflow

Conversation

@kevinjqliu
Copy link
Contributor

This adds a CodeQL workflow to scan GitHub Actions workflow files for security issues such as script injection, use of untrusted input, and other misconfigurations.

Reference: https://github.blog/security/application-security/how-to-secure-your-github-actions-workflows-with-codeql/

Triggers:

  • Push and PR to main
  • Weekly scheduled scan (Mondays at 4:16 UTC)

This is based on Apache Infra recommendation,

IMPORTANT! You should enable CodeQL "actions" scanning in your repositories as described in https://github.blog/security/application-security/how-to-secure-your-github-actions-workflows-with-codeql/ - this will scan and flag those issues described below and many more automatically for you


This PR was generated by https://gist.github.com/kevinjqliu/97d24733c7b75cd92b68bf8f5b247891

Copy link
Contributor

@kosiew kosiew left a comment

Choose a reason for hiding this comment

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

@kevinjqliu

Thanks for working on this.

Comment on lines +36 to +39
permissions:
contents: read
security-events: write
packages: read
Copy link
Contributor

Choose a reason for hiding this comment

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

packages: read looks unused here. Could this be removed so the scanner job runs with only contents: read and security-events: write?

Comment on lines +29 to +30
permissions:
contents: read
Copy link
Contributor

Choose a reason for hiding this comment

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

contents: read is declared both globally and on the job. Could this live in one place to keep the permission model easier to scan?

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