-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
verify_build | ||
============ | ||
|
||
Installs necessary public key and related files to verify the resulting OCI container image. This | ||
will allow us to transition from using `ostree-unverified-registry` to `ostree-image-signed` | ||
knowing that the image has been signed with the prescribed key. | ||
|
||
Requirements | ||
------------ | ||
|
||
Uses the following modules: | ||
|
||
* [ansible.builtin.file](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html) | ||
* [ansible.builtin.copy](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html) | ||
|
||
Role Variables | ||
-------------- | ||
|
||
None | ||
|
||
Dependencies | ||
------------ | ||
|
||
This role requires creation of a [Sigstore Cosign key](https://docs.sigstore.dev/key_management/signing_with_self-managed_keys/). | ||
|
||
Example Adhoc Run | ||
----------------- | ||
|
||
`ansible-playbook -i hosts -l this_host -K roles/verify_build/playbook.yml` | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
- hosts: all | ||
roles: | ||
- { role: verify_build } | ||
|
||
License | ||
------- | ||
|
||
BSD | ||
|
||
Author Information | ||
------------------ | ||
|
||
* Jim Campbell ([email protected]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEMZNJmj3MTowdPApZp7MkiqC4jEkz | ||
Rpa8c7+cf3go+AHLxd36AOPgSLtsQqEgN7YfpTLtI7zzmNzVWSXBxxYs/A== | ||
-----END PUBLIC KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
docker: | ||
ghcr.io/j1mc: | ||
use-sigstore-attachments: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"default": [ | ||
{ | ||
"type": "reject" | ||
} | ||
], | ||
"transports": { | ||
"docker": { | ||
"registry.access.redhat.com": [ | ||
{ | ||
"type": "signedBy", | ||
"keyType": "GPGKeys", | ||
"keyPath": "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release" | ||
} | ||
], | ||
"registry.redhat.io": [ | ||
{ | ||
"type": "signedBy", | ||
"keyType": "GPGKeys", | ||
"keyPath": "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release" | ||
} | ||
], | ||
"ghcr.io/j1mc": [ | ||
{ | ||
"type": "sigstoreSigned", | ||
"keyPath": "/usr/etc/pki/containers/j1mc-cosign.pub", | ||
"signedIdentity": { | ||
"type": "matchRepository" | ||
} | ||
} | ||
], | ||
"": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
}, | ||
"docker-daemon": { | ||
"": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
}, | ||
"atomic": { | ||
"": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
}, | ||
"containers-storage": { | ||
"": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
}, | ||
"dir": { | ||
"": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
}, | ||
"oci": { | ||
"": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
}, | ||
"oci-archive": { | ||
"": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
}, | ||
"docker-archive": { | ||
"": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
}, | ||
"tarball": { | ||
"": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
galaxy_info: | ||
author: Jim Campbell | ||
description: Installs files and keys needed to validate the signed image | ||
company: None | ||
|
||
license: BSD | ||
|
||
min_ansible_version: 5.1 | ||
|
||
galaxy_tags: [] | ||
|
||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
# tasks file for verify_build | ||
|
||
- name: Ensure necessary directories are present | ||
ansible.builtin.file: | ||
path: {{ item }} | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
loop: | ||
- /usr/etc/pki/containers/ | ||
- /usr/etc/containers/registries.d/ | ||
|
||
- name: Copy public key and key-verification yaml file to appropriate directories | ||
ansible.builtin.copy: | ||
src: files/{{ item.name }} | ||
dest: {{ item.path }} | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
loop: | ||
- {name: 'j1mc-cosign.pub', path: '/usr/etc/pki/containers/j1mc-cosign.pub'} | ||
- {name: 'j1mc.yaml', path: '/usr/etc/containers/registries.d/j1mc.yaml'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- hosts: all | ||
roles: | ||
- { role: verify_build } |