From 8fede11d4da1ac6fadecf5d523b8a1859391c6bf Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 9 Aug 2026 01:33:14 +0000 Subject: [PATCH 1/3] Initial commit with task details Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: https://github.com/link-foundation/python-ai-driven-development-pipeline-template/issues/48 --- .gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitkeep diff --git a/.gitkeep b/.gitkeep new file mode 100644 index 0000000..84cbbe7 --- /dev/null +++ b/.gitkeep @@ -0,0 +1 @@ +# .gitkeep file auto-generated at 2026-08-09T01:33:14.803Z for PR creation at branch issue-48-5c3758770f7b for issue https://github.com/link-foundation/python-ai-driven-development-pipeline-template/issues/48 \ No newline at end of file From 183bbf4b73eb86f5fe57eceede7a82405f6ca2d2 Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 9 Aug 2026 01:35:47 +0000 Subject: [PATCH 2/3] test(ci): require security scanning workflow --- tests/test_workflows.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/test_workflows.py b/tests/test_workflows.py index 725b5b5..ab62e58 100644 --- a/tests/test_workflows.py +++ b/tests/test_workflows.py @@ -105,6 +105,35 @@ def test_workflow_run_blocks_do_not_interpolate_untrusted_inputs() -> None: ) +def test_security_workflow_scans_code_actions_and_dependencies() -> None: + """Security checks must cover pushes, pull requests, and scheduled scans.""" + workflow = read_workflow("security.yml") + codeql_job = workflow_job_block(workflow, "codeql") + dependency_job = workflow_job_block(workflow, "dependency-review") + + assert "branches: [main]" in workflow + assert "pull_request:" in workflow + assert "schedule:" in workflow + assert "cron: '0 6 * * 1'" in workflow + assert "permissions:\n contents: read" in workflow + + assert "timeout-minutes: 30" in codeql_job + assert "security-events: write" in codeql_job + assert "language: [python, actions]" in codeql_job + assert "languages: ${{ matrix.language }}" in codeql_job + assert "uses: github/codeql-action/init@v4" in codeql_job + assert "uses: github/codeql-action/autobuild@v4" in codeql_job + assert "uses: github/codeql-action/analyze@v4" in codeql_job + assert "cancel-in-progress: true" in codeql_job + + assert "if: github.event_name == 'pull_request'" in dependency_job + assert "timeout-minutes: 10" in dependency_job + assert "pull-requests: write" in dependency_job + assert "uses: actions/dependency-review-action@v5" in dependency_job + assert "fail-on-severity: high" in dependency_job + assert "comment-summary-in-pr: on-failure" in dependency_job + + def test_changelog_check_safely_requires_a_fragment() -> None: """Source-changing pull requests must fail safely without a fragment.""" workflow = read_workflow("release.yml") From a0ddc566cd11aefe865ad6f257d6c8e303be17f8 Mon Sep 17 00:00:00 2001 From: konard Date: Sun, 9 Aug 2026 01:37:02 +0000 Subject: [PATCH 3/3] feat(ci): add security scanning workflow --- .github/workflows/security.yml | 57 +++++++++++++++++++ .gitkeep | 1 - .../20260809_issue_48_security_scanning.md | 4 ++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/security.yml delete mode 100644 .gitkeep create mode 100644 changelog.d/20260809_issue_48_security_scanning.md diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..9b9c3ba --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,57 @@ +name: Security + +on: + push: + branches: [main] + pull_request: + schedule: + - cron: '0 6 * * 1' + +permissions: + contents: read + +jobs: + codeql: + name: CodeQL (${{ matrix.language }}) + runs-on: ubuntu-latest + timeout-minutes: 30 + concurrency: + group: check-${{ github.workflow }}-${{ github.ref }}-codeql-${{ matrix.language }} + cancel-in-progress: true + permissions: + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + language: [python, actions] + steps: + - uses: actions/checkout@v6 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v4 + + - name: Analyze + uses: github/codeql-action/analyze@v4 + + dependency-review: + name: Dependency Review + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v6 + + - name: Review dependency changes + uses: actions/dependency-review-action@v5 + with: + fail-on-severity: high + comment-summary-in-pr: on-failure diff --git a/.gitkeep b/.gitkeep deleted file mode 100644 index 84cbbe7..0000000 --- a/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# .gitkeep file auto-generated at 2026-08-09T01:33:14.803Z for PR creation at branch issue-48-5c3758770f7b for issue https://github.com/link-foundation/python-ai-driven-development-pipeline-template/issues/48 \ No newline at end of file diff --git a/changelog.d/20260809_issue_48_security_scanning.md b/changelog.d/20260809_issue_48_security_scanning.md new file mode 100644 index 0000000..789c322 --- /dev/null +++ b/changelog.d/20260809_issue_48_security_scanning.md @@ -0,0 +1,4 @@ +### Security + +- Add CodeQL scanning for Python code and GitHub Actions workflows, plus + dependency review for pull requests.