-
Notifications
You must be signed in to change notification settings - Fork 0
updates to dev container, security workflow and deny.toml #20
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
base: main
Are you sure you want to change the base?
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,159 @@ | ||||||
| name: Security | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| push: | ||||||
| branches: ["main"] | ||||||
| schedule: | ||||||
| - cron: "0 9 * * 1" # weekly Monday 09:00 UTC | ||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
|
|
||||||
| jobs: | ||||||
| rust-checks: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Checkout | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Install Rust (stable) | ||||||
| uses: dtolnay/rust-toolchain@stable | ||||||
| with: | ||||||
| components: rustfmt, clippy | ||||||
|
|
||||||
| - name: Rust cache | ||||||
| uses: Swatinem/rust-cache@v2 | ||||||
|
|
||||||
| - name: fmt (fail if changed) | ||||||
| run: cargo fmt --all -- --check | ||||||
|
|
||||||
| - name: clippy | ||||||
| run: cargo clippy --all-targets --all-features -- -D warnings | ||||||
|
|
||||||
| - name: test | ||||||
| run: cargo test --all --all-features | ||||||
|
|
||||||
| dependency-audit: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Checkout | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Install Rust (stable) | ||||||
| uses: dtolnay/rust-toolchain@stable | ||||||
|
|
||||||
| - name: Rust cache | ||||||
| uses: Swatinem/rust-cache@v2 | ||||||
|
|
||||||
| - name: Install cargo-audit | ||||||
| uses: taiki-e/install-action@v2 | ||||||
| with: | ||||||
| tool: cargo-audit | ||||||
|
|
||||||
| - name: RustSec audit | ||||||
| run: cargo audit | ||||||
|
|
||||||
| dependency-policy: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Checkout | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Install Rust (stable) | ||||||
| uses: dtolnay/rust-toolchain@stable | ||||||
|
|
||||||
| - name: Rust cache | ||||||
| uses: Swatinem/rust-cache@v2 | ||||||
|
|
||||||
| - name: Install cargo-deny | ||||||
| uses: taiki-e/install-action@v2 | ||||||
| with: | ||||||
| tool: cargo-deny | ||||||
|
|
||||||
| - name: cargo-deny (licenses, bans, sources, advisories) | ||||||
| run: cargo deny check | ||||||
|
|
||||||
| sbom: | ||||||
| runs-on: ubuntu-latest | ||||||
| permissions: | ||||||
| contents: read | ||||||
|
Comment on lines
+79
to
+80
|
||||||
| permissions: | |
| contents: read |
Copilot
AI
Jan 7, 2026
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.
The permissions setting here is redundant since the workflow already defines contents: read at the top level (line 11). Job-level permissions override top-level permissions, so this doesn't add security value and can be removed for simplicity. Only jobs that need different permissions (like trivy-fs which needs security-events: write) should explicitly set them.
Copilot
AI
Jan 7, 2026
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.
The condition syntax here may not work as expected. The GitHub Actions expression contains(needs.*.result, 'failure') returns a boolean (true/false), but you're comparing it as a string "true" in bash. The double evaluation (GitHub Actions expression to string, then bash string comparison) is redundant. Consider using a simpler approach with the GitHub Actions if conditional directly on the needs context, or use a more standard pattern like checking the JSON array of results.
| if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then | |
| if ${{ contains(needs.*.result, 'failure') }}; then |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # cargo-deny configuration | ||
| # See: https://embarkstudios.github.io/cargo-deny/ | ||
|
|
||
| [advisories] | ||
| version = 2 | ||
| # Don't warn on unmaintained packages yet | ||
| ignore = [ | ||
| "RUSTSEC-2025-0134", # rustls-pemfile is unmaintained, comes from aws-sdk dependencies | ||
| ] | ||
|
|
||
| [licenses] | ||
| # Accept common permissive licenses | ||
| allow = [ | ||
| "MIT", | ||
| "Apache-2.0", | ||
| "BSD-3-Clause", | ||
| "BSD-2-Clause", | ||
| "ISC", | ||
| "Unicode-DFS-2016", | ||
| ] | ||
| confidence-threshold = 0.8 | ||
| exceptions = [] | ||
|
|
||
| [licenses.private] | ||
| # Ignore private crates | ||
| ignore = false | ||
|
|
||
| [bans] | ||
| # Check for duplicate dependencies | ||
| multiple-versions = "warn" | ||
| # Wildcards not allowed in dependencies | ||
| wildcards = "deny" | ||
| # Highlight deprecated crates | ||
| highlight = "all" | ||
| workspace-default-features = "allow" | ||
| external-default-features = "allow" | ||
|
|
||
| # List specific crates to deny (e.g., known security issues) | ||
| deny = [] | ||
|
|
||
| # Skip certain crates from duplicate checking | ||
| skip = [] | ||
| skip-tree = [] | ||
|
|
||
| [sources] | ||
| # Ensure all dependencies come from trusted sources | ||
| unknown-registry = "deny" | ||
| unknown-git = "deny" | ||
|
|
||
| [sources.allow-org] | ||
| # Allow crates from GitHub orgs | ||
| github = [] |
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.
The rust-checks job duplicates functionality already present in the existing test.yml workflow. Both workflows run cargo fmt, clippy, and test on pull requests and pushes to main. This duplication increases CI runtime and maintenance burden. Consider removing this job from the security workflow and relying on the test workflow for these checks, or consolidate the workflows if security-specific context is needed for these checks.