You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-25Lines changed: 60 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,10 +64,16 @@ Create the `sbs-config.json` file in any location you choose on your local machi
64
64
"DOCKER_RO_PASSWORD": "<docker_password>",
65
65
"DOCKER_BASE_USER": "",
66
66
"DOCKER_BASE_PASSWORD": "",
67
+
"ICR_BASE_REPO": "",
68
+
"ICR_BASE_REPO_PUBLIC_KEY": "",
67
69
"ENV_WHITELIST": ["<KEY1>", "<KEY2>"],
68
70
"ARG": {
69
71
"<BUILD_ARG1>": "<VALUE1>",
70
72
"<BUILD_ARG2>": "<VALUE2>"
73
+
},
74
+
"ISV_SECRET": {
75
+
"k1": "secret1",
76
+
"k2": "secret2"
71
77
}
72
78
}
73
79
```
@@ -76,7 +82,7 @@ Where
76
82
```
77
83
HOSTNAME - Hostname of the SBS server which will be used while generating certificates and communicating with the secure build server.
78
84
CICD_PORT - port on which a build service is running (default: 443).
79
-
IMAGE_TAG - image tag of the container image to be deployed as SBS server. Use "1.3.0.7" unless otherwise noted.
85
+
IMAGE_TAG - image tag of the container image to be deployed as SBS server. Use "1.3.0.8" unless otherwise noted.
80
86
GITHUB_KEY_FILE - Private key path to access your GitHub repo.
81
87
GITHUB_URL - GitHub URL.
82
88
GITHUB_BRANCH - GitHub branch name.
@@ -94,9 +100,15 @@ DOCKER_RO_USER - you can use the same as DOCKER_USER. It is recommended that you
94
100
DOCKER_RO_PASSWORD - you can use same as DOCKER_PASSWORD. It is recommended that you specify a user who has read access only to your Docker repository.
95
101
ENV_WHITELIST - All environment variable names need to be listed. The Hyper Protect Virtual Servers don't allow any environment variable unless it is in this list because of a security reason.
96
102
ARG - You have to pass all build argument parameters as you pass during Docker build.
103
+
ICR_BASE_REPO - Base Image used in dockerfile if it is present in ICR
104
+
ICR_BASE_REPO_PUBLIC_KEY - public key with which the base image used in docker file (ICR_BASE_REPO) is signed
105
+
ISV_SECRET - Use to provide the ISV secrets as a key and value pair. The secrets are added in the ``/isv_secrets/secrets.json` file within the IBM Hyper Protect Virtual server.
97
106
```
107
+
Note:
108
+
- If the base image used in Docker file is Red Hat signed on IBM Cloud Container Registry, you must provide the 'ICR_BASE_REPO', and 'ICR_BASE_REPO_PUBLIC_KEY' parameters. The following is an example for these two values:
- "ICR_BASE_REPO_PUBLIC_KEY" : `"<path to the public key>"`
98
111
99
-
Note:
100
112
- If you use IBM Cloud Registry instead of DockerHub registry, then you must use the following parameters:
101
113
102
114
```buildoutcfg
@@ -111,9 +123,13 @@ Note:
111
123
112
124
- The `<domain_name>` specifies the location of IBM Cloud Container Registry (e.g. `us.icr.io`). Select the domain name for one of [avilable regions](https://cloud.ibm.com/docs/Registry?topic=Registry-registry_overview#registry_regions).
113
125
If you are using the IBM Cloud Registry notary server, and you specified the `<domain_name>` as `us.icr.io`, then specify `https://notary.us.icr.io` as the value for `DOCKER_CONTENT_TRUST_PUSH_SERVER`.
114
-
As another example, if value of `DOCKER_REPO=de.icr.io`, then the value of `DOCKER_CONTENT_TRUST_PUSH_SERVER` would be `https://notary.de.icr.io`. To know more about IBM Cloud registry, see [Getting started with IBM Cloud Container Registry](https://cloud.ibm.com/docs/Registry?topic=Registry-getting-started).
126
+
As another example, if value of `DOCKER_REPO=de.icr.io`, then the value of `DOCKER_CONTENT_TRUST_PUSH_SERVER` should be `https://notary.de.icr.io`. To know more about IBM Cloud registry, see [Getting started with IBM Cloud Container Registry](https://cloud.ibm.com/docs/Registry?topic=Registry-getting-started).
127
+
128
+
- If the base image is in Docker Hub, then you must configure "DOCKER_CONTENT_TRUST_BASE" with a value "True", "DOCKER_CONTENT_TRUST_BASE_SERVER" is set with the notary server URL, and configure "DOCKER_BASE_USER" and "DOCKER_BASE_PASSWORD" with the credentials."
115
129
116
-
- If the base image is in a private repository, then you must configure "DOCKER_CONTENT_TRUST_BASE" with a value "True", "DOCKER_CONTENT_TRUST_BASE_SERVER" is set with the notary server URL, and configure "DOCKER_BASE_USER" and "DOCKER_BASE_PASSWORD" with the credentials."
130
+
- If the base image used in Docker file is Red Hat signed on IBM Cloud Container Registry, provide the path to the public key with which it is signed in the 'ICR_BASE_REPO_PUBLIC_KEY' parameter, and the base image used in the 'ICR_BASE_REPO' parameter. The following two parameters should also be set with the values as shown:
- When the base image is unsigned, set "DOCKER_CONTENT_TRUST_BASE" to "false". Also, you don't have to set the following parameters:
156
+
- "DOCKER_CONTENT_TRUST_BASE_SERVER": "",
157
+
- "DOCKER_BASE_USER": "",
158
+
- "DOCKER_BASE_PASSWORD": "",
159
+
138
160
139
161
Also see [Additional Build Parameters](additional-build-parameters.md).
140
162
141
163
## Deploying the Secure Build Server
142
164
143
-
Complete the following steps:
165
+
Complete the following steps:
144
166
145
167
1. Install the IBM Cloud CLI, and the HPVS plugin.
146
168
```buildoutcfg
@@ -182,9 +204,9 @@ Note: Update the IBM Cloud CLI if it is installed already.
182
204
"CERTPATH": "./sbs-keys/server-cert.pem",
183
205
```
184
206
Note:-
185
-
- Follow the best practices of certificate management.
186
-
- The CA certificate should not be compromised or revoked.
187
-
- Third-party certificates are not supported.
207
+
- Follow the best practices of certificate management.
208
+
- The CA certificate should not be compromised or revoked.
209
+
- Third-party certificates are not supported.
188
210
189
211
4. Use build.py to create the server certificate signed by the CA certificate generated that was generated in the previous step. It will be setup on the server for secure communication.
190
212
```buildoutcfg
@@ -198,13 +220,13 @@ Note: Update the IBM Cloud CLI if it is installed already.
198
220
199
221
6. Create the SBS instance on cloud. You can copy and paste the output from `instance-env` command as command-line parameters for the `instance-create` command.
- SBContainer is the name of the SBS instance to be created.
205
-
- lite-s is the plan name.
206
-
- dal13 is the region name.
207
-
- 1.3.0.7 is the image tag of Secure Docker Build docker image.
225
+
Where:
226
+
- SBContainer is the name of the SBS instance to be created.
227
+
- lite-s is the plan name.
228
+
- dal13 is the region name.
229
+
- 1.3.0.8 is the image tag of Secure Docker Build docker image.
208
230
- hostname is the server hostname that was given in sbs-config.json.
209
231
210
232
To know more details about which plan to use and which region to use, see [hpvs instance-create](https://cloud.ibm.com/docs/hpvs-cli-plugin?topic=hpvs-cli-plugin-hpvs_cli_plugin#create_instance).
@@ -280,16 +302,20 @@ When an error occurs, the `status` response shows the command that caused the er
280
302
To stop a long-running build process, refer to [How to stop and clean up a build process](README.md#how-to-stop-and-clean-up-a-build-process).
281
303
282
304
## How to deploy the image that is built by using SBS
The `<key_id>` is for a GPG key to sign the file. If omitted, the default id is `secure-build`. The email address
292
-
is used to identify the key. If omitted, the GPG library will pick up a default one, typically `<your_login_id>@<domain_name_of_client>`.
313
+
If you want to pass ISV SECRETS to the container, then pass the `--isv-secrets` flag and add the `ISV_SECRET` section in the `sbs-config.json` configuration file. The following is an example:
The `<key_id>` is for a GPG key to sign the file. If omitted, the default id is `secure-build`. The email address is used to identify the key. If omitted, the GPG library will pick up a default one, typically `<your_login_id>@<domain_name_of_client>`.
293
319
294
320
During the above command you will be asked to create a passphrase. Enter the passphrase twice (the second time is for confirmation). Then again passphrase will be asked to sign the file.
295
321
@@ -379,9 +405,9 @@ You will see a data and git folder.
379
405
380
406
## How to extract Public Key Used for Signing Container Image inside SBS
After you run this command, the <repo_name>'dct-public.key' template file is created, which contains the public key that is used to sign the container image.
410
+
After you run this command, the <repo_name>'public.key' template file is created, which contains the public key that is used to sign the container image.
385
411
386
412
## State image
387
413
The state image contains the private signing key, which is generated when a built image is pushed to a container registry for the first time. It is encrypted by using two SECRETS. One is generated by `build.py` and stored in your `sbs-config.json`. The other one is included in the SBS image.
When you save the state image to COS, you still get meta data of the state image in a local file of the same name as the state image file.
433
459
434
460
## How to recover the state image
435
-
Complete the following steps:
461
+
Complete the following steps:
436
462
437
463
1. Create a new SBS instance as mentioned in the section [Deploying the Secure Build Server](README.md#deploying-the-secure-build-server), with the same secret that was used to get the state image, otherwise the post state image operation fails.
438
464
@@ -565,7 +591,7 @@ Note: After the secret is updated, you cannot use a state image obtained using t
565
591
566
592
## Updating the Secure Build Server instance to the latest image
567
593
568
-
You can skip steps 1 to 4, when updating from SBS version 1.3.0.6 to 1.3.0.7.
594
+
You can skip steps 1 to 4, when updating from SBS version 1.3.0.7 to 1.3.0.8.
569
595
570
596
1. Export the state image as mentioned in the section [How to get the state image](README.md#how-to-get-the-state-image). This is to ensure that you have a backup.
571
597
@@ -592,7 +618,7 @@ You can skip steps 1 to 4, when updating from SBS version 1.3.0.6 to 1.3.0.7.
Image name de.icr.io/zaas-hpvsop-prod/secure-docker-build:1.3.0.7
649
+
Image name de.icr.io/zaas-hpvsop-prod/secure-docker-build:1.3.0.8
624
650
Environment CLIENT_CA=...
625
651
CLIENT_CRT=...
626
652
SERVER_CRT=...
@@ -630,7 +656,16 @@ Last image update 2021-12-06 05:13
630
656
Created 2021-12-06
631
657
```
632
658
659
+
8. Update the following parameters of the `sbs-config.json` configuration file:
660
+
- "build_image_tag": "1.3.0.8"
661
+
- If the base image used in Docker file is Red Hat signed on IBM Cloud Container Registry, you must provide the 'ICR_BASE_REPO', and 'ICR_BASE_REPO_PUBLIC_KEY' parameters.
662
+
- If the built image is pushed to IBM Cloud Container Registry, set "DOCKER_CONTENT_TRUST_PUSH_SERVER": "https://<domain_name>".
633
663
664
+
9. Update the SBS instance by running the following command:
0 commit comments