cuonztech-privacy-chaos-gate 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ # Hinweise zu Drittdaten
2
+
3
+ CPCG enthält Daten aus folgender Quelle. Die Lizenz der CPCG-Software selbst steht in `LICENSE`.
4
+
5
+ ## Open Cookie Database
6
+
7
+ - Quelle: https://github.com/jkwakman/Open-Cookie-Database
8
+ - Version: Commit `81813835edc9682113a4d95989358da5256d30c1`
9
+ - Lizenz: Apache License 2.0, Text in `licenses/Open-Cookie-Database-LICENSE.txt`
10
+ - Verwendet in: `src/core/scanner/data/openCookieDatabase.generated.ts` (im npm-Paket in `dist/` gebündelt)
11
+ - Änderungen gegenüber dem Original: Es sind nur Einträge der Kategorien Analytics und Marketing übernommen. Entfernt
12
+ wurden Consent-/CMP-Speicher, zu allgemeine Cookie-Namen ohne Domain-Bindung sowie Mehrzweck-Domains (Plattformen,
13
+ einzelne Websites, Widgets, CMPs). Die Daten sind in eine Nachschlagetabelle umgeformt. Erzeugt mit
14
+ `scripts/build-tracker-data.mts`.
package/action.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: "Cuonztech Privacy Chaos Gate"
2
- description: "Agentic CI/CD Privacy Chaos Engineering & Auto-Remediation Gate for Cookie/Consent Leaks"
2
+ description: "CI gate that stress-tests cookie consent banners, judges findings per jurisdiction and proposes fixes (PR for OneTrust/Cookiebot)"
3
3
  author: "Cuonztech"
4
4
  branding:
5
5
  icon: "shield"
@@ -17,6 +17,10 @@ inputs:
17
17
  description: "Opt-in: allow the source code to be sent to the LLM provider (OpenAI only) to generate patches (needs api-key). Off by default; only passed on if the installed CLI supports it."
18
18
  required: false
19
19
  default: "false"
20
+ allow-custom-banner-fix:
21
+ description: "Opt-in: the auto-fix may change scripts even when the site uses its own banner (no supported CMP). Off by default: then only manual steps are reported. Only passed on if the installed CLI supports it."
22
+ required: false
23
+ default: "false"
20
24
  llm-provider:
21
25
  description: "LLM provider for auto-remediation. Only 'openai' is implemented; 'anthropic' and 'gemini' fall back to the built-in rules."
22
26
  required: false
@@ -65,6 +69,38 @@ inputs:
65
69
  description: "Maximum number of linked subpages checked for trackers (default 12, max 40; larger values take longer)"
66
70
  required: false
67
71
  default: ""
72
+ sitemap:
73
+ description: "Deep run: check subpages from robots.txt/sitemap.xml and homepage links until deep-budget is used up (true/false)"
74
+ required: false
75
+ default: "false"
76
+ deep-budget:
77
+ description: "Time budget of the sitemap deep run for subpages in seconds (30-3600, default 300)"
78
+ required: false
79
+ default: ""
80
+ deep-state:
81
+ description: "State file of the deep run; the next run continues with unchecked subpages (persist it with actions/cache)"
82
+ required: false
83
+ default: ""
84
+ baseline-report:
85
+ description: "Report JSON of an earlier run; the report lists new, resolved and unchanged findings (restore it e.g. with actions/cache or download-artifact)"
86
+ required: false
87
+ default: ""
88
+ har:
89
+ description: "Record a HAR file per browser context without bodies into evidence/har next to the report (true/false)"
90
+ required: false
91
+ default: "false"
92
+ verify-url:
93
+ description: "Closed loop: if the target URL has findings, also scan this URL (e.g. the preview deployment of the fix PR); only a clean, complete scan there counts as 'fix verified'"
94
+ required: false
95
+ default: ""
96
+ verify-wait:
97
+ description: "Seconds to wait until verify-url is reachable (0-1800, default 0)"
98
+ required: false
99
+ default: ""
100
+ target-headers:
101
+ description: "Allowlist headers for your own site only, one 'Name: value' per line (e.g. WAF bypass or 'x-vercel-protection-bypass: ...'). Pass from secrets; sent only to the target/verify origin, never to third parties, never printed. Passed via the CPCG_TARGET_HEADERS environment variable."
102
+ required: false
103
+ default: ""
68
104
  banner-wait:
