Skip to content

ci: consolidate security and performance workflows#7200

Draft
somethingwithproof wants to merge 10 commits into
Cacti:developfrom
somethingwithproof:ci/consolidated-workflows
Draft

ci: consolidate security and performance workflows#7200
somethingwithproof wants to merge 10 commits into
Cacti:developfrom
somethingwithproof:ci/consolidated-workflows

Conversation

@somethingwithproof

Copy link
Copy Markdown
Contributor

Consolidates the unmerged CI-only workflow branches into one reviewable PR.

This adds the security-review workflow and supporting prompt/script, plus the security-posture and performance-regression workflows with their policy checker and benchmark baseline. The already-merged PHP quality/nightly workflow branch was not included because current develop already contains edited versions of those workflows.

Validation run locally from a clean worktree:

  • git diff --check upstream/develop..HEAD
  • python3 -m py_compile .github/scripts/security_review.py .github/scripts/check-workflow-policy.py
  • ruby -e 'require "yaml"; Dir[".github/workflows/*.yml"].each { |f| YAML.load_file(f) }'

somethingwithproof and others added 5 commits June 12, 2026 16:54
Adds a GitHub Actions workflow that runs on every PR targeting develop.
The job collects the PR diff, grep hits on changed PHP files (SQL sinks,
superglobal access, command execution, dynamic includes, file writes,
archive extraction), and 120-line excerpts from historically vulnerable
hotspot files. It feeds all of this to claude-opus-4-6 using a
structured security review prompt and posts the model's findings as a
PR comment.

The job fails (blocking merge) when the model returns "BLOCK PR". API
or infrastructure errors are non-fatal so they do not block unrelated
PRs.

Requires the ANTHROPIC_API_KEY repository secret. Fork PRs skip
gracefully when the secret is absent.

Closes Cacti#6936-related CI gap — continuous variant-class hunting on every
PR without manual triage overhead.

Signed-off-by: Thomas Vincent <thomasvincent@somethingwithproof.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@somethingwithproof.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Add PHP-oriented parity guardrails similar to Spine modernization:
- new security posture workflow (TruffleHog, Semgrep SARIF, Scorecard,
  Composer audit, workflow policy checks)
- new performance regression workflow with hyperfine + RSS thresholds
- workflow policy checker script for pinned-action/strict-shell validation
- versioned CLI performance baseline file

Fixes Cacti#6822

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof somethingwithproof force-pushed the ci/consolidated-workflows branch from bc5af71 to fbfa03a Compare June 12, 2026 23:54
@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 .github/workflows/security-review.yml Fixed
Comment thread .github/workflows/security-review.yml Fixed
Comment thread .github/workflows/security-review.yml Fixed
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…ct pins

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The --lock flag needs an existing composer.lock; Cacti ships none, so the audit step exited 3.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Clears the level 6 alreadyNarrowedType error on lib/data_query.php:2591 that
develop currently emits, matching the sibling narrowing identifiers already ignored.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
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