Skip to content

Commit e2e8f6b

Browse files
committed
Signature verification should be disabled by default and reenabled in some cases
1 parent ae1e09b commit e2e8f6b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

test/kickstart-templates/includes/post-containers-sigstore.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ EOF
2222

2323
# Configure Red Hat containers policy to use the Red Hat public key, making
2424
# an exception for unofficial / unreleased images that are used by tests
25-
if [ -f /etc/containers/policy.json ] ; then
25+
if [ -e /etc/containers/policy.json ] && [ ! -e /etc/containers/policy.json.orig ]; then
2626
mv /etc/containers/policy.json /etc/containers/policy.json.orig
2727
fi
2828
cat > /etc/containers/policy.json <<'EOF'

test/kickstart-templates/includes/post-containers.cfg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,26 @@ cat > /etc/containers/registries.conf.d/999-microshift-mirror.conf <<'EOF'
3737
location = "REPLACE_MIRROR_HOSTNAME:REPLACE_MIRROR_PORT/microshift"
3838
insecure = true
3939
EOF
40+
41+
# Skip signature verification for all images by default.
42+
# Tests that support signature verification will overwrite this file and reenable
43+
# it for selected Red Hat registries.
44+
if [ -e /etc/containers/policy.json ] && [ ! -e /etc/containers/policy.json.orig ]; then
45+
mv /etc/containers/policy.json /etc/containers/policy.json.orig
46+
fi
47+
cat > /etc/containers/policy.json <<'EOF'
48+
{
49+
"default": [
50+
{
51+
"type": "insecureAcceptAnything"
52+
}
53+
],
54+
"transports":
55+
{
56+
"docker-daemon":
57+
{
58+
"": [{"type":"insecureAcceptAnything"}]
59+
}
60+
}
61+
}
62+
EOF

0 commit comments

Comments
 (0)