Skip to content

Commit b5c04d1

Browse files
javascript repo updates (#3255)
- Update guidance on artifact manager setup to use Chainguard Repo --------- Signed-off-by: angela-zhang <30538317+angela-zhang@users.noreply.github.com> Co-authored-by: Manfred Moser <manfred@simpligility.ca>
1 parent 5cfac82 commit b5c04d1

4 files changed

Lines changed: 91 additions & 103 deletions

File tree

content/chainguard/chainguard-repository/overview.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ draft: false
1010
weight: 010
1111
---
1212

13-
The Chainguard Repository is a single, policy-aware endpoint for all artifacts that Chainguard builds and distributes. It gives your organization one place to pull open source artifacts, configure security policies that govern how they are consumed, and monitor coverage and policy enforcement across your environment.
13+
The Chainguard Repository is a single, policy-managed experience for pulling artifacts that Chainguard either builds or distributes. It gives your organization one place to pull open source artifacts, configure security policies that govern how they are consumed, and monitor coverage and policy enforcement across your environment.
1414

15-
All artifacts served through the Chainguard Repository are either rebuilt by Chainguard from verifiable source in a SLSA L2-compliant build environment, or sourced from upstream public registries and protected by configurable policies. As Chainguard builds more artifacts from source, your organization's risk shrinks automatically without any changes to your configuration or developer workflows.
15+
All artifacts served through the Chainguard Repository are either rebuilt by Chainguard from verifiable source in a SLSA L2-compliant build environment, or sourced from upstream public registries with configurable policy controls. As Chainguard builds more artifacts from source, your organization's risk shrinks automatically without any changes to your configuration or developer workflows.
1616

1717
## Artifact types
1818

1919
As of this writing, the Chainguard Repository contains the following artifact types:
2020

2121
| Artifact type | Description |
2222
| ----- | ----- |
23-
| [Chainguard JavaScript Libraries](/chainguard/libraries/javascript/overview/) | Open source language dependencies rebuilt from source for JavaScript (npm). |
23+
| [Chainguard Libraries for JavaScript](/chainguard/libraries/javascript/overview/) | Open source language dependencies rebuilt from source for JavaScript (npm). |
2424

2525
## Endpoints
2626

@@ -35,19 +35,19 @@ See each artifact type's documentation for authentication and configuration deta
3535

3636
## Policies for Libraries
3737

38-
The Chainguard Repository includes a policy engine that lets you define rules governing which artifacts can be consumed and under what conditions. Policies are configured once in the Chainguard Console and enforced automatically across your environment.
38+
The Chainguard Repository includes a policy engine that lets you define rules governing which artifacts can be consumed and under what conditions. Policies can be configured in the Chainguard Console or with `chainctl`, and are enforced automatically across your environment.
3939

40-
For language dependencies, policies apply to both Chainguard-built packages and upstream packages served via the optional fallback to public registries (npm). Available policies include:
40+
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

42-
* **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 blocks 47% of malicious packages.
42+
* **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.
4444

45-
All packages — whether Chainguard-built or sourced from upstream are also scanned for malware before being served. Any package with a detected malware identifier is blocked.
45+
All upstream packages are checked against public malware identifier feeds, and any package with a known malware idenitifier is blocked before being served.
4646

4747

48-
## **Console**
48+
## **Management**
4949

50-
The Chainguard Console is the central interface for configuring policies and monitoring artifact activity across your organization. Learn more in [Using the Chainguard Console](/chainguard/chainguard-images/how-to-use/images-directory/).
50+
The Chainguard Console and `chainctl` can be used for configuring and managing policies across your organization. Learn more in [Using the Chainguard Console](/chainguard/chainguard-images/how-to-use/images-directory/) and [Get Started with chainctl](/chainguard/chainctl-usage/getting-started-with-chainctl/).
5151

5252
Access the Console at [console.chainguard.dev](https://console.chainguard.dev).
5353

content/chainguard/libraries/javascript/build-configuration.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@ toc: true
1717
The configuration for the use of Chainguard Libraries depends on your build
1818
tools, continuous integration, and continuous deployment setups.
1919

20-
At a high level adopting the use of Chainguard Libraries consists of the
20+
At a high level, adopting Chainguard Libraries consists of the
2121
following steps:
2222

2323
* Remove local caches on workstations and CI/CD pipelines. This step ensures that
24-
any libraries that were already sourced from other repositories are requested
25-
again and the version from Chainguard Libraries is used instead of other
26-
binaries.
24+
any libraries that were already sourced from upstream repositories are requested
25+
again, and the version from Chainguard Libraries is used instead.
2726
* Change configuration to access Chainguard Libraries via your repository
2827
manager after the changes from the [global
2928
configuration](/chainguard/libraries/javascript/global-configuration/) are
30-
implemented.
29+
implemented, or via direct access.
3130

3231
These changes must be performed on all workstations of individual developers and
3332
other engineers running relevant application builds. They must also be performed

content/chainguard/libraries/javascript/global-configuration.md

Lines changed: 63 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,31 @@ and development tools to retrieve the required libraries.
2424

2525
If your organization uses the [upstream fallback](/chainguard/libraries/javascript/overview/#upstream-fallback-policy-and-controls)
2626
feature of Chainguard Repository, you can configure your repository manager
27-
with a single upstream pointed at `https://libraries.cgr.dev/javascript/`. The
28-
Chainguard Repository handles fallback and policy; your repository manager
29-
handles local caching and access control.
27+
with a single upstream pointed at `https://libraries.cgr.dev/javascript/`. This
28+
is the recommended setup. The Chainguard Repository handles fallback and policy
29+
enforcement; your repository manager handles local caching and access control.
30+
Chainguard also retrieves packages from the public npm Registry on your
31+
behalf when upstream fallback is enabled. This includes protections such as
32+
malware detection and a cooldown period for newly published
33+
packages.
3034

3135
At a high level, adopting the use of Chainguard Libraries consists of the following steps:
3236

33-
* Add `https://libraries.cgr.dev/javascript/` as a remote repository in your repository manager.
34-
* Configure it as the single upstream source for JavaScript package retrieval.
35-
* Additional steps depend on the desired insights and can include the following optional measures:
36-
* Remove all cached libraries in the proxy repository of the npm Registry. This
37-
step allows you to validate which libraries are not available from Chainguard
38-
Libraries and proceed with potential next steps with Chainguard and your own
39-
development efforts.
40-
* Remove any repositories that are no longer desired or necessary. Depending on
41-
your library requirements this step can result in removal of some proxy
42-
repositories or even removal of all proxy repositories.
37+
* Configure your environment to use `https://libraries.cgr.dev/javascript/`
38+
as the single upstream source for JavaScript package retrieval. This can be done
39+
either:
40+
* As a remote repository in your repository manager, or
41+
* Directly in your JavaScript build configuration (for example, npm,
42+
pnpm, or yarn).
43+
* Additional steps depend on your visibility and validation goals and can include the following optional measures:
44+
* Remove all cached libraries in existing proxy repositories. This step
45+
allows you to validate which libraries are not available from
46+
Chainguard Libraries and ensures they are retrieved through
47+
Chainguard for evaluation.
48+
* Remove any repositories that are no longer desired or necessary.
49+
Depending on your library requirements, this step can result in
50+
removal of some proxy repositories or simplification of your
51+
repository configuration.
4352

4453
Adopting the use of a repository manager is the recommended approach to minimize complexity. If your organization does not use a repository manager, refer to the [direct access documentation](/chainguard/libraries/javascript/build-configuration/) for build tools.
4554

@@ -51,7 +60,7 @@ Configuring your own fallback bypasses the protection that the Chainguard
5160
Repository provides.
5261

5362
However, if upstream fallback is not enabled or you prefer to manage your own fallback
54-
ordering: you can configure `https://libraries.cgr.dev/javascript/` as a remote
63+
ordering, you can configure `https://libraries.cgr.dev/javascript/` as a remote
5564
repository alongside your npm upstream, and combine them in a virtual or group
5665
repository with Chainguard as the first priority. The per-tool instructions on
5766
this page follow this pattern.
@@ -60,7 +69,7 @@ this page follow this pattern.
6069

6170
## Cloudsmith
6271

63-
[Cloudsmith](https://cloudsmith.com/) supports npm registries repositories for
72+
[Cloudsmith](https://cloudsmith.com/) supports npm registries for
6473
proxying and hosting. Refer to the [npm registry
6574
documentation](https://help.cloudsmith.io/docs/npm-registry) and the [npm
6675
Upstream
@@ -70,10 +79,12 @@ by defining multiple upstream repositories.
7079

7180
### Initial configuration
7281

73-
Use the following steps to add a repository with the npm registry and the
74-
Chainguard Libraries for JavaScript repository as npm upstream repositories.
82+
Use the following steps to configure a repository with the Chainguard Libraries for
83+
JavaScript repository as an upstream.
7584

76-
Configure a *javascript-all* repository:
85+
Configure a *javascript-all* repository. This repository acts as a single access point
86+
for JavaScript packages and may also include private packages or additional upstream
87+
sources, depending on your configuration.
7788

7889
1. Log in as a user with administrator privileges.
7990
1. Select the **Repositories** tab near the top of the screen.
@@ -85,23 +96,10 @@ Configure a *javascript-all* repository:
8596
infrastructure.
8697
1. Click **+ Create Repository**.
8798

88-
Configure an upstream proxy for the npm registry:
89-
90-
1. Click the name of the new *javascript-all* repository on the repositories
91-
page to configure it.
92-
1. Access the **Upstreams** tab and click **+ Add Upstream Proxy**.
93-
1. Configure an upstream proxy with the format **npm** and the following details:
94-
1. Configure another upstream proxy with the following details
95-
* **Name** *javascript-public*
96-
* **Priority** *2*
97-
* **Upstream URL** `https://registry.npmjs.org/`
98-
* **Mode** *Cache and Proxy*
99-
1. Click **Create Upstream Proxy**.
100-
10199
Configure an upstream proxy for the Chainguard Libraries for JavaScript
102100
repository:
103101

104-
1. Click the name of the new *javascript-chainguard* repository on the
102+
1. Click the name of the new *javascript-all* repository on the
105103
repositories page to configure it.
106104
1. Access the **Upstreams** tab and click **+ Add Upstream Proxy**.
107105
1. Configure an upstream proxy with the format **npm** and the following details:
@@ -113,10 +111,15 @@ repository:
113111
access](/chainguard/libraries/access/) in **Authentication Settings**
114112
1. Click **Create Upstream Proxy**.
115113

114+
If you are manually managing fallback, you can add an additional upstream
115+
proxy for the public npm registry with a lower priority than
116+
`javascript-chainguard`.
117+
116118
Use this setup for initial testing with Chainguard Libraries for JavaScript. For
117119
production usage, add the `javascript-chainguard` upstream proxy to your production
118120
repository.
119121

122+
120123
### Build tool access
121124

122125
The following steps allow you to determine the URL and authentication details
@@ -160,22 +163,13 @@ for more information.
160163

161164
### Initial configuration
162165

163-
Use the following steps to add the npm Registry and the Chainguard Libraries for
164-
JavaScript repository as remote repositories and combine them as a virtual
165-
repository:
166+
Use the following steps to add Chainguard Libraries for
167+
JavaScript as a remote repository:
166168

167169
1. Log in as a user with administrator privileges.
168170
1. Click **Administration** in the top navigation bar.
169171
1. Select **Repositories** in the left hand navigation.
170172

171-
Configure a remote repository for the npm Registry:
172-
173-
1. Click **Create a Repository** and choose the **Remote** option.
174-
1. Select **Npm** as the **Package type**.
175-
1. Set the **Repository Key** to *javascript-public*.
176-
1. Set the **URL** to `https://registry.npmjs.org`.
177-
1. Click **Create Remote Repository**.
178-
179173
Configure a remote repository for the Chainguard Libraries for JavaScript
180174
repository:
181175

@@ -187,18 +181,19 @@ repository:
187181
with chainctl](/chainguard/libraries/access/).
188182
1. Click **Create Remote Repository**.
189183

190-
Combine the two repositories in a new virtual repository:
184+
Create a virtual repository, or add the remote repository to an existing
185+
virtual repository used for npm packages. A virtual repository may also include private npm packages or
186+
additional upstream sources, depending on your configuration.
191187

192-
1. Click **Create a Repository** and choose the **Virtual** option.
193-
1. Select **Npm** as the **Package type**.
194-
1. Set the **Repository Key** to *javascript-all*.
195-
1. Scroll down to the **Repositories** section.
196-
1. Add the *javascript-chainguard* and *javascript-public* repositories. Ensure
197-
the *javascript-chainguard* repository is the first in the displayed list.
198-
Use the icon on the right of the repository name to drag and drop
199-
repositories into the desired position.
188+
1. Click **Create a Repository****Virtual**.
189+
1. Select **Npm**.
190+
1. Set key to *javascript-all*.
191+
1. Add `javascript-chainguard`.
200192
1. Click **Create Virtual Repository**.
201193

194+
If you are manually managing fallback, you can configure an additional npm
195+
remote repository with lower priority.
196+
202197
Use this setup for initial testing with Chainguard Libraries for JavaScript. For
203198
production usage add the `javascript-chainguard` repository to your production
204199
virtual repository.
@@ -256,30 +251,19 @@ all libraries retrieved from Chainguard.
256251
[Sonatype Nexus
257252
Repository](https://www.sonatype.com/products/sonatype-nexus-repository) allows
258253
for merging multiple remote repositories as a repository group. The below
259-
instructions for are based on the [Nexus documentation for
254+
instructions are based on the [Nexus documentation for
260255
npm](https://help.sonatype.com/en/npm-registry.html).
261256

262257
### Initial configuration
263258

264-
For initial testing and adoption it is advised to create a separate proxy
265-
repository for the npm registry, a separate proxy repository Chainguard
266-
Libraries for JavaScript repository, and a separate repository group:
259+
For initial testing and adoption it is advised to create a separate proxy repository
260+
for the Chainguard Libraries for JavaScript repository, and include it in a repository group:
267261

268262
1. Log in as a user with administrator privileges.
269263
1. Access the **Server administration** and configuration section with the gear
270264
icon in the top navigation bar.
271265

272-
Configure a remote repository for the npm Registry:
273-
274-
1. Select **Repository - Repositories** in the left hand navigation.
275-
1. Click **Create repository**.
276-
1. Select the **npm (proxy)** recipe.
277-
1. Provide a new name *javascript-public*.
278-
1. In the **Proxy - Remote storage** input add the URL
279-
`https://registry.npmjs.org/`.
280-
1. Click **Create repository**.
281-
282-
Configure a remote repository for the Chainguard Libraries for JavaScript
266+
Configure a proxy repository for the Chainguard Libraries for JavaScript
283267
repository:
284268

285269
1. Select **Repository - Repositories** in the left hand navigation.
@@ -293,16 +277,23 @@ repository:
293277
chainctl](/chainguard/libraries/access/).
294278
1. Click **Create repository**.
295279

296-
Combine a new repository group and add the two repositories:
280+
Create a repository group, or add to an existing repository group:
297281

298282
1. Select **Repository - Repositories** in the left hand navigation.
299283
1. Click **Create repository**.
300284
1. Select the **npm (group)** recipe.
301285
1. Provide a new name *javascript-all*.
302-
1. In the section **Group - Member repositories**, move the new repositories
303-
`javascript-public` and `javascript-chainguard` to the right and move the
304-
`javascript-chainguard` repository to the top of the list with the arrow
305-
control.
286+
1. In the section **Group - Member repositories**, move the new repository
287+
`javascript-chainguard` to the right to include it in the group. Position
288+
`javascript-chainguard` at the top of the list using the arrow controls.
289+
290+
Repository groups can include multiple repositories, such as hosted
291+
repositories for private packages or additional proxy repositories. In a
292+
typical configuration, the Chainguard repository is placed first to ensure
293+
packages are retrieved through Chainguard when available.
294+
295+
If you are manually managing fallback, you can configure an additional npm
296+
proxy repository and add it to the group after *javascript-chainguard*.
306297

307298
### Build tool access
308299

0 commit comments

Comments
 (0)