-
Notifications
You must be signed in to change notification settings - Fork 0
[SEC-6012] Enabling code scanning via Semgrep and triage via claude #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: "Code Analysis" | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
| pull_request: | ||
| branches: [ "master" ] | ||
| schedule: | ||
| - cron: '0 0 * * 1' # Runs every Monday at midnight, this is to ensure that there is at least 1 scan every 7 days. | ||
|
|
||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: codeql-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
Comment on lines
+13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This repo is very infrequently modified so it's not a big issue, but |
||
|
|
||
| jobs: | ||
| analyze_scala: | ||
| name: Analyze Scala | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write | ||
| packages: read | ||
| actions: read | ||
| contents: read | ||
| id-token: write | ||
| checks: read | ||
| pull-requests: write | ||
|
|
||
| container: | ||
| # A Docker image with Semgrep installed. Do not change this. | ||
| image: semgrep/semgrep | ||
|
|
||
| # Skip any PR created by dependabot to avoid permission issues: | ||
| if: (github.actor != 'dependabot[bot]') | ||
|
|
||
| steps: | ||
| - name: Checkout repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: 'false' | ||
|
|
||
| - name: Fetch forked ruleset | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: 'Iterable/semgrep-rules' | ||
| path: .scala-security | ||
| sparse-checkout: 'scala' | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Run Semgrep | ||
| run: semgrep scan --config .scala-security/scala --sarif --output semgrep.sarif | ||
|
|
||
| - name: Upload SARIF results to GitHub Code Scanning | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: semgrep.sarif | ||
| path: semgrep.sarif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of needing to duplicate this CI workflow in many repos, have you looked into reusable GitHub Actions workflows? You can define them once, in a specific repo, and then "call" them from workflows in other repos. Search for
kube-e2ein the Iterable GitHub organization for examples.Or, you could even define an Action that can be used in any of our repos, like our existing security-custom-action or launchpad-publish-image-action.
Either way, it would mean that you'd only need to make a tiny stub workflow in each repo that has minimal configuration.