Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .agents/skills/watch-github-actions/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ gh run list --json databaseId,status,headBranch,url --jq '.[] | {id: .databaseId

## View Job Logs

For `Trivy Changes`, inspect the `Resolve PR baseline` step for the base and head
SHAs. PR runs compare the tested merge commit with its
first parent; change detection and scans must use the same pair. On reruns, do
not substitute the current `main` tip or the event's older PR base SHA. Merge
groups and manual runs use their explicit baseline. Findings are reported by
`Reject new high or critical findings`; distinguish those from scanner failures.

View logs for a specific run:

```bash
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/branch-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ jobs:
run: |
cargo clippy --workspace --all-targets -- -D warnings
cargo clippy --manifest-path e2e/rust/Cargo.toml --all-targets -- -D warnings
cargo check --manifest-path examples/governance-interceptor/Cargo.toml --all-targets
cargo check --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all-targets
cargo clippy --manifest-path examples/governance-interceptor/Cargo.toml --all-targets -- -D warnings
cargo clippy --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all-targets -- -D warnings

- name: Test
env:
Expand Down Expand Up @@ -207,6 +207,11 @@ jobs:
exit 1
fi

- name: Verify Cargo lockfiles unchanged
run: |
tasks/scripts/check-cargo-lockfiles.sh
git diff --exit-code HEAD -- ':(glob)**/Cargo.lock'

python:
name: Python (${{ matrix.runner }})
needs: pr_metadata
Expand Down Expand Up @@ -247,7 +252,6 @@ jobs:
run: |
bash tasks/scripts/test-gateway-pull-policy.sh
bash tasks/scripts/test-gateway-config.sh

go:
name: Go SDK
needs: pr_metadata
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/cargo-deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ on:
schedule:
- cron: "23 7 * * *"
workflow_dispatch:
workflow_call:
inputs:
candidate_ref:
description: Optional pre-release tag to scan instead of the triggering revision
default: ""
type: string
advisories-only:
description: Run only the dependency advisory check
default: false
type: boolean

env:
CARGO_TERM_COLOR: always
Expand All @@ -17,7 +27,7 @@ permissions:
packages: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: cargo-deny-${{ github.workflow }}-${{ inputs.candidate_ref || github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -31,9 +41,16 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.candidate_ref && format('refs/tags/{0}', inputs.candidate_ref) || '' }}

- name: Install tools
run: mise install --locked

- name: Check dependencies
if: ${{ !inputs.advisories-only }}
run: mise run rust:deny

- name: Check dependency advisories
if: inputs.advisories-only
run: cargo deny check advisories
54 changes: 48 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@ on:
schedule:
- cron: "29 5 * * *"
workflow_dispatch:
workflow_call:
inputs:
candidate_ref:
description: Optional pre-release tag to scan instead of the triggering revision
default: ""
type: string
fail-on-findings:
description: Fail on HIGH/CRITICAL security findings (score at least 7.0)
default: false
type: boolean

permissions:
contents: read
security-events: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: codeql-${{ github.workflow }}-${{ inputs.candidate_ref || github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -38,7 +48,9 @@ jobs:
build-mode: none
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
id: checkout
with:
ref: ${{ inputs.candidate_ref && format('refs/tags/{0}', inputs.candidate_ref) || '' }}
persist-credentials: false

- name: Set up Go
Expand Down Expand Up @@ -69,9 +81,11 @@ jobs:
upload: never

- name: Summarize findings
id: findings
if: always()
env:
LANGUAGE: ${{ matrix.language }}
FAIL_ON_FINDINGS: ${{ inputs.fail-on-findings || false }}
shell: bash
run: |
set -euo pipefail
Expand All @@ -83,11 +97,23 @@ jobs:
echo
if [ "${#sarif_files[@]}" -eq 0 ]; then
echo "No SARIF report was produced."
exit 1
else
finding_count=$(jq -s '[.[].runs[]?.results[]?] | length' "${sarif_files[@]}")
finding_count=$(jq -s '[.[].runs[].results[]] | length' "${sarif_files[@]}")
high_count=$(jq -s '
[ .[].runs[] | . as $run | .results[]
| select(all(.suppressions[]?; .status != "accepted"))
| .ruleId as $id
| ($run.tool.driver, $run.tool.extensions[]?) | .rules[]?
| select(.id == $id)
| select((.properties["security-severity"] // "0" | tonumber) >= 7)
] | length
' "${sarif_files[@]}")
echo "high_count=$high_count" >> "$GITHUB_OUTPUT"
echo "Findings: $finding_count"
echo "HIGH/CRITICAL: $high_count"
echo
echo "Findings are informational and do not fail CI."
echo "Fail on HIGH/CRITICAL: $FAIL_ON_FINDINGS"
fi
} >> "$GITHUB_STEP_SUMMARY"

Expand All @@ -96,6 +122,8 @@ jobs:
uses: github/codeql-action/upload-sarif@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
with:
sarif_file: codeql-results
ref: ${{ inputs.candidate_ref && format('refs/tags/{0}', inputs.candidate_ref) || '' }}
sha: ${{ inputs.candidate_ref && steps.checkout.outputs.commit || '' }}
category: /language:${{ matrix.language }}

- name: Upload SARIF
Expand All @@ -107,8 +135,22 @@ jobs:
if-no-files-found: ignore
retention-days: 14

- name: Enforce HIGH/CRITICAL threshold
if: ${{ !cancelled() && steps.findings.outcome == 'success' }}
env:
HIGH_COUNT: ${{ steps.findings.outputs.high_count }}
FAIL_ON_FINDINGS: ${{ inputs.fail-on-findings || false }}
run: |
if [ "$HIGH_COUNT" -gt 0 ]; then
if [ "$FAIL_ON_FINDINGS" = "true" ]; then
echo "::error::CodeQL reported $HIGH_COUNT HIGH/CRITICAL findings."
exit 1
fi
echo "::warning::CodeQL reported $HIGH_COUNT HIGH/CRITICAL findings; enforcement is disabled."
fi

result:
name: OpenShell / CodeQL (informational)
name: ${{ inputs.fail-on-findings && 'OpenShell / CodeQL' || 'OpenShell / CodeQL (informational)' }}
if: always()
needs: analyze
runs-on: ubuntu-latest
Expand All @@ -120,7 +162,7 @@ jobs:
shell: bash
run: |
if [ "$ANALYZE_RESULT" != "success" ]; then
echo "::error::One or more CodeQL analyzers did not complete successfully."
echo "::error::CodeQL execution or the configured finding threshold failed."
exit 1
fi
echo "All CodeQL analyzers completed; findings remain informational."
echo "All CodeQL analyzers completed and the configured finding threshold passed."
40 changes: 36 additions & 4 deletions .github/workflows/codex-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ on:
required: false
default: false
type: boolean
fail-on-findings:
description: Fail on HIGH/CRITICAL security findings
default: false
type: boolean
upload_sarif:
description: Upload results to Code Scanning when called from a manual workflow
default: true
type: boolean
outputs:
base_sha:
description: Previous stable commit, empty for a full bootstrap scan
Expand Down Expand Up @@ -230,16 +238,25 @@ jobs:
--output "$SARIF_FILE"

- name: Summarize findings
id: findings
env:
BASE_TAG: ${{ steps.range.outputs.base_tag }}
CANDIDATE_TAG: ${{ steps.range.outputs.candidate_tag }}
COMMIT_COUNT: ${{ steps.range.outputs.commit_count }}
SARIF_FILE: ${{ runner.temp }}/codex-security.sarif
SCAN_SCOPE: ${{ steps.range.outputs.scan_scope }}
TRAIN: ${{ steps.range.outputs.train }}
FAIL_ON_FINDINGS: ${{ inputs.fail-on-findings || false }}
run: |
set -euo pipefail
finding_count=$(jq '[.runs[]?.results[]?] | length' "$SARIF_FILE")
finding_count=$(jq '[.runs[].results[]] | length' "$SARIF_FILE")
high_count=$(jq '
[ .runs[].results[]
| select(all(.suppressions[]?; .status != "accepted"))
| select(.properties.severity | ascii_downcase | IN("high", "critical"))
] | length
' "$SARIF_FILE")
echo "high_count=$high_count" >> "$GITHUB_OUTPUT"
{
echo "### Codex Security release qualification"
echo
Expand All @@ -254,8 +271,9 @@ jobs:
fi
echo "- Coverage: complete"
echo "- Findings: $finding_count"
echo "- HIGH/CRITICAL: $high_count"
echo
echo "Findings are informational during the observation phase."
echo "Fail on HIGH/CRITICAL: $FAIL_ON_FINDINGS"
} >> "$GITHUB_STEP_SUMMARY"

- name: Upload SARIF to Code Scanning
Expand All @@ -267,8 +285,22 @@ jobs:
sha: ${{ steps.range.outputs.candidate_sha }}
category: ${{ steps.range.outputs.category }}

- name: Enforce HIGH/CRITICAL threshold
if: ${{ !cancelled() && steps.findings.outcome == 'success' }}
env:
HIGH_COUNT: ${{ steps.findings.outputs.high_count }}
FAIL_ON_FINDINGS: ${{ inputs.fail-on-findings || false }}
run: |
if [ "$HIGH_COUNT" -gt 0 ]; then
if [ "$FAIL_ON_FINDINGS" = "true" ]; then
echo "::error::Codex reported $HIGH_COUNT HIGH/CRITICAL findings."
exit 1
fi
echo "::warning::Codex reported $HIGH_COUNT HIGH/CRITICAL findings; enforcement is disabled."
fi

result:
name: OpenShell / Codex Security (informational)
name: ${{ inputs.fail-on-findings && 'OpenShell / Codex Security' || 'OpenShell / Codex Security (informational)' }}
if: ${{ always() }}
needs: analyze
runs-on: ubuntu-latest
Expand All @@ -283,4 +315,4 @@ jobs:
echo "::error::Codex Security release qualification did not complete successfully."
exit 1
fi
echo "Codex Security completed; findings remain informational."
echo "Codex Security completed and the configured finding threshold passed."
Loading
Loading