Skip to content

chore(ci): add CodeQL analysis + unmask bandit/gosec security gates - #95

Merged
PenguinzTech merged 1 commit into
v2.1.xfrom
chore/ci-gate-integrity-codeql
Aug 31, 2026
Merged

chore(ci): add CodeQL analysis + unmask bandit/gosec security gates#95
PenguinzTech merged 1 commit into
v2.1.xfrom
chore/ci-gate-integrity-codeql

Conversation

@PenguinzTech

Copy link
Copy Markdown
Contributor

Summary

Closes the CI verification-integrity gaps from the audit: security gates were masked (|| true / -no-fail / continue-on-error) so they couldn't fail, and no real CodeQL ran despite the org ruleset requiring code-scanning.

Changes

  • New .github/workflows/codeql.yml — real CodeQL analysis for python, go, javascript-typescript (SHA-pinned action; push/PR to main+v2.1.x+release/** + weekly cron). Provides the code-scanning results the org ruleset requires and adds the previously-absent JS/TS SAST coverage.
  • Unmasked bandit (build.yml, version-monitor.yml) — JSON report kept, followed by a real gating run on the same inputs (continue-on-error: false, no || true).
  • Unmasked gosec — replaced the -no-fail masked action with a gating gosec ./...; also fixed 4 ineffective //nolint:gosec suppressions to gosec-native // #nosec (they were silently unsuppressed).
  • Resolved the real findings the now-gating scanners surfaced:
    • ntp-server socket binds → justified # nosec B104 (network daemon must listen broadly)
    • dhcp.py/schema.py listen_address DB defaults → # nosec B104 (config data, not a bind)
    • squawk-client/bins/k8s-client.pyadded missing requests timeout (B113, a real hang bug)

Verification

  • bandit gating command → exit 0; gosec → exit 0 (0 issues); go build ./... → exit 0; all workflow YAML parse; every added action SHA-pinned; zizmor clean on the new workflow.

⚠️ Left for you to decide (not auto-changed)

  • Coverage gate --cov-fail-under=98 || true (build.yml, server-release.yml) is still non-gating (added a rationale comment). Actual coverage is well below 98%, so unmasking it would fail every build — that's a coverage-raising effort or a threshold decision, not a safe auto-fix.
  • Pre-existing zizmor findings on untouched workflow lines (checkout persist-credentials, missing job permissions:, echo template-injection, archived actions/create-release) — flagged for a separate pass.

🤖 Generated with Claude Code

Audit found the CI security gates masked (can't fail) and no real CodeQL despite
the org ruleset requiring code-scanning.

- Add .github/workflows/codeql.yml: real CodeQL analysis (python, go,
  javascript-typescript), SHA-pinned action, on push/PR to main+v2.1.x+release/**
  plus weekly cron. Provides the code-scanning results the org ruleset requires
  and adds the previously-absent JS/TS SAST coverage.
- Unmask bandit (build.yml, version-monitor.yml): JSON-report run kept, followed
  by a real gating run on the same inputs (no || true, continue-on-error: false),
  scoped to app source.
- Unmask gosec: replaced the -no-fail masked action with a gating
  `gosec ./...` on squawk-client-go; also fixed 4 ineffective //nolint:gosec
  suppressions to gosec-native `// #nosec` syntax (they were silently unsuppressed).
- Resolved the real findings the now-gating scanners surfaced:
  * ntp-server binds: `# nosec B104` justified (network daemon must listen broadly)
  * dhcp.py/schema.py listen_address DB defaults: `# nosec B104` (config data, not
    a socket bind)
  * squawk-client k8s-client.py: added missing requests timeout (B113, real bug)
- Coverage gate (--cov-fail-under=98 || true) left non-gating with a rationale
  comment — actual coverage is below threshold; raising it is a separate effort.

Verified: bandit gating command exits 0, gosec exits 0, go build passes, all
workflow YAML valid, actions SHA-pinned.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PenguinzTech PenguinzTech self-assigned this Aug 31, 2026
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread ntp-server/bins/server.py
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server_socket.bind(("0.0.0.0", self.port))
server_socket.bind(("0.0.0.0", self.port)) # nosec B104 - NTP server is a network daemon that must listen on all interfaces to serve clients
Comment thread ntp-server/bins/server.py
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(("0.0.0.0", self.port))
sock.bind(("0.0.0.0", self.port)) # nosec B104 - NTP server is a network daemon that must listen on all interfaces to serve clients
@PenguinzTech
PenguinzTech merged commit 039812a into v2.1.x Aug 31, 2026
23 of 24 checks passed
@PenguinzTech
PenguinzTech deleted the chore/ci-gate-integrity-codeql branch August 31, 2026 17:20
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.

2 participants