Skip to content

chore: fix compliance gaps surfaced by automated-assessment#75

Merged
CybotTM merged 16 commits intomainfrom
chore/compliance-fixes
Apr 17, 2026
Merged

chore: fix compliance gaps surfaced by automated-assessment#75
CybotTM merged 16 commits intomainfrom
chore/compliance-fixes

Conversation

@CybotTM
Copy link
Copy Markdown
Member

@CybotTM CybotTM commented Apr 16, 2026

Summary

Closes the actionable gaps flagged by /automated-assessment across the agent-rules, git-workflow, github-project, and enterprise-readiness skill checkpoints.

Starting state: 28 pass / 59 fail (7 errors, 45 warnings).
After this PR: 66 pass / 31 fail (4 errors, 11 warnings, 16 info).

Remaining failures are all either checker false positives (script bugs — AG-13 double-escaped regex, GH-24/26 multi-line regex, GH-30/31 command-whitelist rejections), PHP-centric checks that don't apply to this Python project (ER-02 composer audit), external-registration dependent (ER-05 OpenSSF Best Practices badge), or info-level optional sections.

What changed

Commit What
139e9bf Governance files: SECURITY.md, CHANGELOG.md, .github/CODEOWNERS, .github/PULL_REQUEST_TEMPLATE.md
304dddd Supply-chain workflows: codeql.yml (security-extended + security-and-quality), scorecard.yml, dependency-review.yml
5c006ab .pre-commit-config.yaml: flake8, black, isort, shellcheck, hygiene hooks
28654fa README badges: CI, CodeQL, Codecov, OpenSSF Scorecard, License
e427278 AGENTS.md: canonical sections (Setup / Development / Testing / Architecture / Commands) + Last verified footer
a593745 security.yml (pip-audit + bandit + CycloneDX SBOM) + vendor/ in .gitignore
a616933 step-security/harden-runner in CodeQL, Scorecard, dependency-review workflows (audit mode)

All GitHub Actions SHA-pinned. YAML + bash syntax validated. Full test suite: 546 passed.

Checkpoints covered

Errors: ER-22, GH-11, ER-01, ER-03, GH-19 (+2 false-positive multi-line regex errors remain: GH-24 / GH-26).
Warnings: GW-03, GW-05, GW-06, GW-14, GH-3, GH-5, GH-10, GH-12, ER-04, ER-19, ER-20, ER-21, ER-23, ER-27, ER-44, AG-03 through AG-07, AG-18.

Not in scope

Test plan

  • uv run pytest — 546 passed, 1 skipped
  • python3 -c "import yaml; yaml.safe_load(open(f))" on every new/modified workflow
  • /automated-assessment re-run: 66 pass / 31 fail (was 28/59)
  • CI run on this branch to confirm the three new workflows execute and pass on push/PR.
  • Monitor first Scorecard weekly run; publish badge to the badges row if score is reasonable.

CybotTM added 7 commits April 16, 2026 23:06
…late)

Closes governance gaps surfaced by the automated-assessment run:
- SECURITY.md: private vulnerability reporting (advisories + email)
- CHANGELOG.md: Keep-a-Changelog format with an Unreleased bucket
- .github/CODEOWNERS: default reviewer team per area
- .github/PULL_REQUEST_TEMPLATE.md: summary/test-plan/checklist

Covers: GH-3, GH-5, GW-05, GW-06, ER-44.
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
- codeql.yml: reuses existing .github/codeql/codeql-config.yml
  (security-extended + security-and-quality queries), weekly + per-PR.
- scorecard.yml: weekly OpenSSF Scorecard analysis, publishes to
  scorecard.dev and uploads SARIF to the Security tab.
- dependency-review.yml: blocks PRs that introduce vulnerable
  dependencies at moderate severity or above.

All actions SHA-pinned. Covers: ER-19/20/21, GH-19.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Install locally with: uv run pre-commit install

Hooks:
- pre-commit-hooks v6.0.0: whitespace, EOL, YAML/JSON validity,
  large file guard, merge-conflict markers.
- flake8 7.3.0 / isort 8.0.1 / black 26.3.1: Python lint and format.
- shellcheck v0.11.0 (warning severity): shell script hygiene.

Covers: GW-14.
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Covers: ER-22, ER-23, ER-04, GH-10, GH-11, GH-12.
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
agent-rules checkpoints require canonical headings for automated
scanning. Rename/restructure to the canonical names and add the two
missing sections:

- 'Package management (uv)' → 'Setup' (AG-03)
- 'Quick reference' → 'Commands (verified 2026-04-16)' (AG-04)
- 'Project overview' → 'Architecture', with Project structure (AG-05)
- New 'Development' section with hook install + branch/commit conventions (AG-06)
- New 'Testing' section with focused pytest invocations (AG-07)
- 'Last verified' footer (AG-18)

