-
-
Notifications
You must be signed in to change notification settings - Fork 441
feat(security): consolidated security hardening — forward-port from 1.2.x + DOM XSS + JS fixes #7055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(security): consolidated security hardening — forward-port from 1.2.x + DOM XSS + JS fixes #7055
Changes from all commits
d539aaf
fdf4a43
d4dcab0
a03393c
1edb247
6abba04
a6539f5
8ba1caa
bbd73b6
228c46d
a8c0ed3
3001d75
00025dd
59516a6
0f85a88
ca69cae
3d1a9ee
cbdf2a5
a7326fc
9b49f97
1918657
edeb326
05c2134
0a9f7b3
f949bdf
0ed2464
f4ca9a1
8580834
3efbdcc
4d7f179
1c5298d
9aabdce
2da219b
d2a482a
5979504
eef9035
a60b8d2
d24db44
6d75226
b4e2f3d
58e65e6
ca5663d
4e973d3
41bdbef
5f65009
21da254
b8e1ae4
531f750
c2904cd
890a213
44e2bc7
a991b40
48e763e
2908b63
e69a747
c3f01f1
3eed122
7523bc2
f5f0efa
b0af8da
0e446e5
8a2e5e2
132d561
5ca63a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "npm" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 10 | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 10 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: "CodeQL" | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master, develop, regression-audit] | ||
| paths-ignore: | ||
| - "**/*.php" | ||
| - "**/*.md" | ||
| pull_request: | ||
| branches: [main, master, develop, regression-audit] | ||
| paths-ignore: | ||
| - "**/*.php" | ||
| - "**/*.md" | ||
| schedule: | ||
| - cron: "30 1 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: codeql-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: ["javascript-typescript", "python"] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3 | ||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3 | ||
| with: | ||
| category: "/language:${{ matrix.language }}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # +-------------------------------------------------------------------------+ | ||
| # | Copyright (C) 2004-2026 The Cacti Group | | ||
| # | | | ||
| # | This program is free software; you can redistribute it and/or | | ||
| # | modify it under the terms of the GNU General Public License | | ||
| # | as published by the Free Software Foundation; either version 2 | | ||
| # | of the License, or (at your option) any later version. | | ||
| # | | | ||
| # | This program is distributed in the hope that it will be useful, | | ||
| # | but WITHOUT ANY WARRANTY; without even the implied warranty of | | ||
| # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | ||
| # | GNU General Public License for more details. | | ||
| # +-------------------------------------------------------------------------+ | ||
| # | Cacti: The Complete RRDtool-based Graphing Solution | | ||
| # +-------------------------------------------------------------------------+ | ||
| # | This code is designed, written, and maintained by the Cacti Group. See | | ||
| # | about.php and/or the AUTHORS file for specific developer information. | | ||
| # +-------------------------------------------------------------------------+ | ||
| # | http://www.cacti.net/ | | ||
| # +-------------------------------------------------------------------------+ | ||
|
|
||
| name: PHPStan Static Analysis | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ 1.2.x ] | ||
| pull_request: | ||
| branches: [ 1.2.x ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: phpstan-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| phpstan: | ||
| runs-on: ubuntu-latest | ||
| name: PHPStan Level 5 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Install PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.1' | ||
| extensions: ldap, xml, curl, mbstring | ||
| tools: phpstan | ||
|
|
||
| - name: Run PHPStan | ||
| run: phpstan analyse --configuration=phpstan.neon --no-progress |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| name: Security Proof Guardrails | ||
|
|
||
| on: | ||
| push: | ||
| branches: [develop, 1.2.x] | ||
| pull_request: | ||
| branches: [develop, 1.2.x] | ||
| workflow_dispatch: | ||
| inputs: | ||
| repo_name: | ||
| description: "Repository to query for advisory source data (owner/name)" | ||
| required: false | ||
| default: "Cacti/cacti" | ||
| branch_list: | ||
| description: "Space-separated branch list to evaluate" | ||
| required: false | ||
| default: "1.2.x develop" | ||
| strict_gate: | ||
| description: "Fail run when unresolved advisories remain" | ||
| required: false | ||
| default: "false" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: security-proof-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| sink-inventory-guard: | ||
| name: sink and architectural hotspot guard | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Verify tracked sink baseline | ||
| run: scripts/security/verify_sink_inventory.sh | ||
|
|
||
| - name: Verify no new architectural hotspots | ||
| run: scripts/security/verify_architectural_hotspots.sh | ||
|
|
||
| advisory-proof-matrix: | ||
| name: private advisory proof matrix | ||
| if: github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Build proof matrix | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| set -euo pipefail | ||
| out_dir="security/proof-run/${GITHUB_RUN_ID}" | ||
| mkdir -p "${out_dir}" | ||
| scripts/security/build_private_advisory_matrix.sh \ | ||
| "${{ inputs.repo_name }}" \ | ||
| "${{ inputs.branch_list }}" \ | ||
| "${out_dir}" | ||
| scripts/security/build_sink_inventory.sh > "${out_dir}/sink_inventory.current.tsv" | ||
| scripts/security/build_architectural_helper_report.sh --summary > "${out_dir}/architectural_helper.summary.tsv" | ||
| scripts/security/build_architectural_helper_report.sh --hotspots > "${out_dir}/architectural_helper.hotspots.tsv" | ||
|
|
||
| - name: Enforce closure gate | ||
| if: inputs.strict_gate == 'true' | ||
| run: | | ||
| set -euo pipefail | ||
| scripts/security/verify_private_advisory_matrix.sh "security/proof-run/${GITHUB_RUN_ID}/private_advisory_proof_matrix.tsv" | ||
|
|
||
| - name: Upload proof artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: private-advisory-proof-${{ github.run_id }} | ||
| path: security/proof-run/${{ github.run_id }} | ||
| if-no-files-found: error |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,21 +3,21 @@ repos: | |
| hooks: | ||
| - id: lintcheck | ||
| name: PHP Lint Checking | ||
| entry: sh tests/tools/pre-commit-check.sh lint | ||
| entry: composer run-script lint | ||
| language: system | ||
| types: [php] | ||
| files: ^app/ | ||
| always_run: true | ||
|
|
||
| - id: phpcsfixer | ||
| name: PHP CS Fixer Validation | ||
| entry: sh tests/tools/pre-commit-check.sh phpcsfixer | ||
| entry: composer run-script phpcsfixer | ||
| language: system | ||
| types: [php] | ||
| files: ^app/ | ||
| always_run: true | ||
|
|
||
| - id: phpstan | ||
| name: PHPStan Validation | ||
| entry: sh tests/tools/pre-commit-check.sh phpstan | ||
| entry: composer run-script phpstan | ||
| language: system | ||
| types: [php] | ||
| files: ^app/ | ||
|
Comment on lines
4
to
+22
|
||
| always_run: true | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CodeQL workflow explicitly ignores all PHP files and does not analyze the PHP language (matrix only includes javascript-typescript and python). Given this repository is primarily PHP and this PR is security-focused, this configuration will miss the most important CodeQL coverage. Please enable PHP CodeQL analysis and remove the
paths-ignoreentries for**/*.php.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged — PHP in CodeQL is a separate long-standing discussion (#5955 tracks it).