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
14 changes: 11 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: MPL-2.0-or-later
# SPDX-License-Identifier: PMPL-1.0
name: CodeQL Security Analysis

on:
Expand All @@ -9,6 +9,14 @@ on:
schedule:
- cron: '0 6 * * 1'

# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
# updates do not pile up queued runs against the shared account-wide
# Actions concurrency pool. Applied only to read-only check workflows
# (no publish/mutation), so cancelling a superseded run is always safe.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand All @@ -30,12 +38,12 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Initialize CodeQL
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3.28.1
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3.28.1
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
with:
category: "/language:${{ matrix.language }}"
8 changes: 8 additions & 0 deletions .github/workflows/governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ on:
pull_request:
workflow_dispatch:

# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
# updates do not pile up queued runs against the shared account-wide
# Actions concurrency pool. Applied only to read-only check workflows
# (no publish/mutation), so cancelling a superseded run is always safe.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand Down
34 changes: 28 additions & 6 deletions .github/workflows/scorecard-enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ on:
- cron: '0 6 * * 1' # Weekly on Monday
workflow_dispatch:

# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
# updates do not pile up queued runs against the shared account-wide
# Actions concurrency pool. Applied only to read-only check workflows
# (no publish/mutation), so cancelling a superseded run is always safe.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand All @@ -19,28 +27,42 @@ jobs:
security-events: write
id-token: write # For OIDC
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Run Scorecard
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
publish_results: true

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@6624720a57d4c312633c7b953db2f2da5bcb4c3a # v3
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4
with:
sarif_file: results.sarif

# Check specific high-priority items (separate job so run: steps
# do not contaminate the scorecard job that publishes results)
- name: Check minimum score
run: |
# Parse score from results
SCORE=$(jq -r '.runs[0].tool.driver.properties.score // 0' results.sarif 2>/dev/null || echo "0")

echo "OpenSSF Scorecard Score: $SCORE"

# Minimum acceptable score (0-10 scale)
MIN_SCORE=5

if [ "$(echo "$SCORE < $MIN_SCORE" | bc -l)" = "1" ]; then
echo "::error::Scorecard score $SCORE is below minimum $MIN_SCORE"
exit 1
fi

# Check specific high-priority items
check-critical:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check SECURITY.md exists
run: |
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: PMPL-1.0-or-later
# SPDX-License-Identifier: PMPL-1.0
name: OSSF Scorecard
on:
push:
Expand All @@ -7,6 +7,14 @@ on:
- cron: '0 4 * * *'
workflow_dispatch:

# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
# updates do not pile up queued runs against the shared account-wide
# Actions concurrency pool. Applied only to read-only check workflows
# (no publish/mutation), so cancelling a superseded run is always safe.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/secret-scanner.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: PMPL-1.0-or-later
# SPDX-License-Identifier: PMPL-1.0
# Prevention workflow - scans for hardcoded secrets before they reach main
name: Secret Scanner

Expand All @@ -7,6 +7,14 @@ on:
push:
branches: [main]

# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
# updates do not pile up queued runs against the shared account-wide
# Actions concurrency pool. Applied only to read-only check workflows
# (no publish/mutation), so cancelling a superseded run is always safe.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand All @@ -21,6 +29,8 @@ jobs:
- name: TruffleHog Secret Scan
uses: trufflesecurity/trufflehog@6c05c4a00b91aa542267d8e32a8254774799d68d # v3
with:
# The v3 action injects --fail automatically on pull_request events.
# Passing --fail here triggers "flag 'fail' cannot be repeated".
extra_args: --only-verified

gitleaks:
Expand All @@ -43,12 +53,10 @@ jobs:

- name: Check for hardcoded secrets in Rust
run: |
# Skip if no Rust files
if ! find . -name "Cargo.toml" -print -quit | grep -q .; then
echo "No Cargo.toml found, skipping Rust secret scan"
if ! find . -name Cargo.toml -not -path './target/*' -print -quit | grep -q .; then
echo 'No Cargo.toml found — skipping Rust secrets check'
exit 0
fi

# Patterns that suggest hardcoded secrets
PATTERNS=(
'const.*SECRET.*=.*"'
Expand All @@ -71,8 +79,3 @@ jobs:
echo "::error::Potential hardcoded secrets detected. Use environment variables instead."
exit 1
fi

- name: K9-SVC Validation
run: |
echo "K9-SVC validation"
[ -d .machine_readable/contractiles ] && echo "Contractiles present" || echo "No contractiles"
Loading