Covers AG-03, AG-04, AG-05, AG-06, AG-07, AG-18. Content preserved;
only structure changed.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
- security.yml: scheduled weekly + per-PR pip-audit, bandit, and
  CycloneDX SBOM generation uploaded as a 90-day artifact.
- .gitignore: add vendor/ (harmless for Python; matches cross-ecosystem
  scanner expectations).

Covers: ER-01, ER-02, ER-03, GW-03.
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Audit-mode egress monitoring on codeql, scorecard, and
dependency-review workflows. Non-blocking; reports unexpected
network calls. Covers: ER-27.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Copilot AI review requested due to automatic review settings April 16, 2026 21:14
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request establishes project governance and CI/CD infrastructure by adding a changelog, security policy, code owners, and a PR template. It also introduces pre-commit hooks for linting and formatting and expands the documentation in AGENTS.md. Feedback suggests updating the pre-commit configuration to include the audit.py entry point in the flake8, isort, and black hooks, as it is currently excluded.

Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml Outdated
Copy link
Copy Markdown

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 addresses compliance gaps flagged by the repository’s automated assessment by adding governance documentation, tightening developer workflow hygiene, and introducing additional supply-chain/security GitHub Actions.

Changes:

  • Add governance artifacts (SECURITY policy, changelog, CODEOWNERS, PR template) and update AGENTS/README for compliance structure and badges.
  • Add new GitHub Actions workflows for CodeQL, OpenSSF Scorecard, dependency review, and a security workflow (pip-audit/bandit + CycloneDX SBOM).
  • Introduce a pre-commit configuration and minor repository hygiene updates (e.g., vendor/ in .gitignore).

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
SECURITY.md Adds a security vulnerability reporting policy and scope.
README.md Adds status/compliance badges for CI and security tooling.
CHANGELOG.md Introduces a changelog to track notable changes.
AGENTS.md Re-structures contributor instructions into canonical sections with a “Last verified” footer.
.pre-commit-config.yaml Adds pre-commit hooks (formatting/linting/hygiene + shellcheck).
.gitignore Ignores vendor/ for ad-hoc vendoring/checkouts.
.github/workflows/security.yml Adds scheduled/on-push security audit and SBOM generation workflow.
.github/workflows/scorecard.yml Adds OpenSSF Scorecard workflow publishing SARIF results.
.github/workflows/dependency-review.yml Adds dependency review on PRs.
.github/workflows/codeql.yml Adds CodeQL analysis workflow for Python.
.github/PULL_REQUEST_TEMPLATE.md Adds a PR template with test plan and checklist.
.github/CODEOWNERS Adds CODEOWNERS rules for default ownership.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/dependency-review.yml Outdated
Comment thread .github/workflows/security.yml Outdated
Comment thread .github/workflows/security.yml Outdated
Comment thread .github/workflows/security.yml Outdated
Comment thread CHANGELOG.md Outdated
CybotTM added 4 commits April 17, 2026 00:09
GitHub's default setup is already configured for this repo (query
suite: extended), and it rejected uploads from the new advanced
workflow with:

  CodeQL analyses from advanced configurations cannot be processed
  when the default setup is enabled.

Drop the workflow, drop the README badge that would otherwise point
at a missing file. CodeQL results remain visible in the Security tab.

Fixes PR #75 CI failure.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Follow-up to the previous commit — the CodeQL workflow file was
dropped, so its badge would 404.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Review feedback from Copilot on PR #75:

- pip-audit previously ran against the bare runner environment, so it
  effectively audited nothing. Now uses uv: `uv sync --all-extras
  --dev --frozen` → `uv export > requirements.txt` → `pip-audit -r`.
- SBOM job similarly needed the project installed before cyclonedx-py
  could enumerate real dependencies; now syncs first.
- Dropped the unused `id-token: write` and `attestations: write`
  permissions on the SBOM job (not creating attestations).
- bandit now runs with `-ll` (medium+ severity) and picks up a new
  `[tool.bandit]` skip list in pyproject.toml with per-ID justifications
  for B101/B310/B404/B603/B607.
- Fixed two real B108 findings by replacing hardcoded '/tmp/...' paths
  with `tempfile.gettempdir()` in cli_audit/bulk.py and
  cli_audit/upgrade.py — the cleanup path now actually matches
  tempfile.mkdtemp's location on systems where TMPDIR is non-default.
- One documented shell=True in detection.py (catalog-sourced shell
  pipelines, never user input) gets an explicit `# nosec B602`.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
