Skip to content

Commit 7553662

Browse files
committed
Update to new chainctl libraries verify command
1 parent 8fefe7c commit 7553662

File tree

2 files changed

+59
-109
lines changed

2 files changed

+59
-109
lines changed

content/chainguard/libraries/access.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ password CHAINGUARD_PYTHON_TOKEN
257257

258258
Note that the long string for the password value must use only one line.
259259

260+
<a id="entitlement"></a>
261+
260262
## Verify entitlement
261263

262264
You can verify entitlements for your organization `example` with the following

content/chainguard/libraries/verification.md

Lines changed: 57 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Chainguard Libraries Verification"
33
linktitle: "Verification"
44
description:
55
"Learn how to verify libraries and packages are from Chainguard
6-
Libraries using the chainver tool for enhanced supply chain security"
6+
Libraries using the chainctl tool for enhanced supply chain security"
77
type: "article"
88
date: 2025-07-03T12:00:00+00:00
99
lastmod: 2025-07-23T15:09:59+00:00
@@ -18,15 +18,16 @@ toc: true
1818

1919
## Overview
2020

21-
Chainguard's `chainver` tool verifies that your language ecosystem dependencies
22-
come from Chainguard Libraries, providing critical visibility into your software
23-
supply chain security. By verifying binary artifacts across your projects and
24-
repositories, you can ensure dependencies are sourced from Chainguard's hardened
25-
build environment rather than potentially compromised public repositories,
26-
identify opportunities to improve security posture, and maintain compliance with
27-
supply chain security policies.
21+
Chainguard's `chainctl` tool with the command `libraries verify` verifies that
22+
your language ecosystem dependencies come from Chainguard Libraries, providing
23+
critical visibility into your software supply chain security. By verifying
24+
binary artifacts across your projects and repositories, you can ensure
25+
dependencies are sourced from Chainguard's hardened build environment rather
26+
than potentially compromised public repositories, identify opportunities to
27+
improve security posture, and maintain compliance with supply chain security
28+
policies.
2829

29-
The `chainver` tool:
30+
Command characteristics:
3031

3132
- Uses a signature-based binary identification and a checksum fallback.
3233
- Supports different binary formats, including JAR, WAR, EAR, ZIP, TAR, WHL, and
@@ -36,21 +37,23 @@ The `chainver` tool:
3637

3738
## Requirements
3839

39-
Before installing chainver, ensure you have the following installed and
40-
available on your path:
40+
Before using chainctl to verify libraries, ensure you have the following
41+
installed and available on your path:
4142

