@radicaltools/mcp 0.3.0 → 0.3.2
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.
- package/README.md +7 -5
- package/dist/{chunk-Z7THA3L5.js → chunk-KEIZXREX.js} +68 -35
- package/dist/{elkLayout-TAUBPPVN.js → elkLayout-MFJXDTJG.js} +1 -1
- package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
- package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
- package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
- package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
- package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
- package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
- package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
- package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
- package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
- package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
- package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
- package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
- package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
- package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
- package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
- package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
- package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
- package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
- package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
- package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
- package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
- package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
- package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
- package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
- package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
- package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
- package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
- package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
- package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
- package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
- package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
- package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
- package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
- package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
- package/dist/index.js +1893 -468
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "concern-supply-chain",
|
|
4
4
|
"category": "concern",
|
|
5
5
|
"name": "Software supply chain",
|
|
6
|
-
"description": "What goes into what we build and ship: vulnerable dependencies,
|
|
6
|
+
"description": "What goes into what we build and ship: vulnerable dependencies and their deadlines, what is pinned beyond the lockfile and where packages come from, build provenance (SLSA), SBOMs and base images.",
|
|
7
7
|
"tags": [
|
|
8
8
|
"security",
|
|
9
9
|
"supply-chain",
|
|
@@ -34,10 +34,22 @@
|
|
|
34
34
|
"title": "NIST SP 800-218, Secure Software Development Framework (SSDF) 1.1",
|
|
35
35
|
"url": "https://csrc.nist.gov/pubs/sp/800/218/final"
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
"title": "NIST SP 800-190, Application Container Security Guide",
|
|
39
|
+
"url": "https://csrc.nist.gov/pubs/sp/800/190/final"
|
|
40
|
+
},
|
|
37
41
|
{
|
|
38
42
|
"title": "OWASP Top 10 2021, A06 Vulnerable and Outdated Components",
|
|
39
43
|
"url": "https://owasp.org/Top10/A06_2021-Vulnerable_and_Outdated_Components/"
|
|
40
44
|
},
|
|
45
|
+
{
|
|
46
|
+
"title": "OWASP Docker Security Cheat Sheet",
|
|
47
|
+
"url": "https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"title": "CIS Docker Benchmark",
|
|
51
|
+
"url": "https://www.cisecurity.org/benchmark/docker"
|
|
52
|
+
},
|
|
41
53
|
{
|
|
42
54
|
"title": "CycloneDX specification",
|
|
43
55
|
"url": "https://cyclonedx.org/"
|
|
@@ -53,6 +65,10 @@
|
|
|
53
65
|
{
|
|
54
66
|
"title": "Sigstore",
|
|
55
67
|
"url": "https://www.sigstore.dev/"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"title": "zizmor: static analysis for GitHub Actions",
|
|
71
|
+
"url": "https://docs.zizmor.sh/"
|
|
56
72
|
}
|
|
57
73
|
],
|
|
58
74
|
"templateParams": [
|
|
@@ -60,42 +76,42 @@
|
|
|
60
76
|
"key": "SCA",
|
|
61
77
|
"title": "Vulnerable dependencies",
|
|
62
78
|
"label": "What happens to a change that brings in a known vulnerability?",
|
|
63
|
-
"hint": "Blocking stops new vulnerabilities at the door but can stall work on a finding nobody can fix yet; deadlines alone let the backlog grow.",
|
|
79
|
+
"hint": "Blocking stops new vulnerabilities at the door but can stall work on a finding nobody can fix yet; deadlines alone let the backlog grow. The deadlines for vulnerable dependencies are decided here, for every element.",
|
|
64
80
|
"defaultValue": "gate",
|
|
65
81
|
"options": [
|
|
66
82
|
{
|
|
67
83
|
"value": "gate",
|
|
68
|
-
"label": "
|
|
84
|
+
"label": "a blocked merge on high and critical findings with a fix",
|
|
69
85
|
"description": "A required check refuses a pull request that adds or upgrades to a dependency with a known high or critical vulnerability that has a fixed version; existing findings have deadlines. Pick it for anything internet-facing or holding personal or payment data."
|
|
70
86
|
},
|
|
71
87
|
{
|
|
72
88
|
"value": "sla",
|
|
73
|
-
"label": "
|
|
74
|
-
"description": "Findings are reported on the pull request and
|
|
89
|
+
"label": "a report on the pull request and a deadline to fix",
|
|
90
|
+
"description": "Findings are reported on the pull request and tracked as alerts but do not block; each severity has a deadline. Pick it for internal tools, or for a codebase with a large backlog you are working through before switching to blocking."
|
|
75
91
|
}
|
|
76
92
|
]
|
|
77
93
|
},
|
|
78
94
|
{
|
|
79
95
|
"key": "PINNING",
|
|
80
96
|
"title": "Pinning",
|
|
81
|
-
"label": "
|
|
82
|
-
"hint": "
|
|
97
|
+
"label": "What is pinned beyond the package manager?",
|
|
98
|
+
"hint": "The lockfile and how it is installed are decided in the Dependency hygiene pack. This is about the rest of the build: CI actions, base images, downloaded tools, and where packages come from.",
|
|
83
99
|
"defaultValue": "hash",
|
|
84
100
|
"options": [
|
|
85
|
-
{
|
|
86
|
-
"value": "lockfile",
|
|
87
|
-
"label": "lockfiles, installed exactly",
|
|
88
|
-
"description": "Every package manager has a committed lockfile and CI installs exactly it (npm ci, pip install --require-hashes, go mod verify). Pick it as the minimum for every project."
|
|
89
|
-
},
|
|
90
101
|
{
|
|
91
102
|
"value": "hash",
|
|
92
|
-
"label": "
|
|
93
|
-
"description": "
|
|
103
|
+
"label": "actions, images and downloads by digest",
|
|
104
|
+
"description": "CI actions pinned to full commit SHAs, base images to sha256 digests, downloaded tools to a checksum checked in the build; updates come as bot pull requests. Pick it for anything you ship to production; it is what OpenSSF Scorecard's Pinned-Dependencies checks."
|
|
94
105
|
},
|
|
95
106
|
{
|
|
96
107
|
"value": "proxy",
|
|
97
|
-
"label": "only from our
|
|
98
|
-
"description": "Builds fetch packages only through an internal proxy (Artifactory, Nexus, AWS CodeArtifact, Azure Artifacts) with no other egress, and
|
|
108
|
+
"label": "packages only from our registry proxy, held 7 days",
|
|
109
|
+
"description": "Builds fetch packages only through an internal proxy (Artifactory, Nexus, AWS CodeArtifact, Azure Artifacts) with no other egress, and a newly published release is served only after 7 days in public. Pick it in regulated environments or where malicious package releases are a demonstrated threat."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"value": "none",
|
|
113
|
+
"label": "nothing more than the lockfile",
|
|
114
|
+
"description": "Actions and images are referenced by tag, and packages come from the public registries; only the lockfile pins, as decided in the Dependency hygiene pack. Pick it for prototypes and internal tools that never ship to production, and record it so that the first production deploy supersedes it."
|
|
99
115
|
}
|
|
100
116
|
]
|
|
101
117
|
},
|
|
@@ -108,17 +124,17 @@
|
|
|
108
124
|
"options": [
|
|
109
125
|
{
|
|
110
126
|
"value": "l1",
|
|
111
|
-
"label": "SLSA Build L1
|
|
127
|
+
"label": "SLSA Build L1, provenance recorded",
|
|
112
128
|
"description": "The build records how each artifact was made (BuildKit provenance attestations), unsigned. Pick it as the first step for builds that are not yet on a hosted CI."
|
|
113
129
|
},
|
|
114
130
|
{
|
|
115
131
|
"value": "l2",
|
|
116
|
-
"label": "SLSA Build L2
|
|
132
|
+
"label": "SLSA Build L2, signed provenance from a hosted build",
|
|
117
133
|
"description": "Builds run only on hosted CI, which signs the provenance (GitHub artifact attestations, GitLab SLSA provenance, cosign keyless); the deployment verifies it. Pick it for production services; it is a few lines of CI configuration."
|
|
118
134
|
},
|
|
119
135
|
{
|
|
120
136
|
"value": "l3",
|
|
121
|
-
"label": "SLSA Build L3
|
|
137
|
+
"label": "SLSA Build L3, hardened and isolated builds",
|
|
122
138
|
"description": "Provenance is produced by an isolated job the build steps cannot influence (slsa-github-generator reusable workflows), and the cluster admits only images whose provenance verifies. Pick it for software others depend on, or where a tampered build would be catastrophic."
|
|
123
139
|
}
|
|
124
140
|
]
|
|
@@ -137,7 +153,7 @@
|
|
|
137
153
|
},
|
|
138
154
|
{
|
|
139
155
|
"value": "shipped",
|
|
140
|
-
"label": "shipping
|
|
156
|
+
"label": "shipping with each release",
|
|
141
157
|
"description": "Each release carries a signed SBOM (CycloneDX or SPDX) and VEX statements for known vulnerabilities that do not affect it. Pick it when customers, US federal buyers (EO 14028) or the EU Cyber Resilience Act require it."
|
|
142
158
|
}
|
|
143
159
|
]
|
|
@@ -180,7 +196,7 @@
|
|
|
180
196
|
},
|
|
181
197
|
{
|
|
182
198
|
"key": "REBUILD_DAYS",
|
|
183
|
-
"label": "Most days a running image may go without a rebuild",
|
|
199
|
+
"label": "Most days a running image may go without a rebuild. Only with official slim images",
|
|
184
200
|
"defaultValue": "7",
|
|
185
201
|
"type": "number"
|
|
186
202
|
}
|
|
@@ -216,7 +232,7 @@
|
|
|
216
232
|
"y": 130,
|
|
217
233
|
"ears_type": "unwanted-behaviour",
|
|
218
234
|
"unwanted_condition": "a pull request adds a dependency, or changes one to a version, with a known high or critical vulnerability that has a fixed version",
|
|
219
|
-
"action": "fail its required check so that it cannot merge until it uses a fixed version",
|
|
235
|
+
"action": "fail its required check so that it cannot merge until it uses a fixed version, while findings without a fix or below high only warn",
|
|
220
236
|
"rationale": "The cheapest vulnerability to fix is the one that never merges (NIST SSDF PW.4; OpenSSF Scorecard Vulnerabilities).",
|
|
221
237
|
"hubWhen": {
|
|
222
238
|
"SCA": [
|
|
@@ -232,8 +248,8 @@
|
|
|
232
248
|
"y": 260,
|
|
233
249
|
"ears_type": "event-driven",
|
|
234
250
|
"trigger": "a pull request changes a dependency manifest or lockfile",
|
|
235
|
-
"action": "comment on it with every known vulnerability the change adds or removes, with its severity and fixed version,
|
|
236
|
-
"rationale": "Without blocking, visibility at the moment of change and a tracked
|
|
251
|
+
"action": "comment on it with every known vulnerability the change adds or removes, with its severity and fixed version, without blocking, and keep every high or critical one that merges as an open Dependabot alert until it is fixed",
|
|
252
|
+
"rationale": "Without blocking, visibility at the moment of change and a tracked alert are what keep the deadline from being missed (NIST SSDF RV.1).",
|
|
237
253
|
"hubWhen": {
|
|
238
254
|
"SCA": [
|
|
239
255
|
"sla"
|
|
@@ -247,33 +263,17 @@
|
|
|
247
263
|
"x": 260,
|
|
248
264
|
"y": 390,
|
|
249
265
|
"ears_type": "ubiquitous",
|
|
250
|
-
"action": "build release artifacts only from the protected default branch or signed release tags, where every change is merged through a pull request approved by someone other than its author",
|
|
266
|
+
"action": "build release artifacts only from the protected default branch or signed release tags, where every change is merged through a pull request approved by someone other than its author with the required checks passed",
|
|
251
267
|
"rationale": "A build is only as trustworthy as the source it starts from; review and branch protection are the source half of the supply chain (OpenSSF Scorecard Branch-Protection, Code-Review; NIST SSDF PS.1)."
|
|
252
268
|
},
|
|
253
|
-
{
|
|
254
|
-
"id": "req-pin-lockfile",
|
|
255
|
-
"type": "requirement",
|
|
256
|
-
"label": "Lockfiles installed exactly",
|
|
257
|
-
"x": 260,
|
|
258
|
-
"y": 520,
|
|
259
|
-
"ears_type": "unwanted-behaviour",
|
|
260
|
-
"unwanted_condition": "a build would resolve a dependency to a version not recorded in the committed lockfile",
|
|
261
|
-
"action": "fail the build instead of updating the lockfile",
|
|
262
|
-
"rationale": "A lockfile only pins if the build refuses to drift from it; otherwise every build may fetch something new (NIST SSDF PS.3; OpenSSF Scorecard Pinned-Dependencies).",
|
|
263
|
-
"hubWhen": {
|
|
264
|
-
"PINNING": [
|
|
265
|
-
"lockfile"
|
|
266
|
-
]
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
269
|
{
|
|
270
270
|
"id": "req-pin-hash",
|
|
271
271
|
"type": "requirement",
|
|
272
|
-
"label": "
|
|
272
|
+
"label": "Actions, images and downloads pinned",
|
|
273
273
|
"x": 260,
|
|
274
|
-
"y":
|
|
274
|
+
"y": 520,
|
|
275
275
|
"ears_type": "ubiquitous",
|
|
276
|
-
"action": "pin every
|
|
276
|
+
"action": "pin every CI action to a full commit SHA, every base image to a sha256 digest and every file downloaded in a build to a checksum verified in the same step, and take updates to them only through bot pull requests that are reviewed like code",
|
|
277
277
|
"rationale": "A tag or version range can be moved by whoever controls it; a hash cannot (OpenSSF Scorecard Pinned-Dependencies; SLSA v1.0 threats, dependency threats).",
|
|
278
278
|
"hubWhen": {
|
|
279
279
|
"PINNING": [
|
|
@@ -286,9 +286,9 @@
|
|
|
286
286
|
"type": "requirement",
|
|
287
287
|
"label": "Packages only from our proxy",
|
|
288
288
|
"x": 260,
|
|
289
|
-
"y":
|
|
289
|
+
"y": 650,
|
|
290
290
|
"ears_type": "ubiquitous",
|
|
291
|
-
"action": "fetch every package and image only through our registry proxy, with no other network access
|
|
291
|
+
"action": "fetch every package and image only through our registry proxy, with no other network access from the build runner, and get a newly published release from the proxy only after it has been public for 7 days",
|
|
292
292
|
"rationale": "One controlled entry point can be audited and blocked; malicious releases are usually found and pulled within days of publication (NIST SSDF PW.4; SLSA v1.0 threats, dependency threats).",
|
|
293
293
|
"hubWhen": {
|
|
294
294
|
"PINNING": [
|
|
@@ -301,10 +301,10 @@
|
|
|
301
301
|
"type": "requirement",
|
|
302
302
|
"label": "Provenance recorded",
|
|
303
303
|
"x": 260,
|
|
304
|
-
"y":
|
|
304
|
+
"y": 780,
|
|
305
305
|
"ears_type": "event-driven",
|
|
306
306
|
"trigger": "a build produces a release artifact",
|
|
307
|
-
"action": "attach SLSA provenance to it that names the
|
|
307
|
+
"action": "attach SLSA provenance to it that names the builder and the commit it was built from",
|
|
308
308
|
"rationale": "Provenance is what makes an artifact traceable to the source and build that made it; at Build L1 it exists, which already catches mistakes (SLSA v1.0, Build L1).",
|
|
309
309
|
"hubWhen": {
|
|
310
310
|
"SLSA": [
|
|
@@ -317,9 +317,9 @@
|
|
|
317
317
|
"type": "requirement",
|
|
318
318
|
"label": "Unverified artifacts not deployed",
|
|
319
319
|
"x": 260,
|
|
320
|
-
"y":
|
|
320
|
+
"y": 910,
|
|
321
321
|
"ears_type": "unwanted-behaviour",
|
|
322
|
-
"unwanted_condition": "an artifact is about to be deployed without provenance signed by our hosted build platform for this repository and
|
|
322
|
+
"unwanted_condition": "an artifact is about to be deployed without provenance signed by our hosted build platform for this repository and its protected default branch",
|
|
323
323
|
"action": "refuse the deployment",
|
|
324
324
|
"rationale": "Signed provenance from a hosted builder cannot be forged by a developer's machine; verifying it at deployment is what makes it count (SLSA v1.0, Build L2).",
|
|
325
325
|
"hubWhen": {
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
"type": "requirement",
|
|
334
334
|
"label": "Only verified images admitted",
|
|
335
335
|
"x": 260,
|
|
336
|
-
"y":
|
|
336
|
+
"y": 1040,
|
|
337
337
|
"ears_type": "unwanted-behaviour",
|
|
338
338
|
"unwanted_condition": "the cluster is asked to run an image whose provenance was not produced by our isolated build workflow for this repository",
|
|
339
339
|
"action": "refuse to admit it, and keep the provenance signing in a job the build steps cannot reach",
|
|
@@ -349,10 +349,10 @@
|
|
|
349
349
|
"type": "requirement",
|
|
350
350
|
"label": "Exposure known within hours",
|
|
351
351
|
"x": 260,
|
|
352
|
-
"y":
|
|
352
|
+
"y": 1170,
|
|
353
353
|
"ears_type": "event-driven",
|
|
354
354
|
"trigger": "a new vulnerability advisory is published for a component",
|
|
355
|
-
"action": "list every deployed version of the element that contains it within 24 hours, from the CycloneDX SBOMs kept for each deployed version",
|
|
355
|
+
"action": "list every deployed version of the element that contains it within 24 hours, from the CycloneDX SBOMs kept for each deployed version, and fail a daily check while the version in production violates a blocking policy",
|
|
356
356
|
"rationale": "The first question after a widespread vulnerability is where it runs; an SBOM per deployed version answers it without rebuilding anything (NIST SSDF PS.3.2; CycloneDX).",
|
|
357
357
|
"hubWhen": {
|
|
358
358
|
"SBOM": [
|
|
@@ -365,7 +365,7 @@
|
|
|
365
365
|
"type": "requirement",
|
|
366
366
|
"label": "SBOM shipped with releases",
|
|
367
367
|
"x": 260,
|
|
368
|
-
"y":
|
|
368
|
+
"y": 1300,
|
|
369
369
|
"ears_type": "event-driven",
|
|
370
370
|
"trigger": "a version is released",
|
|
371
371
|
"action": "publish with it a signed SBOM in CycloneDX or SPDX listing every component, transitive ones included, with version, package URL and licence, and VEX statements for known vulnerabilities that do not affect it",
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
"type": "requirement",
|
|
382
382
|
"label": "No shell in images",
|
|
383
383
|
"x": 260,
|
|
384
|
-
"y":
|
|
384
|
+
"y": 1430,
|
|
385
385
|
"ears_type": "ubiquitous",
|
|
386
386
|
"action": "build the final stage of every image on a distroless or Chainguard base, with no shell or package manager, running as a non-root user",
|
|
387
387
|
"rationale": "Packages that are not there need no patching and cannot be used after a break-in; minimal images cut OS findings by an order of magnitude (NIST SP 800-190, 4.1; OWASP Docker Security Cheat Sheet).",
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
"type": "requirement",
|
|
397
397
|
"label": "Images rebuilt on schedule",
|
|
398
398
|
"x": 260,
|
|
399
|
-
"y":
|
|
399
|
+
"y": 1560,
|
|
400
400
|
"ears_type": "state-driven",
|
|
401
401
|
"precondition": "an image running in production was built more than {{REBUILD_DAYS}} days ago",
|
|
402
402
|
"action": "rebuild it on the current official slim base and redeploy it, failing the rebuild on fixable high or critical OS vulnerabilities",
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
"type": "requirement",
|
|
413
413
|
"label": "Only golden base images",
|
|
414
414
|
"x": 260,
|
|
415
|
-
"y":
|
|
415
|
+
"y": 1690,
|
|
416
416
|
"ears_type": "unwanted-behaviour",
|
|
417
417
|
"unwanted_condition": "an image is built from, or the cluster is asked to run an image from, anything other than the internal registry's golden images",
|
|
418
418
|
"action": "fail the build or refuse the pod",
|
|
@@ -439,9 +439,9 @@
|
|
|
439
439
|
"label": "Vulnerable upgrade blocked",
|
|
440
440
|
"x": 520,
|
|
441
441
|
"y": 130,
|
|
442
|
-
"given": "a pull request that pins a library to a version with a critical advisory and a fixed version available",
|
|
443
|
-
"when": "
|
|
444
|
-
"then": "the dependency check fails and the
|
|
442
|
+
"given": "a pull request that pins a library to a version with a critical advisory and a fixed version available, and another with a low advisory",
|
|
443
|
+
"when": "their checks run",
|
|
444
|
+
"then": "the first pull request's dependency check fails and it cannot merge; the second passes with a warning",
|
|
445
445
|
"hubWhen": {
|
|
446
446
|
"SCA": [
|
|
447
447
|
"gate"
|
|
@@ -456,7 +456,7 @@
|
|
|
456
456
|
"y": 260,
|
|
457
457
|
"given": "a pull request that adds a dependency with a high advisory",
|
|
458
458
|
"when": "it merges",
|
|
459
|
-
"then": "it carried a comment naming the advisory, and an
|
|
459
|
+
"then": "it carried a comment naming the advisory, and an open alert with the {{HIGH_DAYS}}-day deadline counts from its creation",
|
|
460
460
|
"hubWhen": {
|
|
461
461
|
"SCA": [
|
|
462
462
|
"sla"
|
|
@@ -473,27 +473,12 @@
|
|
|
473
473
|
"when": "they push a commit directly to the default branch, and open a pull request they approve themselves",
|
|
474
474
|
"then": "the push is refused and the pull request cannot merge without a second person's approval"
|
|
475
475
|
},
|
|
476
|
-
{
|
|
477
|
-
"id": "sc-pin-lockfile",
|
|
478
|
-
"type": "scenario",
|
|
479
|
-
"label": "Drifted lockfile fails",
|
|
480
|
-
"x": 520,
|
|
481
|
-
"y": 520,
|
|
482
|
-
"given": "a manifest changed without updating the lockfile",
|
|
483
|
-
"when": "CI installs dependencies",
|
|
484
|
-
"then": "the install fails and names the package",
|
|
485
|
-
"hubWhen": {
|
|
486
|
-
"PINNING": [
|
|
487
|
-
"lockfile"
|
|
488
|
-
]
|
|
489
|
-
}
|
|
490
|
-
},
|
|
491
476
|
{
|
|
492
477
|
"id": "sc-pin-hash",
|
|
493
478
|
"type": "scenario",
|
|
494
479
|
"label": "Unpinned action refused",
|
|
495
480
|
"x": 520,
|
|
496
|
-
"y":
|
|
481
|
+
"y": 520,
|
|
497
482
|
"given": "a pull request that adds a CI step using an action by its tag, and a Dockerfile FROM by tag",
|
|
498
483
|
"when": "its checks run",
|
|
499
484
|
"then": "the pinning check fails naming both",
|
|
@@ -508,7 +493,7 @@
|
|
|
508
493
|
"type": "scenario",
|
|
509
494
|
"label": "Fresh release held back",
|
|
510
495
|
"x": 520,
|
|
511
|
-
"y":
|
|
496
|
+
"y": 650,
|
|
512
497
|
"given": "a package version published 2 days ago",
|
|
513
498
|
"when": "a build asks for it",
|
|
514
499
|
"then": "the proxy does not serve it and the build fails, and the same build with a 10-day-old version succeeds",
|
|
@@ -523,10 +508,10 @@
|
|
|
523
508
|
"type": "scenario",
|
|
524
509
|
"label": "Image carries provenance",
|
|
525
510
|
"x": 520,
|
|
526
|
-
"y":
|
|
511
|
+
"y": 780,
|
|
527
512
|
"given": "an image built by the release pipeline",
|
|
528
513
|
"when": "its attestations are inspected",
|
|
529
|
-
"then": "they hold SLSA provenance naming the
|
|
514
|
+
"then": "they hold SLSA provenance naming the builder and the commit",
|
|
530
515
|
"hubWhen": {
|
|
531
516
|
"SLSA": [
|
|
532
517
|
"l1"
|
|
@@ -538,7 +523,7 @@
|
|
|
538
523
|
"type": "scenario",
|
|
539
524
|
"label": "Laptop build refused",
|
|
540
525
|
"x": 520,
|
|
541
|
-
"y":
|
|
526
|
+
"y": 910,
|
|
542
527
|
"given": "an image built and pushed from a developer's machine with the same tag",
|
|
543
528
|
"when": "the pipeline tries to deploy it",
|
|
544
529
|
"then": "verification fails and the deployment stops",
|
|
@@ -553,7 +538,7 @@
|
|
|
553
538
|
"type": "scenario",
|
|
554
539
|
"label": "Unverified image refused",
|
|
555
540
|
"x": 520,
|
|
556
|
-
"y":
|
|
541
|
+
"y": 1040,
|
|
557
542
|
"given": "a cluster with admission control",
|
|
558
543
|
"when": "a pod is created from an image built outside the isolated workflow",
|
|
559
544
|
"then": "the cluster refuses the pod and names the failed verification",
|
|
@@ -568,10 +553,10 @@
|
|
|
568
553
|
"type": "scenario",
|
|
569
554
|
"label": "Affected versions listed",
|
|
570
555
|
"x": 520,
|
|
571
|
-
"y":
|
|
556
|
+
"y": 1170,
|
|
572
557
|
"given": "SBOMs of the three versions deployed in production and staging",
|
|
573
558
|
"when": "an advisory is published for a component in two of them",
|
|
574
|
-
"then": "within 24 hours the two versions and their environments are listed",
|
|
559
|
+
"then": "within 24 hours the two versions and their environments are listed, and the daily check fails for the one in production",
|
|
575
560
|
"hubWhen": {
|
|
576
561
|
"SBOM": [
|
|
577
562
|
"internal"
|
|
@@ -583,10 +568,10 @@
|
|
|
583
568
|
"type": "scenario",
|
|
584
569
|
"label": "Release carries SBOM",
|
|
585
570
|
"x": 520,
|
|
586
|
-
"y":
|
|
571
|
+
"y": 1300,
|
|
587
572
|
"given": "a release",
|
|
588
573
|
"when": "its assets are listed and the SBOM is validated against its schema",
|
|
589
|
-
"then": "a signed SBOM and VEX are attached, valid, and every component has a version and package URL",
|
|
574
|
+
"then": "a signed SBOM, its signature bundle and VEX are attached, valid, and every component has a version and package URL",
|
|
590
575
|
"hubWhen": {
|
|
591
576
|
"SBOM": [
|
|
592
577
|
"shipped"
|
|
@@ -598,7 +583,7 @@
|
|
|
598
583
|
"type": "scenario",
|
|
599
584
|
"label": "No shell to run",
|
|
600
585
|
"x": 520,
|
|
601
|
-
"y":
|
|
586
|
+
"y": 1430,
|
|
602
587
|
"given": "a released image",
|
|
603
588
|
"when": "someone tries to run /bin/sh in a container from it",
|
|
604
589
|
"then": "there is no shell, and the process runs as a non-root user",
|
|
@@ -613,7 +598,7 @@
|
|
|
613
598
|
"type": "scenario",
|
|
614
599
|
"label": "Stale image rebuilt",
|
|
615
600
|
"x": 520,
|
|
616
|
-
"y":
|
|
601
|
+
"y": 1560,
|
|
617
602
|
"given": "a production image built {{REBUILD_DAYS}} days ago",
|
|
618
603
|
"when": "the scheduled rebuild runs",
|
|
619
604
|
"then": "a new image on the current base is deployed and the scan shows no fixable high or critical OS finding",
|
|
@@ -628,7 +613,7 @@
|
|
|
628
613
|
"type": "scenario",
|
|
629
614
|
"label": "Public base refused",
|
|
630
615
|
"x": 520,
|
|
631
|
-
"y":
|
|
616
|
+
"y": 1690,
|
|
632
617
|
"given": "a Dockerfile starting FROM a public Docker Hub image",
|
|
633
618
|
"when": "it is built, and an image from Docker Hub is deployed directly",
|
|
634
619
|
"then": "the build fails and the cluster refuses the pod",
|
|
@@ -647,8 +632,8 @@
|
|
|
647
632
|
"concern": "supply-chain",
|
|
648
633
|
"status": "accepted",
|
|
649
634
|
"date": "",
|
|
650
|
-
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it.",
|
|
651
|
-
"decision": "Every pull request is checked for known vulnerabilities in the dependencies it adds or changes, and a high or critical one with a fixed version blocks the merge;
|
|
635
|
+
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it. The lockfile, how it is installed and how updates arrive are decided in the Dependency hygiene pack. The snippets of this pack assume a GitHub repository our-org/shop building the image ghcr.io/our-org/shop/order-api with a Dockerfile at the root; rename them for yours, and pin the actions they use by commit SHA in your repository.",
|
|
636
|
+
"decision": "Every pull request is checked for known vulnerabilities in the dependencies it adds or changes, and a high or critical one with a fixed version blocks the merge; findings without a fix or below high warn. Existing findings, in every element, are fixed within {{CRITICAL_DAYS}} days (critical) and {{HIGH_DAYS}} days (high) of disclosure, or get a reviewed not-affected statement. Beyond the lockfile decided in the Dependency hygiene pack, what is pinned: {{PINNING}}; update pull requests arrive as decided there. Tools: GitHub dependency review and OSV-Scanner for the gate (free, OSV and GitHub Advisory data), Snyk or Mend when you also need reachability analysis and licence policy; judge by the ecosystems you use, the advisory database, and whether it can tell reachable from unreachable code.",
|
|
652
637
|
"consequences": "• New known vulnerabilities do not reach the main branch.\n• A finding with no fixed version does not block, but gets a deadline and, if unaffected, a reviewed statement.\n• Update pull requests become routine work: merge them weekly, grouped, with tests that make it safe.",
|
|
653
638
|
"alternatives": "1. Report and deadlines only: no blocked work, but the backlog grows.\n2. Scan only before release: findings arrive late, in bulk.\n3. Vendoring all dependencies: full control, all the patching is ours.",
|
|
654
639
|
"hubWhen": {
|
|
@@ -666,8 +651,8 @@
|
|
|
666
651
|
"concern": "supply-chain",
|
|
667
652
|
"status": "accepted",
|
|
668
653
|
"date": "",
|
|
669
|
-
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it.",
|
|
670
|
-
"decision": "Known vulnerabilities in dependencies are reported on every pull request and
|
|
654
|
+
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it. The lockfile, how it is installed and how updates arrive are decided in the Dependency hygiene pack. The snippets of this pack assume a GitHub repository our-org/shop building the image ghcr.io/our-org/shop/order-api with a Dockerfile at the root; rename them for yours, and pin the actions they use by commit SHA in your repository.",
|
|
655
|
+
"decision": "Known vulnerabilities in dependencies are reported on every pull request and tracked as Dependabot alerts and do not block merging; each must be fixed, in every element, within {{CRITICAL_DAYS}} days (critical) and {{HIGH_DAYS}} days (high) of disclosure, or get a reviewed not-affected statement. Beyond the lockfile decided in the Dependency hygiene pack, what is pinned: {{PINNING}}; update pull requests arrive as decided there. Tools: GitHub dependency review for the comment, Dependabot alerts for the tracking, OWASP Dependency-Track for the dashboard. Revisit this decision, towards blocking, once no high or critical finding is past its deadline.",
|
|
671
656
|
"consequences": "• No work blocked by findings nobody can fix yet.\n• Vulnerable versions can merge and ship until fixed; the deadlines carry the risk.\n• Needs someone to watch the deadlines, or the dashboard turns into wallpaper.",
|
|
672
657
|
"alternatives": "1. Block the merge on high and critical findings: stops new ones at the door.\n2. Scan only before release: late and in bulk.",
|
|
673
658
|
"hubWhen": {
|
|
@@ -685,7 +670,7 @@
|
|
|
685
670
|
"concern": "supply-chain",
|
|
686
671
|
"status": "accepted",
|
|
687
672
|
"date": "",
|
|
688
|
-
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it.",
|
|
673
|
+
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it. The lockfile, how it is installed and how updates arrive are decided in the Dependency hygiene pack. The snippets of this pack assume a GitHub repository our-org/shop building the image ghcr.io/our-org/shop/order-api with a Dockerfile at the root; rename them for yours, and pin the actions they use by commit SHA in your repository.",
|
|
689
674
|
"decision": "Release builds run from a scripted pipeline and attach SLSA provenance to each artifact (Docker BuildKit with --provenance=mode=max, or the CI's provenance generator); unsigned for now. Changes reach the default branch only through reviewed pull requests. SBOM: {{SBOM}}. Base images: {{BASE}}. Moving to signed provenance on hosted CI (Build L2) is the next step, and supersedes this decision.",
|
|
690
675
|
"consequences": "• Each artifact says which commit and build made it, which catches mistakes and speeds investigations.\n• Unsigned provenance can be forged by anyone who can push an image: it is not a security control yet.\n• Little cost: a flag on the build.",
|
|
691
676
|
"alternatives": "1. Signed provenance from hosted CI (Build L2): a few lines more, and verifiable.\n2. No provenance: nothing to trace an artifact by.",
|
|
@@ -704,8 +689,8 @@
|
|
|
704
689
|
"concern": "supply-chain",
|
|
705
690
|
"status": "accepted",
|
|
706
691
|
"date": "",
|
|
707
|
-
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it.",
|
|
708
|
-
"decision": "Release artifacts are built only on hosted CI, which signs their SLSA provenance (GitHub artifact attestations with actions/attest-build-provenance, GitLab's SLSA provenance, or cosign keyless signing with Sigstore); the deployment pipeline verifies the provenance names this repository and
|
|
692
|
+
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it. The lockfile, how it is installed and how updates arrive are decided in the Dependency hygiene pack. The snippets of this pack assume a GitHub repository our-org/shop building the image ghcr.io/our-org/shop/order-api with a Dockerfile at the root; rename them for yours, and pin the actions they use by commit SHA in your repository.",
|
|
693
|
+
"decision": "Release artifacts are built only on hosted CI, which signs their SLSA provenance (GitHub artifact attestations with actions/attest-build-provenance, GitLab's SLSA provenance, or cosign keyless signing with Sigstore); the deployment pipeline verifies that the provenance names this repository and its protected default branch, and stops otherwise. Changes reach the default branch only through reviewed pull requests. SBOM: {{SBOM}}. Base images: {{BASE}}. Choose by the CI in use; Sigstore keyless signing works across CIs and needs no keys to keep.",
|
|
709
694
|
"consequences": "• An artifact built on a laptop or a fork cannot be deployed.\n• Depends on the hosted CI's signing and on the transparency log being reachable at verification time.\n• Build steps can still influence their own provenance; that is what Build L3 adds.",
|
|
710
695
|
"alternatives": "1. Build L3 with isolated provenance generation and admission control: stronger, more to set up.\n2. Build L1, unsigned provenance: traceable, not verifiable.\n3. Signing with long-lived keys: works offline, but the key becomes a secret to protect and rotate.",
|
|
711
696
|
"hubWhen": {
|
|
@@ -723,7 +708,7 @@
|
|
|
723
708
|
"concern": "supply-chain",
|
|
724
709
|
"status": "accepted",
|
|
725
710
|
"date": "",
|
|
726
|
-
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it.",
|
|
711
|
+
"context": "This element is built by us from source code, open-source dependencies and a base image, and shipped as an artifact. The forces: most of what runs is code we did not write, and known vulnerabilities in it are exploited within days of disclosure; a dependency resolved fresh on every build can change under us, through a compromised maintainer, a typosquatted name or a malicious release; a build that anyone with CI access can alter, or whose output nobody can trace to a commit, ships whatever an attacker puts in it; base images carry hundreds of operating-system packages we never use; and when the next widespread vulnerability is announced, the first question is which of our running versions contain it. The lockfile, how it is installed and how updates arrive are decided in the Dependency hygiene pack. The snippets of this pack assume a GitHub repository our-org/shop building the image ghcr.io/our-org/shop/order-api with a Dockerfile at the root; rename them for yours, and pin the actions they use by commit SHA in your repository.",
|
|
727
712
|
"decision": "Release artifacts are built by isolated, ephemeral jobs whose provenance is generated and signed outside the build steps (slsa-framework/slsa-github-generator reusable workflows, or Tekton Chains), and the cluster admits only images whose provenance verifies for this repository (Sigstore policy-controller or Kyverno verifyImages). Changes reach the default branch only through reviewed pull requests. SBOM: {{SBOM}}. Base images: {{BASE}}.",
|
|
728
713
|
"consequences": "• Neither a developer nor a compromised build step can produce an artifact the cluster will run.\n• Admission control is on the path of every deployment: its outage blocks deploys, so it fails closed with a documented break-glass.\n• Builds take longer and must fit the generator's workflow.",
|
|
729
714
|
"alternatives": "1. Build L2 with verification in the pipeline: simpler, but a direct deploy bypasses it.\n2. Reproducible builds checked by a second builder: the strongest, and rarely practical yet.",
|
|
@@ -739,9 +724,12 @@
|
|
|
739
724
|
"label": "OpenSSF Scorecard",
|
|
740
725
|
"x": 1040,
|
|
741
726
|
"y": 0,
|
|
742
|
-
"
|
|
743
|
-
"
|
|
744
|
-
"
|
|
727
|
+
"characteristic": "security",
|
|
728
|
+
"scope": "atomic",
|
|
729
|
+
"cadence": "triggered",
|
|
730
|
+
"trigger": "weekly",
|
|
731
|
+
"invocation": "automated",
|
|
732
|
+
"description": "OpenSSF Scorecard runs weekly and on every push to the default branch; a step fails the job when an enforced check scores below its threshold. Branch-Protection scores 8 with one required approving reviewer, which is what the review requirement asks; 9 and 10 need two reviewers and code-owner review.\n\nThreshold: Code-Review, Dangerous-Workflow and Token-Permissions each score 10 and Branch-Protection at least 8 (one required reviewer, no force pushes, a required status check); overall score at least 7.0\n\nTool: OpenSSF Scorecard (ossf/scorecard-action)\n\n```yaml\n# .github/workflows/scorecard.yml\nname: scorecard\non:\n push: { branches: [main] }\n schedule: [{ cron: '0 6 * * 1' }]\npermissions: read-all\njobs:\n scorecard:\n runs-on: ubuntu-latest\n permissions: { id-token: write, security-events: write }\n steps:\n - uses: actions/checkout@v4.2.2 # pin by commit SHA in your repository\n with: { persist-credentials: false }\n - uses: ossf/scorecard-action@v2.4.2 # pin by commit SHA in your repository\n with: { results_file: results.json, results_format: json, publish_results: true }\n - run: |\n jq -e '.score >= 7\n and ([.checks[] | select(.name | IN(\"Code-Review\",\"Dangerous-Workflow\",\"Token-Permissions\")) | select(.score < 10)] | length == 0)\n and ([.checks[] | select(.name == \"Branch-Protection\") | select(.score < 8)] | length == 0)' results.json\n```"
|
|
745
733
|
},
|
|
746
734
|
{
|
|
747
735
|
"id": "ff-vuln-gate",
|
|
@@ -749,9 +737,12 @@
|
|
|
749
737
|
"label": "Vulnerable dependency check",
|
|
750
738
|
"x": 1040,
|
|
751
739
|
"y": 130,
|
|
752
|
-
"
|
|
753
|
-
"
|
|
754
|
-
"
|
|
740
|
+
"characteristic": "security",
|
|
741
|
+
"scope": "atomic",
|
|
742
|
+
"cadence": "triggered",
|
|
743
|
+
"trigger": "pull-request",
|
|
744
|
+
"invocation": "automated",
|
|
745
|
+
"description": "GitHub's dependency review action compares the pull request's dependencies with the base branch and fails on a newly added high or critical advisory; OSV-Scanner covers lockfiles the dependency graph does not, and its JSON output is filtered so that only high or critical findings that have a fixed version fail the step (OSV-Scanner itself exits 1 on any finding).\n\nThreshold: 0 high or critical vulnerabilities with a fixed version added by a pull request; the check is required for merging; lower findings and findings without a fix warn\n\nTool: GitHub dependency-review-action and OSV-Scanner with jq\n\n```yaml\n# .github/workflows/dependencies.yml\nname: dependencies\non: [pull_request]\npermissions: { contents: read, pull-requests: write }\njobs:\n review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4.2.2 # pin by commit SHA in your repository\n - uses: actions/dependency-review-action@v4.7.1 # pin by commit SHA in your repository\n with:\n fail-on-severity: high\n comment-summary-in-pr: on-failure\n - uses: actions/setup-go@v5.5.0 # pin by commit SHA in your repository\n with: { go-version: '1.24' }\n - name: OSV-Scanner over every lockfile, failing only on high or critical findings with a fix\n run: |\n go install github.com/google/osv-scanner/v2/cmd/osv-scanner@v2.0.2\n osv-scanner scan source --recursive --format json . > osv.json || true # exits 1 on any finding; the filter below decides\n jq -e '[.results[]?.packages[]?.vulnerabilities[]?\n | select((.database_specific.severity // \"\" | ascii_upcase) | IN(\"HIGH\", \"CRITICAL\"))\n | select([.affected[]?.ranges[]?.events[]?.fixed // empty] | length > 0)\n | .id] | unique\n | if length > 0 then (\"blocking: \" + join(\", \") | halt_error(1)) else true end' osv.json\n```",
|
|
755
746
|
"hubWhen": {
|
|
756
747
|
"SCA": [
|
|
757
748
|
"gate"
|
|
@@ -759,40 +750,48 @@
|
|
|
759
750
|
}
|
|
760
751
|
},
|
|
761
752
|
{
|
|
762
|
-
"id": "ff-vuln-
|
|
753
|
+
"id": "ff-vuln-report",
|
|
763
754
|
"type": "fitness-fn",
|
|
764
|
-
"label": "
|
|
755
|
+
"label": "Findings commented, alerts tracked",
|
|
765
756
|
"x": 1040,
|
|
766
757
|
"y": 260,
|
|
767
|
-
"
|
|
768
|
-
"
|
|
769
|
-
"
|
|
758
|
+
"characteristic": "security",
|
|
759
|
+
"scope": "atomic",
|
|
760
|
+
"cadence": "triggered",
|
|
761
|
+
"trigger": "pull-request",
|
|
762
|
+
"invocation": "automated",
|
|
763
|
+
"description": "GitHub's dependency review action runs in warn-only mode and always comments its summary on the pull request, so the finding is visible where the change is made; a step checks that Dependabot alerts are enabled, since they are the tracked record the deadline job reads.\n\nThreshold: Every pull request that changes dependencies gets a dependency review comment and no failed check from it; Dependabot alerts are enabled on the repository\n\nTool: GitHub dependency-review-action (warn-only) and the GitHub CLI\n\n```yaml\n# .github/workflows/dependencies.yml\nname: dependencies\non: [pull_request]\npermissions: { contents: read, pull-requests: write }\njobs:\n review:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4.2.2 # pin by commit SHA in your repository\n - uses: actions/dependency-review-action@v4.7.1 # pin by commit SHA in your repository\n with:\n warn-only: true\n comment-summary-in-pr: always\n - name: Dependabot alerts are on (the tracked record of each finding)\n env:\n GH_TOKEN: ${{ github.token }}\n run: gh api \"repos/${{ github.repository }}/vulnerability-alerts\" --silent # 204 when enabled, 404 otherwise\n```",
|
|
764
|
+
"hubWhen": {
|
|
765
|
+
"SCA": [
|
|
766
|
+
"sla"
|
|
767
|
+
]
|
|
768
|
+
}
|
|
770
769
|
},
|
|
771
770
|
{
|
|
772
|
-
"id": "ff-
|
|
771
|
+
"id": "ff-vuln-age",
|
|
773
772
|
"type": "fitness-fn",
|
|
774
|
-
"label": "
|
|
773
|
+
"label": "No finding past its deadline",
|
|
775
774
|
"x": 1040,
|
|
776
775
|
"y": 390,
|
|
777
|
-
"
|
|
778
|
-
"
|
|
779
|
-
"
|
|
780
|
-
"
|
|
781
|
-
|
|
782
|
-
"
|
|
783
|
-
"proxy"
|
|
784
|
-
]
|
|
785
|
-
}
|
|
776
|
+
"characteristic": "security",
|
|
777
|
+
"scope": "atomic",
|
|
778
|
+
"cadence": "triggered",
|
|
779
|
+
"trigger": "nightly",
|
|
780
|
+
"invocation": "automated",
|
|
781
|
+
"description": "A daily job reads the repository's open Dependabot alerts and fails on any past its deadline, naming the package and the advisory. A reviewed not-affected statement dismisses the alert with a reason, which takes it out of the open set.\n\nThreshold: 0 open critical alerts older than {{CRITICAL_DAYS}} days and 0 open high alerts older than {{HIGH_DAYS}} days\n\nTool: GitHub Dependabot alerts API through the GitHub CLI\n\n```bash\ngh api --paginate \"/repos/$REPO/dependabot/alerts?state=open&per_page=100\" | jq -e \\\n --argjson crit {{CRITICAL_DAYS}} --argjson high {{HIGH_DAYS}} '\n [.[] | {sev: .security_advisory.severity, age: ((now - (.created_at | fromdateiso8601)) / 86400),\n pkg: .dependency.package.name, ghsa: .security_advisory.ghsa_id}\n | select((.sev == \"critical\" and .age > $crit) or (.sev == \"high\" and .age > $high))]\n | if length > 0 then (map(\"\\(.pkg) \\(.ghsa) \\(.sev)\") | join(\"\\n\") | halt_error(1)) else true end'\n```"
|
|
786
782
|
},
|
|
787
783
|
{
|
|
788
784
|
"id": "ff-pin-hash",
|
|
789
785
|
"type": "fitness-fn",
|
|
790
|
-
"label": "Actions and
|
|
786
|
+
"label": "Actions, images and downloads pinned",
|
|
791
787
|
"x": 1040,
|
|
792
788
|
"y": 520,
|
|
793
|
-
"
|
|
794
|
-
"
|
|
795
|
-
"
|
|
789
|
+
"characteristic": "security",
|
|
790
|
+
"scope": "atomic",
|
|
791
|
+
"cadence": "triggered",
|
|
792
|
+
"trigger": "pull-request",
|
|
793
|
+
"invocation": "automated",
|
|
794
|
+
"description": "zizmor audits the workflows and fails on an action used by tag or branch; a Conftest policy over the Dockerfiles fails on a FROM without a digest, resolving stage aliases so that FROM build is not flagged, and on a download that is not checked against a checksum in the same step. Both run on every pull request.\n\nThreshold: 0 workflow actions not pinned to a full commit SHA; 0 FROM lines (stage aliases and scratch aside) without a sha256 digest; 0 RUN lines that download with curl or wget without a sha256sum check\n\nTool: zizmor (unpinned-uses, hash-pin policy) and Conftest (Dockerfile parser)\n\n```rego\n# Workflows: zizmor --config zizmor.yml .github/workflows with zizmor.yml:\n# rules: { unpinned-uses: { config: { policies: { \"*\": hash-pin } } } }\n# Dockerfiles: conftest test --parser dockerfile -p policy/pinning.rego Dockerfile*\npackage main\n\nimport rego.v1\n\n# conftest's dockerfile parser gives one array of commands per file; this reads either shape\ncommands contains c if {\n some c in input\n is_object(c)\n}\n\ncommands contains c if {\n some stage in input\n is_array(stage)\n some c in stage\n}\n\nfroms contains f if {\n some f in commands\n f.Cmd == \"from\"\n}\n\naliases contains lower(f.Value[2]) if {\n some f in froms\n count(f.Value) == 3\n lower(f.Value[1]) == \"as\"\n}\n\ndeny contains msg if {\n some f in froms\n image := f.Value[0]\n image != \"scratch\"\n not lower(image) in aliases\n not regex.match(`@sha256:[0-9a-f]{64}$`, image)\n msg := sprintf(\"FROM %s is not pinned by digest\", [image])\n}\n\ndeny contains msg if {\n some c in commands\n c.Cmd == \"run\"\n line := concat(\" \", c.Value)\n regex.match(`\\b(curl|wget)\\b`, line)\n not contains(line, \"sha256sum\")\n msg := sprintf(\"RUN downloads without a sha256sum check: %s\", [line])\n}\n```",
|
|
796
795
|
"hubWhen": {
|
|
797
796
|
"PINNING": [
|
|
798
797
|
"hash"
|
|
@@ -805,9 +804,30 @@
|
|
|
805
804
|
"label": "Packages only from the proxy",
|
|
806
805
|
"x": 1040,
|
|
807
806
|
"y": 650,
|
|
808
|
-
"
|
|
809
|
-
"
|
|
810
|
-
"
|
|
807
|
+
"characteristic": "security",
|
|
808
|
+
"scope": "atomic",
|
|
809
|
+
"cadence": "triggered",
|
|
810
|
+
"trigger": "pull-request",
|
|
811
|
+
"invocation": "automated",
|
|
812
|
+
"description": "A step in the build job fails when any npm package was resolved from a public registry, when a Python requirements file names a public index, or when the Go proxy is not the internal one, which would mean the proxy was bypassed; a last line fails when the runner can reach the public npm registry at all.\n\nThreshold: 0 lockfile entries resolved from anywhere but the internal registry (npm, pip, Go); the build runner cannot reach a public registry\n\nTool: jq, grep and curl in the build job\n\n```bash\nPROXY=\"https://artifacts.example.internal\"\n# npm: every resolved URL comes from the proxy\njq -r --arg reg \"$PROXY/api/npm/npm-remote/\" '.packages | to_entries[]\n | select(.value.resolved != null and (.value.resolved | startswith($reg) | not))\n | \"\\(.key) from \\(.value.resolved)\"' package-lock.json > outside.txt\ntest ! -s outside.txt || { cat outside.txt; exit 1; }\n# pip: the proxy is the only index\nif ls requirements*.txt >/dev/null 2>&1; then\n grep -q \"^--index-url $PROXY/api/pypi/pypi-remote/simple\" requirements.txt || { echo \"requirements.txt does not name the proxy as its index\"; exit 1; }\n ! grep -lE 'https?://(pypi\\.org|files\\.pythonhosted\\.org)' requirements*.txt || exit 1\nfi\n# Go: the module proxy is ours\n[ -z \"$(ls go.mod 2>/dev/null)\" ] || [ \"$(go env GOPROXY)\" = \"$PROXY/api/go/go-remote\" ] || { echo \"GOPROXY is $(go env GOPROXY)\"; exit 1; }\n# the runner has no other egress\n! curl -sSf --max-time 5 https://registry.npmjs.org/ -o /dev/null || { echo \"the build runner can reach registry.npmjs.org\"; exit 1; }\n```",
|
|
813
|
+
"hubWhen": {
|
|
814
|
+
"PINNING": [
|
|
815
|
+
"proxy"
|
|
816
|
+
]
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"id": "ff-proxy-quarantine",
|
|
821
|
+
"type": "fitness-fn",
|
|
822
|
+
"label": "Fresh releases held back",
|
|
823
|
+
"x": 1040,
|
|
824
|
+
"y": 780,
|
|
825
|
+
"characteristic": "security",
|
|
826
|
+
"scope": "atomic",
|
|
827
|
+
"cadence": "triggered",
|
|
828
|
+
"trigger": "nightly",
|
|
829
|
+
"invocation": "automated",
|
|
830
|
+
"description": "A daily job on a runner with internet access (not a build runner) takes the newest version of a frequently released package from the public registry, computes its age from the registry's publish time, and asks the proxy for it: a version younger than 7 days must be refused, an older one served. It fails when the proxy serves a fresh one.\n\nThreshold: A package version younger than 7 days is refused by the proxy; one older than 7 days is served\n\nTool: npm view and jq in a scheduled job (the same with pip index versions for PyPI)\n\n```bash\nPROXY=\"https://artifacts.example.internal/api/npm/npm-remote/\"\nPUBLIC=\"https://registry.npmjs.org/\"\npkg=express\nlatest=$(npm view \"$pkg\" version --registry \"$PUBLIC\")\npublished=$(npm view \"$pkg@$latest\" time --json --registry \"$PUBLIC\" | jq -r --arg v \"$latest\" '.[$v]')\nage_days=$(( ( $(date +%s) - $(date -d \"$published\" +%s) ) / 86400 ))\nif [ \"$age_days\" -lt 7 ]; then\n if npm view \"$pkg@$latest\" version --registry \"$PROXY\" >/dev/null 2>&1; then\n echo \"the proxy served $pkg@$latest at $age_days days old\"; exit 1\n fi\n echo \"the proxy held back $pkg@$latest ($age_days days old)\"\nelse\n npm view \"$pkg@$latest\" version --registry \"$PROXY\" >/dev/null || { echo \"the proxy refused $pkg@$latest at $age_days days old\"; exit 1; }\n echo \"no version younger than 7 days to test with $pkg today; the $age_days-day-old one was served\"\nfi\n```",
|
|
811
831
|
"hubWhen": {
|
|
812
832
|
"PINNING": [
|
|
813
833
|
"proxy"
|
|
@@ -819,10 +839,13 @@
|
|
|
819
839
|
"type": "fitness-fn",
|
|
820
840
|
"label": "Images carry provenance",
|
|
821
841
|
"x": 1040,
|
|
822
|
-
"y":
|
|
823
|
-
"
|
|
824
|
-
"
|
|
825
|
-
"
|
|
842
|
+
"y": 910,
|
|
843
|
+
"characteristic": "security",
|
|
844
|
+
"scope": "atomic",
|
|
845
|
+
"cadence": "triggered",
|
|
846
|
+
"trigger": "release",
|
|
847
|
+
"invocation": "automated",
|
|
848
|
+
"description": "After each release build, the pipeline inspects the pushed image and fails when it carries no SLSA provenance, or one without a builder id or the source commit. BuildKit keys the provenance by platform for multi-platform images and records the commit under its own metadata key when the build context is a git checkout, which the filter reads.\n\nThreshold: 100 % of released images carry a SLSA provenance statement per platform, each naming the builder and the commit it was built from\n\nTool: Docker Buildx (BuildKit provenance attestations) and jq\n\n```bash\ndocker buildx build --provenance=mode=max --sbom=true -t \"$IMAGE\" --push .\ndocker buildx imagetools inspect \"$IMAGE\" --format '{{ json .Provenance }}' > provenance.json\njq -e '[.. | objects | select(has(\"SLSA\")) | .SLSA]\n | length > 0\n and all(.builder.id != null\n and .metadata[\"https://mobyproject.org/buildkit@v1#metadata\"].vcs.revision != null)' provenance.json \\\n || { echo \"no SLSA provenance naming the builder and the commit\"; exit 1; }\n```",
|
|
826
849
|
"hubWhen": {
|
|
827
850
|
"SLSA": [
|
|
828
851
|
"l1"
|
|
@@ -834,10 +857,13 @@
|
|
|
834
857
|
"type": "fitness-fn",
|
|
835
858
|
"label": "Provenance verified on deploy",
|
|
836
859
|
"x": 1040,
|
|
837
|
-
"y":
|
|
838
|
-
"
|
|
839
|
-
"
|
|
840
|
-
"
|
|
860
|
+
"y": 1040,
|
|
861
|
+
"characteristic": "security",
|
|
862
|
+
"scope": "atomic",
|
|
863
|
+
"cadence": "triggered",
|
|
864
|
+
"trigger": "deploy",
|
|
865
|
+
"invocation": "automated",
|
|
866
|
+
"description": "The build attests provenance with GitHub artifact attestations under the image's lower-case name; the deploy job verifies, before anything is rolled out, that the attestation was made for this repository from refs/heads/main.\n\nThreshold: 0 deployments of an artifact whose signed provenance does not verify for this repository and its main branch\n\nTool: GitHub artifact attestations (actions/attest-build-provenance, gh attestation verify)\n\n```yaml\n# build job (permissions: id-token: write, attestations: write, packages: write)\n- run: echo \"IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}/order-api\" >> \"$GITHUB_ENV\" # the registry wants a lower-case name\n- uses: actions/attest-build-provenance@v2.4.0 # pin by commit SHA in your repository\n with:\n subject-name: ${{ env.IMAGE }}\n subject-digest: ${{ steps.push.outputs.digest }}\n push-to-registry: true\n# deploy job, before rolling out\n- run: gh attestation verify \"oci://$IMAGE@$DIGEST\" --repo \"${{ github.repository }}\" --source-ref refs/heads/main\n env: { GH_TOKEN: \"${{ github.token }}\" }\n```",
|
|
841
867
|
"hubWhen": {
|
|
842
868
|
"SLSA": [
|
|
843
869
|
"l2"
|
|
@@ -849,10 +875,13 @@
|
|
|
849
875
|
"type": "fitness-fn",
|
|
850
876
|
"label": "Admission verifies provenance",
|
|
851
877
|
"x": 1040,
|
|
852
|
-
"y":
|
|
853
|
-
"
|
|
854
|
-
"
|
|
855
|
-
"
|
|
878
|
+
"y": 1170,
|
|
879
|
+
"characteristic": "security",
|
|
880
|
+
"scope": "atomic",
|
|
881
|
+
"cadence": "triggered",
|
|
882
|
+
"trigger": "deploy",
|
|
883
|
+
"invocation": "automated",
|
|
884
|
+
"description": "A Kyverno policy in enforce mode verifies, for every pod from our registry, that the image has an SLSA provenance attestation signed keylessly by the slsa-github-generator workflow and that the provenance names our repository's main branch as its source.\n\nThreshold: 0 pods admitted from our registry without SLSA provenance signed by the isolated generator workflow for this repository\n\nTool: Kyverno (verifyImages)\n\n```yaml\napiVersion: kyverno.io/v1\nkind: ClusterPolicy\nmetadata: { name: require-slsa-provenance }\nspec:\n validationFailureAction: Enforce\n webhookTimeoutSeconds: 30\n rules:\n - name: slsa-provenance\n match: { any: [{ resources: { kinds: [Pod] } }] }\n verifyImages:\n - imageReferences: [\"ghcr.io/our-org/*\"]\n attestations:\n - type: https://slsa.dev/provenance/v0.2\n attestors:\n - entries:\n - keyless:\n issuer: https://token.actions.githubusercontent.com\n subjectRegExp: '^https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@refs/tags/v.*'\n rekor: { url: https://rekor.sigstore.dev }\n conditions:\n - all:\n - key: \"{{ invocation.configSource.uri }}\"\n operator: Equals\n value: \"git+https://github.com/our-org/shop@refs/heads/main\"\n```",
|
|
856
885
|
"hubWhen": {
|
|
857
886
|
"SLSA": [
|
|
858
887
|
"l3"
|
|
@@ -864,10 +893,13 @@
|
|
|
864
893
|
"type": "fitness-fn",
|
|
865
894
|
"label": "SBOM of every deployed version",
|
|
866
895
|
"x": 1040,
|
|
867
|
-
"y":
|
|
868
|
-
"
|
|
869
|
-
"
|
|
870
|
-
"
|
|
896
|
+
"y": 1300,
|
|
897
|
+
"characteristic": "security",
|
|
898
|
+
"scope": "atomic",
|
|
899
|
+
"cadence": "triggered",
|
|
900
|
+
"trigger": "release",
|
|
901
|
+
"invocation": "automated",
|
|
902
|
+
"description": "The release pipeline generates a CycloneDX SBOM of the image with Syft and uploads it to OWASP Dependency-Track under the element and version, where new advisories are matched against it continuously. A daily job looks the production version up and fails on any violation of a policy whose state is FAIL (the blocking policies, such as a critical vulnerability past its deadline).\n\nThreshold: Every release uploads its CycloneDX SBOM to Dependency-Track under the element and version; 0 violations of a FAIL-state policy for the version in production, checked daily\n\nTool: Syft and OWASP Dependency-Track (REST API)\n\n```bash\n# release pipeline\nsyft \"$IMAGE\" -o cyclonedx-json > sbom.cdx.json\ncurl -sf -X POST \"$DTRACK_URL/api/v1/bom\" \\\n -H \"X-Api-Key: $DTRACK_API_KEY\" \\\n -F \"autoCreate=true\" -F \"projectName=$ELEMENT\" -F \"projectVersion=$VERSION\" \\\n -F \"bom=@sbom.cdx.json\"\n# daily, for the version running in production\nuuid=$(curl -sf \"$DTRACK_URL/api/v1/project/lookup?name=$ELEMENT&version=$PROD_VERSION\" -H \"X-Api-Key: $DTRACK_API_KEY\" | jq -r .uuid)\ncurl -sf \"$DTRACK_URL/api/v1/violation/project/$uuid\" -H \"X-Api-Key: $DTRACK_API_KEY\" \\\n | jq -e '[.[] | select(.policyCondition.policy.violationState == \"FAIL\")]\n | if length > 0 then (map(.policyCondition.policy.name + \": \" + .component.name) | join(\"\\n\") | halt_error(1)) else true end'\n```",
|
|
871
903
|
"hubWhen": {
|
|
872
904
|
"SBOM": [
|
|
873
905
|
"internal"
|
|
@@ -877,12 +909,15 @@
|
|
|
877
909
|
{
|
|
878
910
|
"id": "ff-sbom-release",
|
|
879
911
|
"type": "fitness-fn",
|
|
880
|
-
"label": "Releases carry a
|
|
912
|
+
"label": "Releases carry a signed SBOM and VEX",
|
|
881
913
|
"x": 1040,
|
|
882
|
-
"y":
|
|
883
|
-
"
|
|
884
|
-
"
|
|
885
|
-
"
|
|
914
|
+
"y": 1430,
|
|
915
|
+
"characteristic": "security",
|
|
916
|
+
"scope": "atomic",
|
|
917
|
+
"cadence": "triggered",
|
|
918
|
+
"trigger": "release",
|
|
919
|
+
"invocation": "automated",
|
|
920
|
+
"description": "The release job generates the SBOM, validates it against the CycloneDX schema, checks that every component has a version and purl, attests it to the image with cosign, signs the SBOM file keylessly (the bundle is the signature customers verify with cosign verify-blob), writes the VEX statements from the reviewed list of not-affected vulnerabilities, and attaches all three to the release.\n\nThreshold: 100 % of releases carry an SBOM that validates against its schema with a version and package URL on 100 % of components, its Sigstore signature bundle, and an OpenVEX document\n\nTool: Syft, CycloneDX CLI, cosign and vexctl\n\n```bash\nsyft \"$IMAGE\" -o cyclonedx-json > sbom.cdx.json\ncyclonedx validate --input-file sbom.cdx.json --fail-on-errors\njq -e '[.components[] | select(.version == null or .purl == null)] | length == 0' sbom.cdx.json\ncosign attest --yes --type cyclonedx --predicate sbom.cdx.json \"$IMAGE@$DIGEST\"\ncosign sign-blob --yes --bundle sbom.cdx.json.sigstore.json sbom.cdx.json\n# VEX: one statement per reviewed not-affected vulnerability (security/vex.yaml: id and justification), merged into one document\nfor cve in $(yq -r '.not_affected[].id' security/vex.yaml); do\n just=$(yq -r \".not_affected[] | select(.id == \\\"$cve\\\") | .justification\" security/vex.yaml)\n vexctl create --product \"pkg:oci/order-api@$DIGEST\" --vuln \"$cve\" --status not_affected --justification \"$just\" > \"vex-$cve.json\"\ndone\nvexctl merge vex-*.json > vex.openvex.json\ngh release upload \"$TAG\" sbom.cdx.json sbom.cdx.json.sigstore.json vex.openvex.json\n```",
|
|
886
921
|
"hubWhen": {
|
|
887
922
|
"SBOM": [
|
|
888
923
|
"shipped"
|
|
@@ -894,10 +929,13 @@
|
|
|
894
929
|
"type": "fitness-fn",
|
|
895
930
|
"label": "Final stage on a minimal base",
|
|
896
931
|
"x": 1040,
|
|
897
|
-
"y":
|
|
898
|
-
"
|
|
899
|
-
"
|
|
900
|
-
"
|
|
932
|
+
"y": 1560,
|
|
933
|
+
"characteristic": "security",
|
|
934
|
+
"scope": "atomic",
|
|
935
|
+
"cadence": "triggered",
|
|
936
|
+
"trigger": "pull-request",
|
|
937
|
+
"invocation": "automated",
|
|
938
|
+
"description": "A Conftest policy over each Dockerfile resolves the final stage's base through stage aliases and fails when it is not a minimal image, or when the final stage runs as root: no USER and a base whose tag is not a nonroot one (distroless :nonroot, Chainguard images default to a non-root user).\n\nThreshold: 0 Dockerfiles whose final stage is not on gcr.io/distroless or cgr.dev/chainguard, or runs as root\n\nTool: Conftest (Open Policy Agent) Dockerfile parser\n\n```rego\n# conftest test --parser dockerfile -p policy/minimal-base.rego Dockerfile*\npackage main\n\nimport rego.v1\n\n# conftest's dockerfile parser gives one array of commands per file; this reads either shape\ncommands contains c if {\n some c in input\n is_object(c)\n}\n\ncommands contains c if {\n some stage in input\n is_array(stage)\n some c in stage\n}\n\nfroms contains f if {\n some f in commands\n f.Cmd == \"from\"\n}\n\nlast_stage := max({f.Stage | some f in froms})\n\nfinal := [f | some f in froms; f.Stage == last_stage][0]\n\naliases := {lower(f.Value[2]): f.Value[0] | some f in froms; count(f.Value) == 3; lower(f.Value[1]) == \"as\"}\n\nbase := object.get(aliases, lower(final.Value[0]), final.Value[0])\n\ndeny contains msg if {\n not startswith(base, \"gcr.io/distroless/\")\n not startswith(base, \"cgr.dev/chainguard/\")\n msg := sprintf(\"final stage is on %s, not a minimal base\", [base])\n}\n\ndeny contains msg if {\n users := [c | some c in commands; c.Cmd == \"user\"; c.Stage == last_stage]\n count(users) == 0\n not contains(base, \"nonroot\")\n not startswith(base, \"cgr.dev/chainguard/\")\n msg := sprintf(\"final stage on %s sets no USER and the base does not run as non-root\", [base])\n}\n```",
|
|
901
939
|
"hubWhen": {
|
|
902
940
|
"BASE": [
|
|
903
941
|
"minimal"
|
|
@@ -909,25 +947,49 @@
|
|
|
909
947
|
"type": "fitness-fn",
|
|
910
948
|
"label": "Fresh, patched images",
|
|
911
949
|
"x": 1040,
|
|
912
|
-
"y":
|
|
913
|
-
"
|
|
914
|
-
"
|
|
915
|
-
"
|
|
950
|
+
"y": 1690,
|
|
951
|
+
"characteristic": "security",
|
|
952
|
+
"scope": "atomic",
|
|
953
|
+
"cadence": "triggered",
|
|
954
|
+
"trigger": "nightly",
|
|
955
|
+
"invocation": "automated",
|
|
956
|
+
"description": "A scheduled pipeline rebuilds each image on its current base, scans it with Trivy and fails on fixable high or critical findings; a check fails when a running image was built more than {{REBUILD_DAYS}} days ago.\n\nThreshold: 0 fixable high or critical OS vulnerabilities in released images; 0 production images older than {{REBUILD_DAYS}} days\n\nTool: Trivy\n\n```bash\ndocker build --pull --no-cache -t \"$IMAGE\" .\ntrivy image --scanners vuln --pkg-types os --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 \"$IMAGE\"\ncreated=$(docker image inspect \"$RUNNING_IMAGE\" --format '{{ .Created }}')\nage_days=$(( ( $(date +%s) - $(date -d \"$created\" +%s) ) / 86400 ))\n[ \"$age_days\" -le {{REBUILD_DAYS}} ] || { echo \"running image is $age_days days old\"; exit 1; }\n```",
|
|
916
957
|
"hubWhen": {
|
|
917
958
|
"BASE": [
|
|
918
959
|
"official"
|
|
919
960
|
]
|
|
920
961
|
}
|
|
921
962
|
},
|
|
963
|
+
{
|
|
964
|
+
"id": "ff-base-golden-build",
|
|
965
|
+
"type": "fitness-fn",
|
|
966
|
+
"label": "Builds start from golden images",
|
|
967
|
+
"x": 1040,
|
|
968
|
+
"y": 1820,
|
|
969
|
+
"characteristic": "security",
|
|
970
|
+
"scope": "atomic",
|
|
971
|
+
"cadence": "triggered",
|
|
972
|
+
"trigger": "pull-request",
|
|
973
|
+
"invocation": "automated",
|
|
974
|
+
"description": "A Conftest policy over each Dockerfile fails the build when any stage starts from an image outside the internal registry, where only golden-image-based images are published; stage aliases are resolved so that FROM build passes.\n\nThreshold: 0 FROM lines (stage aliases aside) whose image is outside the internal registry\n\nTool: Conftest (Open Policy Agent) Dockerfile parser\n\n```rego\n# conftest test --parser dockerfile -p policy/golden-base.rego Dockerfile*\npackage main\n\nimport rego.v1\n\ncommands contains c if {\n some c in input\n is_object(c)\n}\n\ncommands contains c if {\n some stage in input\n is_array(stage)\n some c in stage\n}\n\nfroms contains f if {\n some f in commands\n f.Cmd == \"from\"\n}\n\naliases contains lower(f.Value[2]) if {\n some f in froms\n count(f.Value) == 3\n lower(f.Value[1]) == \"as\"\n}\n\ndeny contains msg if {\n some f in froms\n image := f.Value[0]\n not lower(image) in aliases\n not startswith(image, \"registry.example.internal/golden/\")\n msg := sprintf(\"FROM %s is not a golden image from registry.example.internal/golden/\", [image])\n}\n```",
|
|
975
|
+
"hubWhen": {
|
|
976
|
+
"BASE": [
|
|
977
|
+
"golden"
|
|
978
|
+
]
|
|
979
|
+
}
|
|
980
|
+
},
|
|
922
981
|
{
|
|
923
982
|
"id": "ff-base-golden",
|
|
924
983
|
"type": "fitness-fn",
|
|
925
984
|
"label": "Only golden images run",
|
|
926
985
|
"x": 1040,
|
|
927
|
-
"y":
|
|
928
|
-
"
|
|
929
|
-
"
|
|
930
|
-
"
|
|
986
|
+
"y": 1950,
|
|
987
|
+
"characteristic": "security",
|
|
988
|
+
"scope": "atomic",
|
|
989
|
+
"cadence": "triggered",
|
|
990
|
+
"trigger": "deploy",
|
|
991
|
+
"invocation": "automated",
|
|
992
|
+
"description": "A Kyverno policy in enforce mode refuses pods whose containers, init containers or ephemeral containers come from anywhere but the internal registry, where only golden-image-based builds are published.\n\nThreshold: 0 pods admitted with an image outside the internal registry, init and ephemeral containers included\n\nTool: Kyverno\n\n```yaml\napiVersion: kyverno.io/v1\nkind: ClusterPolicy\nmetadata: { name: restrict-image-registries }\nspec:\n validationFailureAction: Enforce\n rules:\n - name: internal-registry-only\n match: { any: [{ resources: { kinds: [Pod] } }] }\n validate:\n message: \"Images must come from registry.example.internal, built on a golden image.\"\n pattern:\n spec:\n =(initContainers): [{ image: \"registry.example.internal/*\" }]\n =(ephemeralContainers): [{ image: \"registry.example.internal/*\" }]\n containers: [{ image: \"registry.example.internal/*\" }]\n```",
|
|
931
993
|
"hubWhen": {
|
|
932
994
|
"BASE": [
|
|
933
995
|
"golden"
|
|
@@ -960,12 +1022,6 @@
|
|
|
960
1022
|
"targetId": "need",
|
|
961
1023
|
"relationType": "derives"
|
|
962
1024
|
},
|
|
963
|
-
{
|
|
964
|
-
"id": "req-pin-lockfile--derives--need",
|
|
965
|
-
"sourceId": "req-pin-lockfile",
|
|
966
|
-
"targetId": "need",
|
|
967
|
-
"relationType": "derives"
|
|
968
|
-
},
|
|
969
1025
|
{
|
|
970
1026
|
"id": "req-pin-hash--derives--need",
|
|
971
1027
|
"sourceId": "req-pin-hash",
|
|
@@ -1050,12 +1106,6 @@
|
|
|
1050
1106
|
"targetId": "req-review",
|
|
1051
1107
|
"relationType": "verifies"
|
|
1052
1108
|
},
|
|
1053
|
-
{
|
|
1054
|
-
"id": "sc-pin-lockfile--verifies--req-pin-lockfile",
|
|
1055
|
-
"sourceId": "sc-pin-lockfile",
|
|
1056
|
-
"targetId": "req-pin-lockfile",
|
|
1057
|
-
"relationType": "verifies"
|
|
1058
|
-
},
|
|
1059
1109
|
{
|
|
1060
1110
|
"id": "sc-pin-hash--verifies--req-pin-hash",
|
|
1061
1111
|
"sourceId": "sc-pin-hash",
|
|
@@ -1153,26 +1203,20 @@
|
|
|
1153
1203
|
"relationType": "implements"
|
|
1154
1204
|
},
|
|
1155
1205
|
{
|
|
1156
|
-
"id": "ff-vuln-
|
|
1157
|
-
"sourceId": "ff-vuln-
|
|
1158
|
-
"targetId": "adr-deps-gate",
|
|
1159
|
-
"relationType": "implements"
|
|
1160
|
-
},
|
|
1161
|
-
{
|
|
1162
|
-
"id": "ff-vuln-age--implements--adr-deps-sla",
|
|
1163
|
-
"sourceId": "ff-vuln-age",
|
|
1206
|
+
"id": "ff-vuln-report--implements--adr-deps-sla",
|
|
1207
|
+
"sourceId": "ff-vuln-report",
|
|
1164
1208
|
"targetId": "adr-deps-sla",
|
|
1165
1209
|
"relationType": "implements"
|
|
1166
1210
|
},
|
|
1167
1211
|
{
|
|
1168
|
-
"id": "ff-
|
|
1169
|
-
"sourceId": "ff-
|
|
1212
|
+
"id": "ff-vuln-age--implements--adr-deps-gate",
|
|
1213
|
+
"sourceId": "ff-vuln-age",
|
|
1170
1214
|
"targetId": "adr-deps-gate",
|
|
1171
1215
|
"relationType": "implements"
|
|
1172
1216
|
},
|
|
1173
1217
|
{
|
|
1174
|
-
"id": "ff-
|
|
1175
|
-
"sourceId": "ff-
|
|
1218
|
+
"id": "ff-vuln-age--implements--adr-deps-sla",
|
|
1219
|
+
"sourceId": "ff-vuln-age",
|
|
1176
1220
|
"targetId": "adr-deps-sla",
|
|
1177
1221
|
"relationType": "implements"
|
|
1178
1222
|
},
|
|
@@ -1200,6 +1244,18 @@
|
|
|
1200
1244
|
"targetId": "adr-deps-sla",
|
|
1201
1245
|
"relationType": "implements"
|
|
1202
1246
|
},
|
|
1247
|
+
{
|
|
1248
|
+
"id": "ff-proxy-quarantine--implements--adr-deps-gate",
|
|
1249
|
+
"sourceId": "ff-proxy-quarantine",
|
|
1250
|
+
"targetId": "adr-deps-gate",
|
|
1251
|
+
"relationType": "implements"
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
"id": "ff-proxy-quarantine--implements--adr-deps-sla",
|
|
1255
|
+
"sourceId": "ff-proxy-quarantine",
|
|
1256
|
+
"targetId": "adr-deps-sla",
|
|
1257
|
+
"relationType": "implements"
|
|
1258
|
+
},
|
|
1203
1259
|
{
|
|
1204
1260
|
"id": "ff-provenance-l1--implements--adr-slsa-l1",
|
|
1205
1261
|
"sourceId": "ff-provenance-l1",
|
|
@@ -1290,6 +1346,24 @@
|
|
|
1290
1346
|
"targetId": "adr-slsa-l3",
|
|
1291
1347
|
"relationType": "implements"
|
|
1292
1348
|
},
|
|
1349
|
+
{
|
|
1350
|
+
"id": "ff-base-golden-build--implements--adr-slsa-l1",
|
|
1351
|
+
"sourceId": "ff-base-golden-build",
|
|
1352
|
+
"targetId": "adr-slsa-l1",
|
|
1353
|
+
"relationType": "implements"
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
"id": "ff-base-golden-build--implements--adr-slsa-l2",
|
|
1357
|
+
"sourceId": "ff-base-golden-build",
|
|
1358
|
+
"targetId": "adr-slsa-l2",
|
|
1359
|
+
"relationType": "implements"
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
"id": "ff-base-golden-build--implements--adr-slsa-l3",
|
|
1363
|
+
"sourceId": "ff-base-golden-build",
|
|
1364
|
+
"targetId": "adr-slsa-l3",
|
|
1365
|
+
"relationType": "implements"
|
|
1366
|
+
},
|
|
1293
1367
|
{
|
|
1294
1368
|
"id": "ff-base-golden--implements--adr-slsa-l1",
|
|
1295
1369
|
"sourceId": "ff-base-golden",
|