From 38c277c3ef6a3011463494b42e387228ca9f6798 Mon Sep 17 00:00:00 2001 From: acodebeard Date: Sat, 30 May 2026 15:06:48 -0700 Subject: [PATCH 1/2] Add security automation baseline --- .github/dependabot.yml | 12 ++++++++++++ .github/workflows/codeql.yml | 33 +++++++++++++++++++++++++++++++++ SECURITY.md | 13 +++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 SECURITY.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..157e565 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + day: monday + time: "09:00" + timezone: America/Phoenix + labels: + - dependencies + - github-actions diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..f626eb6 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,33 @@ +name: CodeQL + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: "34 9 * * 1" + +permissions: + actions: read + contents: read + security-events: write + +jobs: + analyze: + name: Analyze PHP + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: php + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v3 diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..cc606f6 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,13 @@ +# Security Policy + +## Reporting A Vulnerability + +Please report vulnerabilities through GitHub private vulnerability reporting: + +https://github.com/acodebeard/apod/security/advisories/new + +Do not open a public issue for suspected vulnerabilities. + +## Supported Version + +This repository tracks the public APOD recreation source on the `main` branch. Security fixes are handled against `main`. From 58189b20e059217e5a8f9a224e603a464a0c19ae Mon Sep 17 00:00:00 2001 From: acodebeard Date: Sat, 30 May 2026 15:08:46 -0700 Subject: [PATCH 2/2] Use Semgrep code scanning for PHP --- .github/workflows/code-scanning.yml | 42 +++++++++++++++++++++++++++++ .github/workflows/codeql.yml | 33 ----------------------- 2 files changed, 42 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/code-scanning.yml delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/code-scanning.yml b/.github/workflows/code-scanning.yml new file mode 100644 index 0000000..a99a8cc --- /dev/null +++ b/.github/workflows/code-scanning.yml @@ -0,0 +1,42 @@ +name: Code Scanning + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: "34 9 * * 1" + +permissions: + contents: read + security-events: write + +jobs: + semgrep: + name: Semgrep PHP + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install Semgrep + run: | + python -m pip install --upgrade pip + python -m pip install semgrep + + - name: Run Semgrep + run: semgrep scan --config p/php --sarif --output semgrep.sarif + + - name: Upload SARIF + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: semgrep.sarif diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index f626eb6..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: CodeQL - -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - - cron: "34 9 * * 1" - -permissions: - actions: read - contents: read - security-events: write - -jobs: - analyze: - name: Analyze PHP - runs-on: ubuntu-latest - - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: php - - - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v3