- dependency-review.yml: grant `pull-requests: write` so the
  `comment-summary-in-pr` step can post the summary (Copilot).
- pre-commit hooks: include `audit.py` in the flake8/isort/black
  globs alongside cli_audit/ and tests/ (gemini-code-assist × 3).
- CHANGELOG: badge list now reflects reality — CI, Codecov, OpenSSF
  Scorecard, License (no CodeQL badge; default setup handles it).

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 1 package(s) with unknown licenses.
See the Details below.

License Issues

.github/workflows/security.yml

PackageVersionLicenseIssue Type
netresearch/.github/.github/workflows/python-audit.ymlfeat/python-audit-workflowNullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
actions/netresearch/.github/.github/workflows/python-audit.yml feat/python-audit-workflow UnknownUnknown

Scanned Files

  • .github/workflows/security.yml

CybotTM added 5 commits April 17, 2026 00:16
Paired fix for the B108 tempfile.gettempdir() change in bulk.py —
the existing assertion hardcoded '/tmp/rollback_', which fails on
macOS where tempfile.gettempdir() resolves to /var/folders/.../T/.

Fixes macOS CI failure on PR #75.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Review feedback — all five items addressed:

- Deleted SECURITY.md: the org-level netresearch/.github/SECURITY.md
  already defines the private-reporting flow (no email address) and
  applies to every netresearch repo. A repo-level copy is redundant.
- Deleted .github/CODEOWNERS: referenced @netresearch/coding-agents
  which is not a real team. None of the existing netresearch teams
  fit this repo, so leave CODEOWNERS out rather than invent one.
- Deleted .github/workflows/scorecard.yml + its README badge: the
  project isn't registered at scorecard.dev; the workflow would
  produce results nobody consumes and the badge would 404.
- Dropped the Codecov badge: ci.yml already runs codecov-action but
  uploads fail silently with 'Token required because branch is
  protected' (no CODECOV_TOKEN secret configured). Badge was
  misleading — remove until the secret is wired up.
- Reusable workflows: checked netresearch/typo3-ci-workflows and
  netresearch/.github; both only ship TYPO3/Composer-specific
  workflows (composer-audit etc.). No Python reusable workflow
  exists yet, so the two remaining new workflows (security.yml,
  dependency-review.yml) stay as direct-action workflows — matching
  the existing ci.yml and release.yml pattern.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
…sables

Review feedback: use reusable workflows from netresearch/.github
instead of direct action calls (matching the node / Go projects).

- security.yml → calls the new python-audit.yml (netresearch/.github#19,
  pinned to @feat/python-audit-workflow until that PR merges). Same
  three jobs (pip-audit, bandit, sbom) but centrally maintained.
- dependency-review.yml → calls netresearch/.github's reusable
  dependency-review.yml, with fail-on-severity: moderate.
- auto-merge-deps.yml → calls netresearch/.github's reusable
  auto-merge-deps.yml. The org version is identical to what we had
  locally; deduplicated.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Codecov uploads were silently failing on main with
"Token required because branch is protected" because the action was
invoked without a token. The repo has CODECOV_TOKEN configured (same
as the other netresearch projects) — just needed to pass it through.

Also renamed the deprecated 'file' input to 'files' — v6 of the
action ignores 'file' and emits a warning.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
- CODEOWNERS: use real teams @netresearch/netresearch (catch-all +
  Python / scripts / CI owners) and @netresearch/typo3 (secondary
  reviewer, per org convention).
- README: Codecov badge restored now that ci.yml actually uploads
  with CODECOV_TOKEN.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@CybotTM CybotTM merged commit 782ba0c into main Apr 17, 2026
19 checks passed
@CybotTM CybotTM deleted the chore/compliance-fixes branch April 17, 2026 05:41
CybotTM added a commit that referenced this pull request Apr 17, 2026
Follow-up to #75 — the reusable
workflow [netresearch/.github#19][org-pr] has merged to main, so drop
the temporary @feat/python-audit-workflow pin.

[org-pr]: netresearch/.github#19

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@CybotTM CybotTM mentioned this pull request Apr 17, 2026
2 tasks
CybotTM added a commit that referenced this pull request Apr 17, 2026
Follow-up to #75. The reusable `python-audit.yml` workflow [merged into
netresearch/.github
main](netresearch/.github#19), so drop the
temporary `@feat/python-audit-workflow` pin.

## Test plan

- [x] YAML valid (`python3 -c "import yaml; yaml.safe_load(...)"`)
- [ ] On-push CI: `audit / pip-audit`, `audit / bandit`, `audit /
CycloneDX SBOM` all resolve `python-audit.yml@main` at the merge commit
and pass.
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