Skip to content

Conversation

ausbru87
Copy link

Closes #123

Adds automated security scanning to improve supply chain security for air-gapped deployments:

Changes

  • CodeQL: Daily Go code vulnerability scanning
  • Trivy: Filesystem and Docker image scanning for dependencies
  • OpenSSF Scorecard: Weekly security best practices assessment
  • Enhanced Dependabot: Commit prefixes and patch update filtering

All scan results are uploaded to GitHub Security tab for centralized monitoring.

Testing

  • Workflows will run on this PR to validate configuration
  • Docker image scan will run once images are published

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

- Scan LOW,MEDIUM,HIGH,CRITICAL instead of only HIGH,CRITICAL
- Remove Docker image scan (no :latest tag exists)
Enable vuln, secret, and misconfig scanners explicitly
- Build Go binary for linux/amd64
- Build Docker image with buildx
- Scan the built image (not filesystem)
- Matches coder/coder scanning approach
- Add table format scan to show results in workflow logs
- Upload SARIF as artifact for manual inspection
- Matches coder/coder artifact upload pattern
@ausbru87 ausbru87 requested a review from Copilot October 12, 2025 05:13
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive automated security scanning workflows to improve supply chain security for air-gapped deployments. The changes include CodeQL vulnerability scanning, Trivy image scanning, OpenSSF Scorecard security assessment, and enhanced Dependabot configuration.

  • Automated daily security scanning with CodeQL and Trivy
  • Weekly OpenSSF Scorecard security best practices assessment
  • Enhanced Dependabot with commit prefixes and patch update filtering

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
CHANGELOG.md Documents the addition of security scanning workflows and Dependabot enhancements
.github/workflows/security.yaml Main security workflow with CodeQL and Trivy scanning jobs
.github/workflows/scorecard.yml OpenSSF Scorecard workflow for security best practices assessment
.github/dependabot.yaml Enhanced configuration with commit prefixes and patch update filtering

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ausbru87 ausbru87 self-assigned this Oct 12, 2025
@ausbru87 ausbru87 marked this pull request as ready for review October 12, 2025 05:13
@ausbru87 ausbru87 removed the request for review from jdomeracki-coder October 14, 2025 03:27

TAG=$(shell git describe --always)

build/linux/amd64:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
build/linux/amd64:
bin/coder-marketplace-linux-amd64:

You can keep the PHONY (after editing the target name) for simplicity's sake though, otherwise you'll need to specify every Go-related file as a dependency


TAG=$(shell git describe --always)

build/linux/amd64:
Copy link
Member

Choose a reason for hiding this comment

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

I think every OS/arch should be turned into a target just like this, and the build job should depend on all of them and have no content


steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
Copy link
Member

Choose a reason for hiding this comment

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

actions/checkout is currently at v5.0.0

persist-credentials: false

- name: Run analysis
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
Copy link
Member

Choose a reason for hiding this comment

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

ossf/scorecard-action is currently at v2.4.3

echo "image=code-marketplace:scan" >> "$GITHUB_OUTPUT"
- name: Run Trivy vulnerability scanner (table output for logs)
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # 0.28.0
Copy link
Member

Choose a reason for hiding this comment

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

aquasecurity/trivy-action is currently at v0.33.1. Also missing the v in the comment

severity: "LOW,MEDIUM,HIGH,CRITICAL"

- name: Run Trivy vulnerability scanner (SARIF output for GitHub)
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # 0.28.0
Copy link
Member

Choose a reason for hiding this comment

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

Same here

contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
Copy link
Member

Choose a reason for hiding this comment

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

Same here

@deansheather
Copy link
Member

@code-asher could you give this a review and flag anything that's weird for you? I haven't contributed to this repo before so maybe I'm missing something in my reviews

Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

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

Awesome thank you!

# Ignore patch updates for all dependencies to reduce PR noise
- dependency-name: "*"
update-types:
- version-update:semver-patch
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this? So far the number of updates seem to have been pretty mild. Or we could group updates weekly or something.

Comment on lines +10 to +11
commit-message:
prefix: "ci"
Copy link
Member

Choose a reason for hiding this comment

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

Not a huge deal, but I think the prefixes may have no use, the changelog is manually curated.

Comment on lines +24 to +25
commit-message:
prefix: "chore"
Copy link
Member

Choose a reason for hiding this comment

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

ditto

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.

Add automated security scanning (CodeQL, Trivy, OpenSSF Scorecard)

3 participants