You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 48c7757
Browse filesBrowse the repository at this point in the historyBrowse files
ci(pentest): encrypt artifacts, keep findings out of logs (#15740)
* ci(pentest): encrypt artifacts, keep findings out of logs
Artifacts and run logs of a public repo are readable by any
signed-in user, so the confidential report, raw scanner output and
target logs were effectively public. All are now age-encrypted to
PENTEST_AGE_KEY (run fails closed without it) and ZAP/nuclei stdout
goes into the encrypted archive.
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
Signed-off-by: moauto <54212639+mo-auto@users.noreply.github.com>
* docs: document pen-test artifact encryption
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
Signed-off-by: moauto <54212639+mo-auto@users.noreply.github.com>
* ci(pentest): harden sealing and report restore
- fail on invalid age identity; write archive only on success
- AIO startup output into encrypted target logs
- seal raw output and target logs in separate steps; skip empties
- per-backend download and staged decrypt; release fails on bad backend
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
Signed-off-by: moauto <54212639+mo-auto@users.noreply.github.com>
* docs: pen-test report download and age version
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
Signed-off-by: moauto <54212639+mo-auto@users.noreply.github.com>
* ci(pentest): check uploaded backends, strict recipients
- expected backends come from the run's uploaded artifacts
- failed download or missing archive counts as not restored
- reject non-bare entries in PENTEST_AGE_RECIPIENTS
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
Signed-off-by: moauto <54212639+mo-auto@users.noreply.github.com>
* docs: download pen-test report into fresh dir
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
Signed-off-by: moauto <54212639+mo-auto@users.noreply.github.com>
---------
Signed-off-by: moauto <54212639+mo-auto@users.noreply.github.com>
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
| Pen-test (DAST) |`scan-pentest.yml`| live endpoints | PDF/JSON/MD/SARIF | workflow artifact only — CONFIDENTIAL, not attached to the public release |
22
+
| Pen-test (DAST) |`scan-pentest.yml`| live endpoints | PDF/JSON/MD/SARIF |age-encrypted workflow artifact only — CONFIDENTIAL, not attached to the public release |
23
23
24
24
## CBOM
25
25
@@ -109,16 +109,20 @@ Flow:
109
109
assessment-coverage table (findings per dimension), a findings register (with a
110
110
Backend column), detailed write-ups with recommendations for medium+ findings,
111
111
and appendices for run metadata and the SBOM component inventory. All formats
112
-
are uploaded **only** as a workflow artifact (30-day retention) — the report is
113
-
CONFIDENTIAL and is never attached to the public release; GitHub Actions
114
-
artifacts restrict access to users with repository access. The PDF and a link to
115
-
the run are also posted to Zulip (`#bot_reporter`, topic `pen-test`) when
116
-
`ZULIP_API_KEY` is set.
112
+
are uploaded **only** as an age-encrypted workflow artifact
113
+
(`pentest-report.tar.gz.age`, 30-day retention) — the report is CONFIDENTIAL and
114
+
is never attached to the public release. Artifacts and run logs of a public repo
115
+
are readable by any signed-in GitHub user, so raw scanner output and target logs
116
+
are encrypted too, and scanner stdout goes to files inside them, not the log. The
117
+
PDF and a link to the run are also posted to Zulip (`#bot_reporter`, topic
118
+
`pen-test`) when `ZULIP_API_KEY` is set.
117
119
118
120
### Configuration
119
121
120
122
| Secret / Var | Required | Use |
121
123
|---|---|---|
124
+
|`PENTEST_AGE_KEY` (secret) |**required**| age identity; artifacts are encrypted to its public key. Without it the run fails before scanning |
125
+
|`PENTEST_AGE_RECIPIENTS` (var) | optional | extra age recipients, one per line; must be the same kind as the key (PQ or classic) |
122
126
|`PENTEST_AI_ENDPOINT` (secret) | optional | Messages API URL, e.g. `https://api.anthropic.com/v1/messages`; step skipped if unset |
123
127
|`PENTEST_AI_TOKEN` (secret) | optional | API key, sent as the `x-api-key` header |
124
128
|`PENTEST_AI_MODEL` (var) | optional | model id (default `claude-opus-5`) |
@@ -130,3 +134,21 @@ ingested context as a single user message with a system prompt instructing the
130
134
model to return `{ "findings": [...] }`, then parses `.content[0].text`. Set
131
135
`PENTEST_AI_MODEL` / `PENTEST_AI_API_VERSION` repository variables to override the
132
136
defaults.
137
+
138
+
To read a report, download it (`gh run download` unpacks the artifact ZIP; from
139
+
the browser, unzip it first) and decrypt it with age 1.3.0 or later:
140
+
141
+
```bash
142
+
mkdir "report-RUN_ID"&&cd"report-RUN_ID"&& \
143
+
gh run download RUN_ID -R JanssenProject/jans -n pentest-report && \
144
+
age -d -i ../key.txt pentest-report.tar.gz.age | tar xz
145
+
```
146
+
147
+
Create the key with `age-keygen -pq -o key.txt` (post-quantum hybrid, also age
148
+
1.3.0+; CI pins 1.3.2); store the whole file as `PENTEST_AGE_KEY` and keep a copy
149
+
with the security team. AIO startup output goes to `startup.log` inside the
150
+
encrypted `pentest-aio-logs-*` artifact, not the run log.
151
+
152
+
If a backend uploaded raw output that cannot be downloaded or decrypted, a
153
+
release run fails; a manual run warns and reports the remaining backend. A
154
+
backend with no scanner output uploads nothing and is not counted.
0 commit comments