[#2885] Split Gitleaks and composer audit into a standalone 'Security audit' workflow. - #2886
Conversation
WalkthroughCI security checks moved from lint jobs into dedicated security jobs. The jobs run Gitleaks and locked Composer audits. Deployment workflows now require successful security checks. CI documentation reflects the new job structure. ChangesCI security workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CI as CI security job
participant Gitleaks
participant Composer
participant Deployment
CI->>Gitleaks: Scan repository secrets
CI->>Composer: Create Composer lock data
CI->>Composer: Run composer audit --locked
CI->>Deployment: Report security job status
Deployment->>Deployment: Require build, lint, and security success
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
|
📖 Documentation preview for this pull request has been deployed to Netlify: https://6a726438df44e353b08d52fc--vortex-docs.netlify.app This preview is rebuilt on every commit and is not the production documentation site. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2886 +/- ##
==========================================
- Coverage 86.81% 86.39% -0.43%
==========================================
Files 100 93 -7
Lines 4846 4688 -158
Branches 47 3 -44
==========================================
- Hits 4207 4050 -157
+ Misses 639 638 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #2885
Summary
The
lintjob in both CI providers also ran the Gitleaks secret scan andcomposer audit, so a redlintcheck never said whether the codebase had a style problem or a disclosed vulnerability, and both security checks paid for the full Docker application stack that the other linters need. Both checks now live in a standalone workflow namedSecurity audit- a new.github/workflows/audit.ymlin GitHub Actions and a newauditentry underworkflows:in CircleCI - each running a singleauditjob. It triggers on the same pushes, pull requests and tags as the main pipeline, and can also be started by hand viaworkflow_dispatch.The new workflow needs no application containers and no installed dependencies: Gitleaks runs straight from its
ghcr.ioimage, andcomposer audit --lockedaudits the packages pinned incomposer.lockon the bare runner, replacing the in-containercomposer auditthat previously required a built stack. Vortex's own repository does not trackcomposer.lock, so aVORTEX_DEV-fenced step resolves dependencies first; that step is stripped from every consumer site, which commits its lock file.Being a separate workflow means
deploycan no longer declare a dependency on it - GitHub Actions has no cross-workflowneeds, and CircleCI has no cross-workflowrequires- sodeploy/deploy-tagsare back to requiringbuildandlint, and the documentation now points at branch protection required status checks as the way to make the audit block merges and deployments.Changes
GitHub Actions
.github/workflows/audit.yml(name: Security audit, jobaudit) carrying the Gitleaks scan under the existingCI_GITLEAKSfence andcomposer audit --locked, with theVORTEX_CI_GITLEAKS_IGNORE_FAILUREandVORTEX_CI_COMPOSER_AUDIT_IGNORE_FAILUREoverrides preserved.build-test-deploy.yml- same push branches and tags, same pull request branches - and addedworkflow_dispatchso the audit can be run on demand.Audit Composer packagessteps from thelintjob inbuild-test-deploy.yml; that file is otherwise unchanged.CircleCI
auditjob and gave it its ownauditworkflow besidecommit, so it runs independently and can be re-run on its own.setup_remote_dockersits inside theCI_GITLEAKSfence, so a project with Gitleaks disabled starts no Docker engine at all.lintjob. Thecommitworkflow's job list is untouched, which matters becausetests/phpunit/CircleCiConfigTest.phpaddressesworkflows.commit.jobs[3]and[4]positionally.Installer
CiProvider::process()now also removes.github/workflows/audit.ymlwhen GitHub Actions is not the selected provider, so CircleCI-only and CI-less projects do not receive an orphan workflow.Documentation
Security auditsection to the CI overview covering both providers, what the workflow runs, how to start it manually, and a note that it does not gatedeployand should be enforced through branch protection.Security audit workflowsection to the GitHub Actions page, and listed theauditworkflow on the CircleCI page.Composer auditis gone from the Lint box and the audit appears as its own band below the pipeline, since it is no longer part of it.Fixtures
-audit.ymlremoval marker, which is what proves the installer strips the workflow for non-GitHub-Actions projects.Before / After
Summary by CodeRabbit
New Features
Documentation