- Notifications
You must be signed in to change notification settings - Fork 37
Add automated security scanning workflows #124
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
Open
ausbru87 wants to merge 15 commits into main Choose a base branch from 123-add-security-scanning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits Select commit Hold shift + click to select a range
9b0ab3a ci: add security scanning workflows (#123)
ausbru87 351ea5c ci: scan for all CVE severity levels and remove Docker image scan
ausbru87 980a039 ci: add explicit scanners to Trivy configuration
ausbru87 9f26520 ci: build and scan Docker image like coder/coder
ausbru87 9e22e3a ci: add table output and artifact upload for scan visibility
ausbru87 9c091a9 ci: add workflow_dispatch trigger to scorecard for manual testing
ausbru87 d3b966a revert: remove workflow_dispatch from scorecard
ausbru87 949cdba removed changes from changelog.md
ausbru87 6b8d181 updated Make for multiple targets and updated security.yaml to use ma…
ausbru87 c3339da added sha pinning
ausbru87 2a40050 Updated SHAs
ausbru87 4769896 added explicit build targets for each arch
ausbru87 ad4db42 added explicit make build command instead of alias to security workflow
ausbru87 0f66771 removed prefixes due to changelog.md being manually curated
ausbru87 4bac609 reduce potential of credential leak by removing credential persistence
ausbru87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ci: add security scanning workflows (#123)
- Loading branch information
commit 9b0ab3ac731f69d7dac63344b56622e139b253de
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: OpenSSF Scorecard | ||
| | ||
| on: | ||
| branch_protection_rule: | ||
| schedule: | ||
| # Run weekly on Wednesdays at 7:27 UTC | ||
| - cron: "27 7 * * 3" | ||
| push: | ||
| branches: | ||
| - main | ||
| | ||
| permissions: read-all | ||
| | ||
| jobs: | ||
| analysis: | ||
| name: Scorecard analysis | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write | ||
| id-token: write | ||
| | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
deansheather marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| with: | ||
| persist-credentials: false | ||
| | ||
| - name: Run analysis | ||
| uses: ossf/scorecard-action@v2.4.0 | ||
| with: | ||
| results_file: results.sarif | ||
| results_format: sarif | ||
| repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_results: true | ||
| | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: SARIF file | ||
| path: results.sarif | ||
| retention-days: 5 | ||
| | ||
| - name: Upload to code-scanning | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| name: security | ||
| | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| schedule: | ||
| # Run every day at 10:00 UTC (6:00 AM ET / 3:00 AM PT) | ||
| - cron: "0 10 * * *" | ||
| workflow_dispatch: | ||
| | ||
| permissions: | ||
| contents: read | ||
| | ||
| # Cancel in-progress runs for pull requests when developers push | ||
| # additional changes | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
| | ||
| jobs: | ||
| codeql: | ||
| name: CodeQL Analysis | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write | ||
| actions: read | ||
| contents: read | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: "go.mod" | ||
| | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: go | ||
| | ||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 | ||
| with: | ||
| category: "/language:go" | ||
| | ||
| trivy-repo: | ||
| name: Trivy Filesystem Scan | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write | ||
| contents: read | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| | ||
| - name: Run Trivy vulnerability scanner in repo mode | ||
| uses: aquasecurity/trivy-action@0.28.0 | ||
| with: | ||
| scan-type: "fs" | ||
| scan-ref: "." | ||
| format: "sarif" | ||
| output: "trivy-results.sarif" | ||
| severity: "CRITICAL,HIGH" | ||
| | ||
| - name: Upload Trivy scan results to GitHub Security tab | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: "trivy-results.sarif" | ||
| category: "Trivy-Filesystem" | ||
| | ||
| trivy-image: | ||
| name: Trivy Docker Image Scan | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write | ||
| contents: read | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| | ||
| - name: Run Trivy vulnerability scanner on latest image | ||
| uses: aquasecurity/trivy-action@0.28.0 | ||
| with: | ||
| image-ref: "ghcr.io/coder/code-marketplace:latest" | ||
| format: "sarif" | ||
| output: "trivy-image-results.sarif" | ||
| severity: "CRITICAL,HIGH" | ||
| | ||
| - name: Upload Trivy scan results to GitHub Security tab | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: "trivy-image-results.sarif" | ||
| category: "Trivy-Docker" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.