42-
- [`chainctl`](/chainguard/chainctl-usage/how-to-install-chainctl/)
43-
— A Chainguard-maintained tool used for authentication
43+
- [`chainctl`](/chainguard/chainctl-usage/how-to-install-chainctl/)
44+
Chainguard-maintained tool that includes the `libraries verify` command.
4445
- [`cosign`](https://docs.sigstore.dev/cosign/system_config/installation/) — A
45-
Sigstore-maintained tool used to verify signatures
46+
Sigstore-maintained tool used to verify signatures.
4647

4748
You also need:
4849

4950
- A Linux, macOS, or Windows system (x86_64 or arm64)
5051
- Sufficient [network access](/chainguard/libraries/network-requirements/)
52+
- Your organization [must include entitlement for access to Chainguard
53+
Libraries](/chainguard/libraries/access/#entitlement)
5154

52-
Confirm that `chainctl` and `cosign` are installed and available on the `PATH` with the following commands:
53-
commands:
55+
Confirm that `chainctl` and `cosign` are installed and available on the `PATH`
56+
with the following commands:
5457

5558
```sh
5659
chainctl version
@@ -60,58 +63,7 @@ chainctl version
6063
cosign version
6164
```
6265

63-
## Installation
64-
65-
[Download the latest release - version 0.5.0](https://dl.enforce.dev/chainver/0.5.0/chainver-v0.5.0.zip)
66-
67-
### Version-Agnostic Download
68-
69-
Download the latest release using `curl`. Note that [`jq`](https://jqlang.org/download/) must be on the path.
70-
71-
```sh
72-
LATEST_URL=$(curl -s https://dl.enforce.dev/chainver/latest/latest-metadata.json | jq -r '.download_url') && \
73-
curl -LO "${LATEST_URL}"
74-
```
75-
76-
Once you've downloaded the archive, unpack the platform specific archive for
77-
your system, and place the binary `chainver` for your platform on the path.
78-
79-
### Binary Install Script (macOS and Linux)
80-
81-
The following command downloads the latest version of `chainver` as an archive, extracts it, verifies the download, and moves the binary to `/usr/local/bin`.
82-
83-
First, set the `ARCH` variable to match your system using one of
84-
the following options:
85-
86-
- `Linux_x86_64` - Linux with x86_64 processor
87-
- `Linux_arm64` - Linux with ARM processor
88-
- `Darwin_arm64` - macOS with Apple Silicon (M1/M2/M3)
89-
- `Darwin_x86_64` - macOS with Intel processor
90-
91-
```sh
92-
ARCH=Linux_x86_64 && \
93-
LATEST=$(curl -s "https://storage.googleapis.com/us.artifacts.prod-enforce-fabc.appspot.com/?prefix=chainver/" | \
94-
grep -oE 'chainver/[0-9]+\.[0-9]+\.[0-9]+/' | \
95-
sed 's|chainver/||g' | sed 's|/$||g' | \
96-
sort -V | tail -1) && \
97-
curl -LO "https://dl.enforce.dev/chainver/${LATEST}/chainver-v${LATEST}.zip" && \
98-
unzip -q chainver-*.zip && \
99-
cd chainver-package && \
100-
EXT=$([ "$ARCH" = "Windows_x86_64" ] && echo "zip" || echo "tar.gz") && \
101-
./verify-signatures.sh archives/chainver_${LATEST}_${ARCH}.${EXT} && \
102-
if [ "$ARCH" = "Windows_x86_64" ]; then \
103-
unzip -q archives/chainver_${LATEST}_${ARCH}.zip; \
104-
else \
105-
tar xzf archives/chainver_${LATEST}_${ARCH}.tar.gz; \
106-
fi && \
107-
sudo mv chainver /usr/local/bin/ && \
108-
cd .. && rm -rf chainver-*.zip chainver-package && \
109-
chainver version
110-
```
111-
112-
## Authentication Setup
113-
114-
### Using chainctl
66+
## Authentication and configuration
11567

11668
You can authenticate with your Chainguard organization using `chainctl`. First,
11769
initiate the login flow:
@@ -120,109 +72,108 @@ initiate the login flow:
12072
chainctl auth login
12173
```
12274

123-
Log in using one of the provided options:
75+
If you are member of one organization only, you can proceed to use `libraries
76+
verify` and other commands.
12477

125-
Find your organization name:
78+
If you are member of multiple organizations you must provide the name of your
79+
organization using the `--parent` flag as follows, replacing
80+
`<your-organization>` with the name of your organization, with every command:
12681

12782
```sh
128-
chainctl iam organizations list
83+
chainctl libaries verify --parent <your-organization> /path/to/artifact.jar
12984
```
13085

131-
When using `chainver` commands, provide the name of your organization using the
132-
`--parent` flag as follows, replacing `<your-organization>` with the name of
133-
your organization:
86+
To avoid the need for the additional parameter, you can configure a default
87+
organization with the following steps:
88+
89+
Find your organization name with the entitlement:
13490

13591
```sh
136-
chainver --parent <your-organization> /path/to/artifact.jar
92+
chainctl iam organizations list
13793
```
13894

139-
### Using Tokens
140-
141-
For CI/CD pipelines or environments without `chainctl`, you can use a token.
142-
First, [create a pull token for Chainguard Libraries](/chainguard/libraries/access/#pull-token-for-libraries).
143-
144-
Once you have your token, you can authenticate by passing it to `chainver` using
145-
the `--token` flag:
95+
Set the configuration for the default group: TBD - this does NOT yet work, also maybe default.org-name instead??
14696

14797
```sh
148-
chainver --token <your-chainguard-token> /path/to/artifact.jar
98+
chainctl config set default.group <your-organization>
14999
```
150100

151-
Alternatively, set the token as an environment variable:
101+
Verify the configuration:
152102

153103
```sh
154-
export CHAINGUARD_TOKEN=your-chainguard-token
155-
chainver /path/to/artifact.jar
104+
chainctl config view
156105
```
157106

158-
The following environment variables are supported:
159-
160-
- `CHAINCTL_TOKEN` or `CHAINGUARD_TOKEN` - Authentication token
161-
- `JFROG_API_KEY` - JFrog Artifactory access
162-
- `CLOUDSMITH_API_KEY` - Cloudsmith access
107+
Ensure to use this configuration or add the `--parent` parameter in all
108+
following examples as necessary.
163109

164110
## Usage
165111

166112
Analyze a local `.jar` or `.whl` file:
167113

168114
```sh
169-
chainver --parent <your-organization> commons-lang3-3.12.0.jar
115+
chainctl libraries verify commons-lang3-3.12.0.jar
170116
```
171117

172118
Analyze a container image on a registry:
173119

174120
```sh
175-
chainver --parent <your-organization> cgr.dev/chainguard/nginx:latest
121+
chainctl libraries verify cgr.dev/chainguard/nginx:latest
176122
```
177123

178124
Analyze a local container:
179125

180126
```sh
181-
chainver redis:latest
182-
chainver nginx:alpine
183-
chainver ubuntu:20.04
127+
chainctl libraries verify redis:latest
128+
chainctl libraries verify nginx:alpine
129+
chainctl libraries verify ubuntu:20.04
184130
```
185131

186132
Analyze a local image with localhost prefix:
187133

188134
```sh
189-
chainver --parent <your-organization> localhost/myapp:latest
135+
chainctl libraries verify --parent <your-organization> localhost/myapp:latest
190136
```
191137

192-
Analyze with detailed output:
138+
Use the `--detailed` flag for more information about the performed verification
139+
steps:
193140

194141
```sh
195-
chainver --detailed /path/to/archive.zip
142+
chainctl libraries verify --detailed /path/to/archive.zip
196143
```
197144

145+
Use the `--verbose` flag for even more details.
146+
198147
Analyze multiple artifacts with detailed output:
199148

200149
```sh
201-
chainver --detailed artifact1.jar artifact2.zip
150+
chainctl libraries verify --detailed artifact1.jar artifact2.zip
202151
```
203152

204-
Receive JSON output for CI/CD integration:
153+
Receive JSON output:
205154

206155
```sh
207-
chainver -o json /path/to/artifact.jar
156+
chainver libraries verify -o json /path/to/artifact.jar
208157
```
209158

210-
Generate inventory from repository. (Note that passing a URL from the public Maven Central repository will return a negative result, i.e. `chainver` will indicate that packages were not built by Chainguard.)
159+
Generate inventory from repository. Note that passing a URL from the public
160+
Maven Central repository returns a negative result, because packages were not
161+
built by Chainguard.
211162

212163
```sh
213-
chainver inventory --ecosystem java remote:repo1.maven.org/maven2/org/apache
164+
chainctl libraries verify inventory --ecosystem java remote:repo1.maven.org/maven2/org/apache
214165
```
215166

216167
Analyze a remote artifact on Maven Central:
217168

218169
```sh
219-
chainver --parent <your-organization> remote:repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar
170+
chainctl libraries verify remote:repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar
220171
```
221172

222173
Analyze a remote artifact on PyPI:
223174

224175
```sh
225-
chainver --parent <your-organization> remote:files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl
176+
chainver libraries verify remote:files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl
226177
```
227178

228179
## Resources
@@ -231,6 +182,3 @@ chainver --parent <your-organization> remote:files.pythonhosted.org/packages/70/
231182
- [Chainguard Libraries Authentication](/chainguard/libraries/access/)
232183
- [Learning Lab: Chainguard Libraries for Java](/software-security/learning-labs/ll202505/)
233184
- [Learning Lab: Chainguard Libraries for Python](/software-security/learning-labs/ll202506/)
234-
235-
236-

0 commit comments

Comments
 (0)