mirror of
https://github.com/optim-enterprises-bv/secureblue.git
synced 2025-11-07 22:03:10 +00:00
Merge pull request #117 from gerblesh/image-signing
refactor: clean up image signing to line up more with upstream
This commit is contained in:
@@ -29,8 +29,6 @@ COPY usr /usr
|
|||||||
|
|
||||||
# Copy public key
|
# Copy public key
|
||||||
COPY cosign.pub /usr/etc/pki/containers/cosign.pub
|
COPY cosign.pub /usr/etc/pki/containers/cosign.pub
|
||||||
# Copy base signing config
|
|
||||||
COPY usr/etc/containers /usr/etc/
|
|
||||||
|
|
||||||
# Copy the recipe that we're building.
|
# Copy the recipe that we're building.
|
||||||
COPY ${RECIPE} /usr/share/ublue-os/recipe.yml
|
COPY ${RECIPE} /usr/share/ublue-os/recipe.yml
|
||||||
|
|||||||
@@ -22,12 +22,6 @@ YAFTI_ENABLED="$(get_yaml_string '.firstboot.yafti')"
|
|||||||
# Welcome.
|
# Welcome.
|
||||||
echo "Building custom Fedora ${FEDORA_VERSION} from image: \"${BASE_IMAGE}\"."
|
echo "Building custom Fedora ${FEDORA_VERSION} from image: \"${BASE_IMAGE}\"."
|
||||||
|
|
||||||
# Setup container signing
|
|
||||||
echo "Setup container signing in policy.json and cosign.yaml"
|
|
||||||
echo "Registry to write: $IMAGE_REGISTRY"
|
|
||||||
sed -i "s ghcr.io/ublue-os $IMAGE_REGISTRY g" /usr/etc/containers/policy.json
|
|
||||||
sed -i "s ghcr.io/ublue-os $IMAGE_REGISTRY g" /usr/etc/containers/registries.d/cosign.yaml
|
|
||||||
|
|
||||||
# Add custom repos.
|
# Add custom repos.
|
||||||
get_yaml_array repos '.rpm.repos[]'
|
get_yaml_array repos '.rpm.repos[]'
|
||||||
if [[ ${#repos[@]} -gt 0 ]]; then
|
if [[ ${#repos[@]} -gt 0 ]]; then
|
||||||
@@ -111,5 +105,20 @@ if [[ "${YAFTI_ENABLED}" == "true" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Setup container signing
|
||||||
|
echo "Setup container signing in policy.json and cosign.yaml"
|
||||||
|
echo "Registry to write: $IMAGE_REGISTRY"
|
||||||
|
|
||||||
|
jq '.transports.docker."$IMAGE_REGISTRY" += [{
|
||||||
|
"type": "sigstoreSigned",
|
||||||
|
"keyPath": "/usr/etc/pki/containers/cosign.pub",
|
||||||
|
"signedIdentity": {
|
||||||
|
"type": "matchRepository"
|
||||||
|
}
|
||||||
|
}]' /usr/etc/containers/policy.json > /usr/etc/containers/policy.json
|
||||||
|
|
||||||
|
cp /usr/etc/containers/registries.d/ublue-os.yaml /usr/etc/containers/registries.d/cosign.yaml
|
||||||
|
sed -i "s ghcr.io/ublue-os $IMAGE_REGISTRY g" /usr/etc/containers/registries.d/cosign.yaml
|
||||||
|
|
||||||
# Run "post" scripts.
|
# Run "post" scripts.
|
||||||
run_scripts "post"
|
run_scripts "post"
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
{
|
|
||||||
"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/ublue-os": [
|
|
||||||
{
|
|
||||||
"type": "sigstoreSigned",
|
|
||||||
"keyPath": "/usr/etc/pki/containers/cosign.pub",
|
|
||||||
"signedIdentity": {
|
|
||||||
"type": "matchRepository"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"": [
|
|
||||||
{
|
|
||||||
"type": "insecureAcceptAnything"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"docker-daemon": {
|
|
||||||
"": [
|
|
||||||
{
|
|
||||||
"type": "insecureAcceptAnything"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"atomic": {
|
|
||||||
"": [
|
|
||||||
{
|
|
||||||
"type": "insecureAcceptAnything"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"dir": {
|
|
||||||
"": [
|
|
||||||
{
|
|
||||||
"type": "insecureAcceptAnything"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"oci": {
|
|
||||||
"": [
|
|
||||||
{
|
|
||||||
"type": "insecureAcceptAnything"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"tarball": {
|
|
||||||
"": [
|
|
||||||
{
|
|
||||||
"type": "insecureAcceptAnything"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
docker:
|
|
||||||
ghcr.io/ublue-os:
|
|
||||||
use-sigstore-attachments: true
|
|
||||||
Reference in New Issue
Block a user