Skip to content

Commit 37583b0

Browse files
authored
Add --no-cosign-verify flag to disable Cosign signature verification (#251)
When using the builder for local development builds, Cosign signing adds unnecessary complexity. However, if the images are not signed, the cache can't be used because verifying the image fails. Add new flag to explicitly disable verification of the signature which can be used for these scenarios.
1 parent 99bc913 commit 37583b0

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ Options:
158158
Security:
159159
--cosign
160160
Enable signing images with cosign.
161+
--no-cosign-verify
162+
Disable image signature validation.
161163
```
162164
163165
## Local installation

builder.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DOCKER_LOCAL=false
2020
SELF_CACHE=false
2121
CUSTOM_CACHE_TAG=
2222
COSIGN=false
23+
COSIGN_VERIFY=true
2324
RELEASE_TAG=false
2425
GIT_REPOSITORY=
2526
GIT_BRANCH="master"
@@ -142,6 +143,8 @@ Options:
142143
Security:
143144
--cosign
144145
Enable signing images with cosign.
146+
--no-cosign-verify
147+
Disable image signature validation.
145148
EOF
146149

147150
bashio::exit.nok
@@ -784,6 +787,11 @@ function cosign_verify() {
784787

785788
local success=false
786789

790+
if bashio::var.false "${COSIGN_VERIFY}"; then
791+
bashio::log.warning "Validation of ${image} signature is disabled"
792+
return 0
793+
fi
794+
787795
# Support scratch image
788796
if [ "$image" == "scratch" ]; then
789797
bashio::log.info "Scratch image, skiping validation with cosign"
@@ -880,6 +888,9 @@ while [[ $# -gt 0 ]]; do
880888
--cosign)
881889
COSIGN=true
882890
;;
891+
--no-cosign-verify)
892+
COSIGN_VERIFY=false
893+
;;
883894
--cache-tag)
884895
CUSTOM_CACHE_TAG=$2
885896
shift

0 commit comments

Comments
 (0)