Skip to content

Commit b095368

Browse files
Andrew TriceCarlos Santana
andauthored
updated image signing and image mutation details (#469)
* updated image signing dand image mutation details Signed-off-by: Andrew Trice <amtrice@us.ibm.com> * removed dupe content Signed-off-by: Andrew Trice <amtrice@us.ibm.com> * updated signature config note Signed-off-by: Andrew Trice <amtrice@us.ibm.com> Co-authored-by: Carlos Santana <csantana@us.ibm.com>
1 parent 41c3635 commit b095368

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/reference/tools/container-image-security-enforcement.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,17 @@ If the image is being signed at copy-time, it can be specified as a parameter to
128128
skopeo --sign-by <KEY_FINGERPRINT> copy ${IMAGE_FROM_CREDS} docker://${IMAGE_FROM} docker://${IMAGE_TO}
129129
```
130130

131+
!!!note
132+
On Linux® and macOS: The default configuration for the signing tools is to store the signatures locally. Storing signatures locally can lead to signature verification failure because the signature is not in the registry. To fix this problem, you can modify or delete the configuration file. On Linux®, the configuration is saved in /etc/containers/registries.d/default.yaml. On macOS, the configuration file is saved in /usr/local/etc/containers/registries.d/default.yaml. If you sign images in your container registry, yet your deployments are failing with the message `policy denied the request: A signature was required, but no signature exists`, then the default configuration is likely saving your image signatures locally instead of pushing the signature to the registry API server and you need to modify the tools configuration.
133+
134+
135+
136+
131137
### Create image policies
132138

133-
Finally, image policies need to be created to instruct Portieris which keys should be used to sign images from specific container registries. These policies can be applied globally to the entire cluster using a `ClusterImagePolicy`, or to a specific namespace using an `ImagePolicy`. In those policies, rules can be defined for enforcement for specific container registries/namespaces, or globally to all container registries used by the cluster.
139+
Finally, image policies need to be created to instruct Portieris which keys should be used to sign images from specific container registries. These policies can be applied globally to the entire cluster using a `ClusterImagePolicy`, or to a specific namespace using an `ImagePolicy` resource. In those policies, rules can be defined for enforcement for specific container registries/namespaces, or globally to all container registries used by the cluster.
134140

135-
For example, the following `ClusterImagePolicy` enforces a policy that all images in the container registry `icr.io/mynamespace/*` must be signed by the public key that was earlier created and placed into the `image-signing-public-key` cluster secret.
141+
For example, the following `ClusterImagePolicy` enforces a policy that all images in the container registry `private.us.icr.io/mynamespace/*` must be signed by the public key that was earlier created and placed into the `image-signing-public-key` cluster secret. This policy should be updated for your own registry namespace and images.
136142

137143
```yaml
138144
apiVersion: portieris.cloud.ibm.com/v1
@@ -141,15 +147,17 @@ metadata:
141147
name: mynamespace-cluster-image-policy
142148
spec:
143149
repositories:
144-
- name: "icr.io/mynamespace/*"
150+
- name: "private.us.icr.io/mynamespace/*"
145151
policy:
152+
mutateImage: false
146153
simple:
147154
requirements:
148155
- type: "signedBy"
149156
keySecret: image-signing-public-key
150157
```
151158
152-
More information about policies and enforcement can be found in the [Portieris Policies documentation](https://github.com/IBM/portieris/blob/master/POLICIES.md)
159+
This policy also uses the `mutateImage:false` configuration so that the GitOps operations using ArgoCD do not enter an infinite loop due to mutated image paths.
160+
More information about [policies and enforcement](https://github.com/IBM/portieris/blob/master/POLICIES.md) and [image mutation](https://github.com/IBM/portieris#image-mutation-option) can be found in the Portieris Policies documentation.
153161

154162

155163
## Tekton tasks

0 commit comments

Comments
 (0)