Skip to content

Commit 651149e

Browse files
authored
Add Chainguard Repo cooldown and pull-through cache (#3282)
[ ] Check if this is a typo or other quick fix and ignore the rest :) ## Type of change Update to existing Chainguard Repo docs ### What should this PR do? Add info about configurable cooldown and pull-through cache ### Why are we making this change? Product update ### What are the acceptance criteria? Content should be clear and accurate, and should appear on pages where we talk about the cooldown ### How should this PR be tested? Review the deploy preview --------- Signed-off-by: s-stumbo <sally.stumbo@chainguard.dev>
1 parent fbb031d commit 651149e

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

content/chainguard/chainguard-repository/overview.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ The Chainguard Repository includes a policy engine that lets you define rules go
4040
For language dependencies, policies apply to both Chainguard-built packages and upstream packages served via the optional fallback to public registries. Available policies include:
4141

4242
* **Upstream fallback**: Control whether packages not yet built by Chainguard can be sourced from the upstream public registry.
43-
* **Cooldown**: Block newly published upstream packages for a defined period before they can be pulled, giving the security community time to detect threats. A 7-day cooldown is set by default when the upstream repository is enabled.
43+
* **Cooldown**: When upstream fallback is enabled, block newly published package versions for a defined period before they can be pulled, giving the security community time to detect threats. The cooldown is configurable (0 to 3650 days) with a default of 7 days.
44+
45+
> **Note**: Chainguard recommends a 7-day cooldown when enabling upstream fallback, to block a large share of malicious packages identified shortly after publication. Shorter cooldown periods increase the risk of pulling malicious or compromised upstream packages before the broader ecosystem can detect and report them.
4446
4547
All upstream packages are checked against public malware identifier feeds, and any package with a known malware idenitifier is blocked before being served.
4648

content/chainguard/libraries/javascript/overview.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,25 @@ libraries entitlements`
236236
command](/chainguard/chainctl/chainctl-docs/chainctl_libraries_entitlements_create/).
237237

238238
The following command creates or updates an entitlement to Chainguard Libraries
239-
for JavaScript and adds the npm upstream fallback policy:
239+
for JavaScript, adds the npm upstream fallback policy, and configures a 7-day cooldown:
240240

241241
```bash
242-
chainctl libraries entitlements create --ecosystems=JAVASCRIPT --policy=CHAINGUARD_AND_UPSTREAM
242+
chainctl libraries entitlements create --ecosystems=JAVASCRIPT --policy=CHAINGUARD_AND_UPSTREAM --cooldown-days=7
243243
```
244244

245245
### Fallback options
246246
The following options are available:
247247
* **No upstream fallback (default)**: Only Chainguard-built packages are served.
248-
* **Upstream fallback enabled with cooldown**: Upstream packages are available after passing a cooldown period and malware scan.
248+
* **Upstream fallback enabled with cooldown**: Upstream packages are available after passing a cooldown period and malware scan.
249+
250+
#### Configuring the cooldown period
251+
252+
When upstream fallback is enabled, users with the Owner role can configure the cooldown with `chainctl`:
253+
254+
```bash
255+
chainctl libraries entitlements create --ecosystems=JAVASCRIPT --policy=CHAINGUARD_AND_UPSTREAM --cooldown-days=3
256+
```
257+
The default cooldown period is 7 days. Note that shorter cooldown periods increase the risk of pulling malicious or compromised upstream packages before the broader ecosystem can detect and report them.
249258

250259
> **Upstream fallback best practices**
251260
> Upstream packages are proxied directly from npm and are not rebuilt or authored by Chainguard as part of our Libraries product. The cooldown period and malware scanning provide a supplemental baseline of protection to your own security practices, but you are solely responsible for independently evaluating and validating all upstream artifacts before use in your environment.
@@ -255,18 +264,21 @@ The following options are available:
255264
#### Malware scanning
256265
All packages served from the upstream fallback are scanned for malware before being made available. Any package version with a detected malware identifier (MAL ID) from the public OSV feed is blocked and will not be served.
257266

267+
Malware detection is continuous. If a version that was previously cached is later identified as malicious, it is added to the block list and will be blocked on subsequent requests.
268+
258269
#### Cooldown period
259-
When fallback is enabled, upstream npm packages are subject to a default 7-day cooldown from their publication date before the Chainguard Repository will serve them. The cooldown is an additional layer of security on top of malware scanning. It provides a window for the security community to identify and report malicious packages before your builds can pull them.
270+
271+
When fallback is enabled, upstream npm packages are subject to a cooldown period from their publication date before the Chainguard Repository will serve them. The cooldown is an additional layer of security that provides a window for the security community to identify and report malicious packages before your builds can pull them.
260272

261273
If a package version is requested and falls within the cooldown period, the package manager will output a 404 error. The package becomes available once it has passed the cooldown period and cleared malware scanning.
262274

263275
### How package resolution works
264276

265277
When you request a JavaScript package from the Chainguard Repository, the following logic applies:
266-
* **Chainguard-built package available**: The package is served directly from Chainguard's rebuilt artifact store, complete with SBOM, provenance, and signatures.
278+
* **Chainguard-built package available**: The package is served directly from Chainguard's rebuilt artifact store, complete with SBOM, provenance, and signatures, subject to the configured cooldown.
267279
* **Package not yet built by Chainguard**: If upstream fallback is enabled, the repository checks whether the package has passed the cooldown period and malware scan.
268280
* **Within the cooldown period**: The request returns an error. This prevents newly published packages — which carry higher malware risk — from being served immediately.
269-
* **After the cooldown period**: The package is checked against malware scanning. If it passes, it is proxied from the npm Registry.
281+
* **After the cooldown period**: If upstream fallback is enabled and the version is outside the cooldown window and passes malware scanning, the repository pulls the version through from the npm registry, serves it to the client, and caches it in the upstream mirror for future requests.
270282
* **Malware detected**: Any package version with a known malware identifier (MAL ID) is blocked and never served, whether it originates from Chainguard builds or the npm upstream. Malware scanning runs on all packages, including those proxied from npm.
271283
* Malware scanning checks all packages against the Open Source Vulnerabilities (OSV) database, which includes the OpenSSF Malicious Packages feed among other sources. Any package version flagged with a malware identifier is blocked. This covers reported malicious packages across the npm ecosystem.
272284

0 commit comments

Comments
 (0)