69
105
  description: "Seconds to wait for a late consent banner (1-60; default as in the CLI)"
70
106
  required: false
@@ -102,9 +138,9 @@ inputs:
102
138
  required: false
103
139
  default: ""
104
140
  jurisdiction:
105
- description: "Jurisdiction highlighted in the console and report: CH | EU | UK | US-CA | BR | ROW"
141
+ description: "Jurisdictions whose rules decide what blocks the gate, comma-separated: CH | EU | UK | US-CA | BR | ROW (strictest wins; default CH,EU as in the CLI)"
106
142
  required: false
107
- default: "CH"
143
+ default: "CH,EU"
108
144
 
109
145
  outputs:
110
146
  leaks-found:
@@ -120,7 +156,7 @@ outputs:
120
156
  description: "Absolute or relative path to the generated JSON report"
121
157
  value: ${{ steps.cpcg-run.outputs.report_path }}
122
158
  gate_state:
123
- description: "Gate result as written by the CLI (for example blocked, fix-proposed, inconclusive, passed). Empty if the installed CLI predates this output."
159
+ description: "Gate result as written by the CLI: clean, remediated (fix verified by re-scan), fix-proposed, blocked, inconclusive. Empty if the installed CLI predates this output."
124
160
  value: ${{ steps.cpcg-run.outputs.gate_state }}
125
161
  incomplete:
126
162
  description: "'true' if core scenarios could not be checked conclusively"
@@ -129,8 +165,11 @@ outputs:
129
165
  description: "Number of scenarios that could not be checked"
130
166
  value: ${{ steps.cpcg-run.outputs.uncheckable_count }}
131
167
  leak_requests:
132
- description: "Number of tracker requests observed before consent"
168
+ description: "Number of blocking tracker requests/cookies (before consent, after reject/revoke and the other blocking phases)"
133
169
  value: ${{ steps.cpcg-run.outputs.leak_requests }}
170
+ verified:
171
+ description: "true if a re-scan (verify-url or target URL after a local fix) was clean and complete, false if not, empty if no re-scan ran"
172
+ value: ${{ steps.cpcg-run.outputs.verified }}
134
173
  exit_code:
135
174
  description: "Exit code of the CLI (0 ok, 1 leaks, 2 license invalid or revoked, 3 error, 4 incomplete)"
136
175
  value: ${{ steps.cpcg-run.outputs.exit_code }}
@@ -139,9 +178,9 @@ runs:
139
178
  using: "composite"
140
179
  steps:
141
180
  - name: Setup Node.js
142
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
181
+ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
143
182
  with:
144
- node-version: "20"
183
+ node-version: "24"
145
184
 
146
185
  # Installationsschritt: bewusst ohne Secrets (Lizenz, Token, API-Key) in der Umgebung. Nur hier läuft npm.
147
186
  - name: Install Privacy Chaos Gate
@@ -149,7 +188,7 @@ runs:
149
188
  shell: bash
150
189
  env:
151
190
  ACTION_PATH: ${{ github.action_path }}
152
- CPCG_PINNED_VERSION: "0.2.2" # = package.json version; bei jedem Release mit anheben (tests/action-pin.test.ts prüft das)
191
+ CPCG_PINNED_VERSION: "0.3.0" # = package.json version; bei jedem Release mit anheben (tests/action-pin.test.ts prüft das)
153
192
  run: |
154
193
  set -euo pipefail
155
194
 
@@ -183,9 +222,11 @@ runs:
183
222
  CPCG_LLM_PROVIDER: ${{ inputs.llm-provider }}
184
223
  CPCG_LLM_MODEL: ${{ inputs.llm-model }}
185
224
  CPCG_LICENSE: ${{ inputs.license }}
