Skip to content

chore(ci): add security baseline (SECURITY.md, audit, CodeQL, dependabot, concurrency)#2306

Open
ruflin wants to merge 1 commit into
9.xfrom
chore/ci-security-hardening
Open

chore(ci): add security baseline (SECURITY.md, audit, CodeQL, dependabot, concurrency)#2306
ruflin wants to merge 1 commit into
9.xfrom
chore/ci-security-hardening

Conversation

@ruflin

@ruflin ruflin commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Summary

Establish a supply-chain and security baseline for the repository:

  • SECURITY.md — documents supported branches and the private
    vulnerability-disclosure process (GitHub Security Advisories preferred,
    email fallback).
  • composer audit job in continuous-integration.yaml runs on every
    push and pull request so newly published advisories block the build
    early.
  • CodeQL workflow scans the repository's GitHub Actions with the
    security-and-quality query suite on push, pull request, and weekly
    (Mondays 06:17 UTC). PHP support is still in beta as of 2026-04, so it
    stays out of the matrix for now; the comment in the workflow explains
    how to enable it later.
  • concurrency group in CI cancels in-progress runs when a new
    commit lands on the same PR, reducing CI cost and noise.
  • dependabot.yml keeps Composer, GitHub Actions, and the Docker
    base image up to date. Composer updates are grouped (static-analysis,
    testing) to limit PR churn.

No production code changes.

Identified during a P0/P1 code-review pass.

Test plan

  • python3 -c \"import yaml; yaml.safe_load(open(...))\" validates each YAML file.
  • CI matrix (PHP 8.1–8.5) — see this PR's checks.
  • New audit job runs composer audit cleanly on the current lockfile.

Summary by CodeRabbit

  • Documentation

    • Added security policy documentation for vulnerability reporting and supported versions.
  • Chores

    • Implemented automated security scanning to detect code vulnerabilities.
    • Configured automated dependency update checks and management.
    • Added automated dependency vulnerability auditing to the CI pipeline.
    • Enhanced CI/CD with concurrency controls to optimize build performance.

…bot, concurrency)

Establish a supply-chain and security baseline for the repository:

- SECURITY.md documents the supported branches and the private
  vulnerability-disclosure process (GitHub Security Advisories or email).
- A new `audit` job in continuous-integration.yaml runs `composer audit`
  on every push and pull request so known advisories surface early.
- A new CodeQL workflow scans the repository's GitHub Actions with the
  `security-and-quality` query suite on push, pull request, and weekly.
  PHP support stays out of scope for now (CodeQL PHP analysis is still in
  beta as of 2026-04).
- A `concurrency` group cancels in-progress runs when a new commit lands
  on the same pull request, reducing CI cost and noise.
- A `dependabot.yml` keeps Composer, GitHub Actions, and the Docker base
  image up to date with grouped weekly Composer updates.

No production code changes.
Copilot AI review requested due to automatic review settings April 30, 2026 20:37
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72d05361-4e74-4aa7-b93b-a334e4786f2c

📥 Commits

Reviewing files that changed from the base of the PR and between d0c0d60 and 537f282.

📒 Files selected for processing (5)
  • .github/dependabot.yml
  • .github/workflows/codeql.yml
  • .github/workflows/continuous-integration.yaml
  • CHANGELOG.md
  • SECURITY.md

📝 Walkthrough

Walkthrough

Introduces repository-wide security and dependency maintenance infrastructure: Dependabot configuration for automated dependency updates, CodeQL workflow for security scanning, composer audit automation in CI, a security vulnerability disclosure policy, and updated changelog documentation.

Changes

Cohort / File(s) Summary
Security & Dependency Automation
.github/dependabot.yml, .github/workflows/codeql.yml
Establishes Dependabot configuration for composer, GitHub Actions, and Docker dependency updates with rate limits and labels. Adds CodeQL security scanning workflow triggered on pushes, pull requests, and weekly schedule for the actions language.
Workflow Enhancements
.github/workflows/continuous-integration.yaml
Implements workflow-level concurrency controls to cancel redundant in-progress runs. Introduces a new audit job running composer audit on PHP 8.4 in parallel with existing jobs.
Documentation
SECURITY.md, CHANGELOG.md
Creates security vulnerability disclosure policy documenting supported versions, reporting procedures, and scope. Updates changelog to document new security maintenance and CI automation features.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hop, hop! Security checks take flight,
Dependabot guards our code day and night,
CodeQL scans with a keen, watchful eye,
While concurrency keeps workflows spry!
A fortress of trust, built strong and quite right! 🛡️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: establishing a security baseline by adding SECURITY.md documentation, composer audit checks, CodeQL scanning, Dependabot automation, and CI concurrency controls.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/ci-security-hardening

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 2/8 reviews remaining, refill in 41 minutes and 6 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread SECURITY.md
@@ -0,0 +1,54 @@
# Security Policy

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Remove the SECURITY.md file

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Establishes a repository security/supply-chain baseline by adding a security policy, automated dependency auditing, CodeQL scanning for GitHub Actions, and Dependabot updates, along with CI run-concurrency controls.

Changes:

  • Add SECURITY.md documenting supported versions and private vulnerability reporting.
  • Add composer audit to CI plus workflow-level concurrency settings to reduce redundant PR runs.
  • Add CodeQL workflow and Dependabot configuration for Composer, GitHub Actions, and Docker.

Reviewed changes

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

Show a summary per file
File Description
SECURITY.md Adds security policy, supported versions table, and reporting process.
CHANGELOG.md Documents the new security baseline work under Unreleased → Security.
.github/workflows/continuous-integration.yaml Adds composer audit job and workflow-level concurrency control.
.github/workflows/codeql.yml Adds CodeQL workflow for GitHub Actions with schedule + concurrency control.
.github/dependabot.yml Adds Dependabot update rules for Composer, Actions, and Docker.

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

Comment thread CHANGELOG.md
Comment on lines +19 to +23
* Added a `SECURITY.md` file describing the supported branches and the private vulnerability-disclosure process.
* Added a `composer audit` job to the CI pipeline so PRs surface known advisories early.
* Added a CodeQL workflow that runs `security-and-quality` queries on the repository's GitHub Actions on every push, pull request, and weekly on a schedule.
* Added Dependabot configuration to keep Composer, GitHub Actions, and Docker dependencies up to date.
* Added a workflow `concurrency` group to cancel in-progress runs when a new commit lands on the same pull request.
on: ['push', 'pull_request']

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
- cron: '17 6 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
pull_request:
branches: ['9.x']
schedule:
# Run weekly to catch newly published advisories.
Comment thread SECURITY.md
Comment on lines +21 to +27
a public GitHub issue**. Instead use one of the following private channels:

- Open a [GitHub Security Advisory](https://github.com/ruflin/Elastica/security/advisories/new)
on the repository (preferred).
- Or email the maintainer directly at `spam@ruflin.com` with the subject
prefix `[Elastica security]`.

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