Skip to content

Commit 4eb2f77

Browse files
authored
update README.md (#85)
1 parent bb45912 commit 4eb2f77

File tree

1 file changed

+80
-100
lines changed

1 file changed

+80
-100
lines changed

README.md

Lines changed: 80 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ By following this guide, you will learn how to build a verifiable, auditable tra
77

88
### **What You'll Accomplish**
99

10-
* **Build and Publish** a multi-platform Docker image.
11-
* **Attach Signed Evidence** to four distinct types of subjects:
12-
1. A **Generic Artifact** (a README.md file).
13-
2. A **Software Package** (eg: a Docker image, npm, go,…etc).
14-
3. A **Build Info** object (the CI build record).
15-
4. An immutable **Release Bundle v2**.
10+
* **Build and Publish** a multi-platform Docker image.
11+
* **Attach Signed Evidence** to four distinct types of subjects:
12+
1. A **Generic Artifact** (a README.md file).
13+
2. A **Software Package** (eg: a Docker image, npm, go,…etc).
14+
3. A **Build Info** object (the CI build record).
15+
4. An immutable **Release Bundle v2**.
1616
* **Understand the "Why"**: Learn how this chain of evidence enables secure, policy-based promotions.
1717

18-
### **The Evidence Journey:**
18+
### **The Evidence Journey:**
1919

2020
The GitHub Actions workflow (.github/workflows/build.yml) performs a sequence of operations to build a chain of trust. Evidence is attached at each critical step.
2121

2222
### **Note**
2323

24-
For more information about evidence on the JFrog platform, see [Evidence Management]([https://github.com/jfrog/Evidence-Examples/blob/main/README.md#bootstrapping](https://jfrog.com/help/r/jfrog-artifactory-documentation/evidence-management)).
24+
For more information about evidence on the JFrog platform, see [Evidence Management](https://jfrog.com/help/r/jfrog-artifactory-documentation/evidence-management).
2525

2626
```mermaid
2727
graph TD
@@ -44,57 +44,60 @@ graph TD
4444
4545
subgraph "4. Enable Governance"
4646
I --> J[Ready for Secure Promotion with Policy Checks];
47-
4847
end
49-
```
50-
48+
```
5149

52-
### **Getting Started: Prerequisites & Configuration**
50+
## Getting Started: Prerequisites & Configuration
5351

5452
Before running the workflow, please ensure you have the following set up.
5553

56-
## **Prerequisites**
54+
### Prerequisites
5755

58-
* Make sure JFrog CLI 2.65.0 or above is installed and in your system PATH. For installation instructions, see [Install JFrog CLI](https://github.com/jfrog/Evidence-Examples/blob/main/README.md#bootstrapping).
59-
* Make sure Artifactory can be used as a Docker registry. Please refer to [Getting Started with Artifactory as a Docker Registry](https://www.jfrog.com/confluence/display/JFROG/Getting+Started+with+Artifactory+as+a+Docker+Registry) in the JFrog Artifactory User Guide. You should end up with a Docker registry URL, which is mapped to a local Docker repository (or a virtual Docker repository with a local deployment target) in Artifactory. You'll need to know the name of the Docker repository to later collect the published image build-info.
60-
* Make sure the following repository variables are configured in GitHub settings:
61-
* ARTIFACTORY\_URL (location of your Artifactory installation)
62-
* BUILD\_NAME (planned name for the build of the Docker image)
63-
* BUNDLE\_NAME (planned name for the Release Bundle created from the build)
64-
* Make sure the following repository secrets are configured in GitHub settings:
65-
* ARTIFACTORY\_ACCESS\_TOKEN (access token used for authentication)
66-
* JF\_USER (your username in Artifactory)
67-
* PRIVATE\_KEY (the key used to sign evidence)
56+
Make sure JFrog CLI 2.65.0 or above is installed and in your system PATH. For installation instructions, see Install JFrog CLI.
6857

69-
**GitHub Secrets**
58+
Make sure Artifactory can be used as a Docker registry. Please refer to Getting Started with Artifactory as a Docker Registry in the JFrog Artifactory User Guide. You should end up with a Docker registry URL, which is mapped to a local Docker repository (or a virtual Docker repository with a local deployment target) in Artifactory. You'll need to know the name of the Docker repository to later collect the published image build-info.
7059

71-
| Secret Name | Description | Example Value |
72-
| :---- | :---- | :---- |
73-
| ARTIFACTORY\_ACCESS\_TOKEN | A valid JFrog Access Token with permissions to deploy and annotate. | |
74-
| JF\_USER | Your JFrog Platform username, used for the docker login action. | my-user |
75-
| PRIVATE\_KEY | The raw private key used to sign all evidence created in the workflow. | \-----BEGIN PRIVATE KEY-----... |
60+
Make sure the following repository variables are configured in GitHub settings:
7661

77-
**GitHub Variables**
62+
ARTIFACTORY_URL (location of your Artifactory installation)
7863

79-
| Variable Name | Description | Example Value |
80-
| :---- | :---- | :---- |
81-
| ARTIFACTORY\_URL | The base URL of your JFrog Platform instance. | https://mycompany.jfrog.io |
82-
| BUILD\_NAME | A unique name for the build information in Artifactory. | evidence-example-build |
83-
| BUNDLE\_NAME | The name of the Release Bundle that will be created. | evidence-example-bundle |
64+
BUILD_NAME (planned name for the build of the Docker image)
8465

85-
---
66+
BUNDLE_NAME (planned name for the Release Bundle created from the build)
8667

87-
### **The Evidence Journey: Step-by-Step**
68+
Make sure the following repository secrets are configured in GitHub settings:
8869

89-
This workflow demonstrates how evidence adds value at different levels of abstraction. For the complete implementation, please refer to the [build.yml workflow file](https://github.com/jfrog/Evidence-Examples/tree/main/.github/workflows/build.yml).
70+
ARTIFACTORY_ACCESS_TOKEN (access token used for authentication)
9071

91-
#### **Install JFrog CLI**
72+
JF_USER (your username in Artifactory)
9273

93-
This step uses the `jfrog/setup-jfrog-cli` action to install the JFrog CLI into the GitHub Actions runner and configures it with your Artifactory URL and access token.
74+
PRIVATE_KEY (the key used to sign evidence)
9475

76+
### GitHub Secrets
9577

78+
| Secret Name | Description | Example Value |
79+
|------------|-------------|---------------|
80+
| ARTIFACTORY_ACCESS_TOKEN | A valid JFrog Access Token with permissions to deploy and annotate. | |
81+
| JF_USER | Your JFrog Platform username, used for the docker login action. | my-user |
82+
| PRIVATE_KEY | The raw private key used to sign all evidence created in the workflow. | -----BEGIN PRIVATE KEY-----... |
9683

97-
```
84+
### GitHub Variables
85+
86+
| Variable Name | Description | Example Value |
87+
|--------------|-------------|---------------|
88+
| ARTIFACTORY_URL | The base URL of your JFrog Platform instance. | https://mycompany.jfrog.io |
89+
| BUILD_NAME | A unique name for the build information in Artifactory. | evidence-example-build |
90+
| BUNDLE_NAME | The name of the Release Bundle that will be created. | evidence-example-bundle |
91+
92+
## The Evidence Journey: Step-by-Step
93+
94+
This workflow demonstrates how evidence adds value at different levels of abstraction. For the complete implementation, please refer to the build.yml workflow file.
95+
96+
### Install JFrog CLI
97+
98+
This step uses the jfrog/setup-jfrog-cli action to install the JFrog CLI into the GitHub Actions runner and configures it with your Artifactory URL and access token.
99+
100+
```yaml
98101
jobs:
99102
Docker-build-with-evidence:
100103
runs-on: ubuntu-latest
@@ -108,13 +111,11 @@ jobs:
108111
- uses: actions/checkout@v4
109112
```
110113
111-
#### **Log In to the Artifactory Docker Registry**
112-
113-
Here, we securely log in to the Artifactory Docker registry. This step also sets up QEMU and Docker Buildx, which are required to build multi-platform Docker images (e.g., for `linux/amd64` and `linux/arm64`).
114+
### Log In to the Artifactory Docker Registry
114115
116+
Here, we securely log in to the Artifactory Docker registry. This step also sets up QEMU and Docker Buildx, which are required to build multi-platform Docker images (e.g., for linux/amd64 and linux/arm64).
115117
116-
117-
```
118+
```yaml
118119
- name: Log in to Artifactory Docker Registry
119120
uses: docker/login-action@v3
120121
with:
@@ -132,15 +133,11 @@ Here, we securely log in to the Artifactory Docker registry. This step also sets
132133
install: true
133134
```
134135
135-
---
136-
137-
### **Build the Docker Image**
136+
### Build the Docker Image
138137
139-
This step builds a multi-platform Docker image using the provided `Dockerfile` and pushes it to your Artifactory repository. The `jfrog rt build-docker-create` command captures the image details and associates them with a build name and number, laying the groundwork for creating build information.
138+
This step builds a multi-platform Docker image using the provided Dockerfile and pushes it to your Artifactory repository. The jfrog rt build-docker-create command captures the image details and temporarily associates them with a build name and number in the local JFrog CLI cache, laying the groundwork for creating the final Build Info object.
140139
141-
142-
143-
```
140+
```yaml
144141
- name: Build Docker image
145142
run: |
146143
URL=$(echo ${{ vars.ARTIFACTORY_URL }} | sed 's|^https://||')
@@ -151,33 +148,25 @@ This step builds a multi-platform Docker image using the provided `Dockerfile` a
151148
jfrog rt build-docker-create example-project-docker-dev --image-file build-metadata --build-name ${{ vars.BUILD_NAME }} --build-number ${{ github.run_number }}
152149
```
153150
154-
---
155-
156-
### **Attach Package Evidence**
157-
158-
Now we attach the first piece of evidence directly to the Docker image **package**. This signed evidence acts as a verifiable record, attesting that a specific action (like a signature from a CI process) was performed on this package version.
151+
### Attach Package Evidence
159152
153+
Now we attach the first piece of evidence directly to the Docker image package. This signed evidence acts as a verifiable record, attesting that a specific action (like a signature from a CI process) was performed on this package version.
160154
161-
162-
```
155+
```yaml
163156
- name: Evidence on docker
164157
run: |
165158
echo '{ "actor": "${{ github.actor }}", "date": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" }' > sign.json
166159
jf evd create --package-name example-project-app --package-version 32 --package-repo-name example-project-docker-dev \
167160
--key "${{ secrets.PRIVATE_KEY }}" \
168161
--predicate ./sign.json --predicate-type https://jfrog.com/evidence/signature/v1
169-
echo ' Evidence attached: `signature` '
162+
echo ' Evidence attached: `signature` '
170163
```
171164
172-
---
173-
174-
### **Upload README File and Associated Evidence**
165+
### Upload README File and Associated Evidence
175166
176-
To demonstrate that evidence can be attached to *any* artifact, not just packages, this step uploads the `README.md` file to a generic repository and attaches similar signed evidence to it.
167+
To demonstrate that evidence can be attached to any artifact, not just packages, this step uploads the README.md file to a generic repository and attaches similar signed evidence to it.
177168
178-
179-
180-
```
169+
```yaml
181170
- name: Upload readme file
182171
run: |
183172
jf rt upload ./README.md example-project-generic-dev/readme/${{ github.run_number }}/ --build-name ${{ vars.BUILD_NAME }} --build-number ${{ github.run_number }}
@@ -186,15 +175,13 @@ To demonstrate that evidence can be attached to *any* artifact, not just package
186175
--predicate ./sign.json --predicate-type https://jfrog.com/evidence/signature/v1
187176
```
188177
189-
---
178+
The crucial flags --build-name and --build-number in the jf rt upload command ensure this uploaded artifact is also added to the local build info record created in the previous step.
190179
191-
### **Publish Build Info and Attach Build Evidence**
180+
### Publish Build Info and Attach Build Evidence
192181
193-
This step aggregates all the artifacts and metadata captured so far (the Docker image and the README) into a comprehensive **Build Info** object in Artifactory. Immediately after, it attaches signed evidence to this entire build, attesting to the integrity of the build process itself.
182+
This step performs the final action: it aggregates all previously linked artifacts (the Docker image from build-docker-create and the README from jf rt upload) and their metadata, which are stored locally in the CLI's temporary cache, and publishes this comprehensive Build Info object to Artifactory. Immediately after, it attaches signed evidence to this entire build, attesting to the integrity of the build process itself.
194183
195-
196-
197-
```
184+
```yaml
198185
- name: Publish build info
199186
run: jfrog rt build-publish ${{ vars.BUILD_NAME }} ${{ github.run_number }}
200187

@@ -207,15 +194,11 @@ This step aggregates all the artifacts and metadata captured so far (the Docker
207194
echo ' Evidence attached: `build-signature` ' >> $GITHUB_STEP_SUMMARY
208195
```
209196
210-
---
211-
212-
### **Create a Release Bundle v2 from the Build**
213-
214-
The workflow now creates an immutable **Release Bundle** from the build we just published. This bundle is a tamper-proof, versioned collection that is ideal for promoting through your SDLC stages.
197+
### Create a Release Bundle v2 from the Build
215198
199+
The workflow now creates an immutable Release Bundle from the build we just published. This bundle is a tamper-proof, versioned collection that is ideal for promoting through your SDLC stages.
216200
217-
218-
```
201+
```yaml
219202
- name: Create release bundle
220203
run: |
221204
echo '{ "files": [ {"build": "'"${{ vars.BUILD_NAME }}/${{ github.run_number }}"'" } ] }' > bundle-spec.json
@@ -225,15 +208,11 @@ The workflow now creates an immutable **Release Bundle** from the build we just
225208
echo ' Release bundle ['${{ vars.BUNDLE_NAME }}']('${NAME_LINK}'):['${{ github.run_number }}']('${VER_LINK}') created' >> $GITHUB_STEP_SUMMARY
226209
```
227210
228-
---
229-
230-
### **Attach Release Bundle Evidence**
211+
### Attach Release Bundle Evidence
231212
232213
Finally, we attach signed evidence to the immutable Release Bundle itself. This could represent a successful integration test or final approval, providing a verifiable gate for promotion to production environments.
233214
234-
235-
236-
```
215+
```yaml
237216
- name: Evidence on release-bundle v2
238217
run: |
239218
echo '{ "actor": "${{ github.actor }}", "date": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" }' > rbv2_evidence.json
@@ -242,23 +221,24 @@ Finally, we attach signed evidence to the immutable Release Bundle itself. This
242221
jf evd create --release-bundle ${{ vars.BUNDLE_NAME }} --release-bundle-version ${{ github.run_number }} \
243222
--predicate ./rbv2_evidence.json --predicate-type https://jfrog.com/evidence/rbv2-signature/v1 \
244223
--key "${{ secrets.PRIVATE_KEY }}"
245-
echo ' Evidence attached: integration-test ' >> $GITHUB_STEP_SUMMARY
224+
echo ' Evidence attached: integration-test ' >> $GITHUB_STEP_SUMMARY
246225
```
247226
248-
---
249-
250-
### **Create an External Policy to Potentially Block Release Bundle Promotion**
227+
### Create an External Policy to Potentially Block Release Bundle Promotion
251228
252229
When the Evidence service is used in conjunction with JFrog Xray, each Release Bundle promotion generates evidence in the form of a CycloneDX SBOM. You can create a policy in an external tool (for example, a rego policy) that reviews the contents of the CycloneDX evidence file and decides whether to block the promotion (because the Release Bundle fails to meet all your organization's requirements for promotion to the next stage of your SDLC).
253230
254-
To see a sample rego policy, go [here](https://github.com/jfrog/Evidence-Examples/blob/main/policy/policy.rego). For more information about integrating Release Lifecycle Management and Evidence with Xray, see [Scan Release Bundles (v2) with Xray](https://jfrog.com/help/r/jfrog-artifactory-documentation/scan-release-bundles-v2-with-xray).
231+
To see a sample rego policy, go here. For more information about integrating Release Lifecycle Management and Evidence with Xray, see Scan Release Bundles (v2) with Xray.
232+
233+
## References
234+
235+
### Product Documentation:
236+
237+
- [Evidence Management Overview](https://jfrog.com/help/r/jfrog-artifactory-documentation/evidence-management)
238+
- [Getting Started with Artifactory as a Docker Registry](https://jfrog.com/help/r/jfrog-artifactory-documentation/getting-started-with-artifactory-as-a-docker-registry)
239+
- [Xray](https://jfrog.com/help/r/xray-release-information/xray-release-notes)
255240
256-
### **References**
241+
### JFrog CLI Documentation:
257242
258-
* **Product Documentation:**
259-
* [Evidence Management Overview](https://jfrog.com/help/r/jfrog-artifactory-documentation/evidence-management)
260-
* [Getting Started with Artifactory as a Docker Registry](https://www.jfrog.com/confluence/display/JFROG/Getting+Started+with+Artifactory+as+a+Docker+Registry)
261-
* [Scan Release Bundles (v2) with Xray](https://jfrog.com/help/r/jfrog-artifactory-documentation/scan-release-bundles-v2-with-xray)
262-
* **JFrog CLI Documentation:**
263-
* [JFrog CLI Command Reference](https://www.google.com/search?q=https://jfrog.com/help/r/jfrog-cli/jfrog-cli-command-reference)
264-
* [Release Lifecycle Management with CLI](https://www.google.com/search?q=https://jfrog.com/help/r/jfrog-cli/release-lifecycle-management)
243+
- [JFrog CLI Command Reference](https://jfrog.com/help/r/jfrog-applications-and-cli-documentation/jfrog-cli)
244+
- [Release Lifecycle Management with CLI](https://jfrog.com/help/r/jfrog-applications-and-cli-documentation/release-lifecycle-management)

0 commit comments

Comments
 (0)