225
+ CPCG_TARGET_HEADERS: ${{ inputs.target-headers }}
186
226
  GITHUB_TOKEN: ${{ inputs.github-token }}
187
227
  IN_STAGING_URL: ${{ inputs.staging-url }}
188
228
  IN_LLM_REMEDIATION: ${{ inputs.llm-remediation }}
229
+ IN_ALLOW_CUSTOM_BANNER_FIX: ${{ inputs.allow-custom-banner-fix }}
189
230
  IN_AUTO_FIX: ${{ inputs.auto-fix }}
190
231
  IN_FAIL_ON_LEAK: ${{ inputs.fail-on-leak }}
191
232
  IN_FAIL_ON_UNCHECKABLE: ${{ inputs.fail-on-uncheckable }}
@@ -197,6 +238,13 @@ runs:
197
238
  IN_BANNER_FRAME: ${{ inputs.banner-frame }}
198
239
  IN_MAX_SUBPAGES: ${{ inputs.max-subpages }}
199
240
  IN_BANNER_WAIT: ${{ inputs.banner-wait }}
241
+ IN_SITEMAP: ${{ inputs.sitemap }}
242
+ IN_DEEP_BUDGET: ${{ inputs.deep-budget }}
243
+ IN_DEEP_STATE: ${{ inputs.deep-state }}
244
+ IN_BASELINE: ${{ inputs.baseline-report }}
245
+ IN_HAR: ${{ inputs.har }}
246
+ IN_VERIFY_URL: ${{ inputs.verify-url }}
247
+ IN_VERIFY_WAIT: ${{ inputs.verify-wait }}
200
248
  IN_REPORT_OUTPUT: ${{ inputs.report-output }}
201
249
  IN_SOURCE_DIR: ${{ inputs.target-source-dir }}
202
250
  IN_GIT_COMMIT: ${{ inputs.git-commit }}
@@ -207,6 +255,13 @@ runs:
207
255
  run: |
208
256
  set -euo pipefail
209
257
 
258
+ # Freigabe-Header-Werte im Log maskieren (auch wenn sie nicht aus secrets stammen).
259
+ while IFS= read -r line; do
260
+ value="${line#*:}"
261
+ value="${value#"${value%%[![:space:]]*}"}"
262
+ if [ -n "$value" ] && [ "$value" != "$line" ]; then echo "::add-mask::$value"; fi
263
+ done <<< "${CPCG_TARGET_HEADERS:-}"
264
+
210
265
  RUNNER=(node "$CPCG_CLI")
211
266
 
212
267
  # Optionen immer als --name=wert: ein Wert, der mit "-" beginnt, wird so nie als eigene Option gelesen.
@@ -258,6 +313,7 @@ runs:
258
313
  }
259
314
  opt_bool fail-on-uncheckable "$IN_FAIL_ON_UNCHECKABLE"
260
315
  opt_bool llm-remediation "$IN_LLM_REMEDIATION"
316
+ opt_bool allow-custom-banner-fix "$IN_ALLOW_CUSTOM_BANNER_FIX"
261
317
  opt_bool strict "$IN_STRICT"
262
318
  opt_lines ignore "$IN_IGNORE"
263
319
  opt_lines accept-selector "$IN_ACCEPT_SELECTOR"
@@ -266,5 +322,12 @@ runs:
266
322
  opt_lines banner-frame "$IN_BANNER_FRAME"
267
323
  opt_lines max-subpages "$IN_MAX_SUBPAGES"
268
324
  opt_lines banner-wait "$IN_BANNER_WAIT"
325
+ opt_bool sitemap "${IN_SITEMAP:-false}"
326
+ opt_lines deep-budget "${IN_DEEP_BUDGET:-}"
327
+ opt_lines deep-state "${IN_DEEP_STATE:-}"
328
+ opt_lines baseline "${IN_BASELINE:-}"
329
+ opt_bool har "${IN_HAR:-false}"
330
+ opt_lines verify-url "${IN_VERIFY_URL:-}"
331
+ opt_lines verify-wait "${IN_VERIFY_WAIT:-}"
269
332
 
270
333
  "${RUNNER[@]}" "${ARGS[@]}"