Skip to content

Commit

Permalink
Added explicit attestation for Redis
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed Oct 25, 2023
1 parent 12e802f commit 6690a93
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.jq-template.awk
.template-helper-functions.jq
4 changes: 3 additions & 1 deletion 6.0/alpine3.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ RUN set -eux; \
apk del --no-network .build-deps; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"redis-server-sbom","packages":[{"name":"redis-server","versionInfo":"6.0.20","SPDXID":"SPDXRef-Package--redis-server","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/[email protected]?os_name=alpine&os_version=3.18"}],"licenseDeclared":"BSD-3-Clause"}]}' > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
4 changes: 3 additions & 1 deletion 6.0/bookworm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ RUN set -eux; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"redis-server-sbom","packages":[{"name":"redis-server","versionInfo":"6.0.20","SPDXID":"SPDXRef-Package--redis-server","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/[email protected]?os_name=debian&os_version=bookworm"}],"licenseDeclared":"BSD-3-Clause"}]}' > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
4 changes: 3 additions & 1 deletion 6.2/alpine3.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ RUN set -eux; \
apk del --no-network .build-deps; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"redis-server-sbom","packages":[{"name":"redis-server","versionInfo":"6.2.14","SPDXID":"SPDXRef-Package--redis-server","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/[email protected]?os_name=alpine&os_version=3.18"}],"licenseDeclared":"BSD-3-Clause"}]}' > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
4 changes: 3 additions & 1 deletion 6.2/bookworm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ RUN set -eux; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"redis-server-sbom","packages":[{"name":"redis-server","versionInfo":"6.2.14","SPDXID":"SPDXRef-Package--redis-server","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/[email protected]?os_name=debian&os_version=bookworm"}],"licenseDeclared":"BSD-3-Clause"}]}' > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
4 changes: 3 additions & 1 deletion 7.0/alpine3.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ RUN set -eux; \
apk del --no-network .build-deps; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"redis-server-sbom","packages":[{"name":"redis-server","versionInfo":"7.0.14","SPDXID":"SPDXRef-Package--redis-server","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/[email protected]?os_name=alpine&os_version=3.18"}],"licenseDeclared":"BSD-3-Clause"}]}' > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
4 changes: 3 additions & 1 deletion 7.0/bookworm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ RUN set -eux; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"redis-server-sbom","packages":[{"name":"redis-server","versionInfo":"7.0.14","SPDXID":"SPDXRef-Package--redis-server","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/[email protected]?os_name=debian&os_version=bookworm"}],"licenseDeclared":"BSD-3-Clause"}]}' > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
4 changes: 3 additions & 1 deletion 7.2/alpine3.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ RUN set -eux; \
apk del --no-network .build-deps; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"redis-server-sbom","packages":[{"name":"redis-server","versionInfo":"7.2.2","SPDXID":"SPDXRef-Package--redis-server","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/[email protected]?os_name=alpine&os_version=3.18"}],"licenseDeclared":"BSD-3-Clause"}]}' > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
4 changes: 3 additions & 1 deletion 7.2/bookworm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ RUN set -eux; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"redis-server-sbom","packages":[{"name":"redis-server","versionInfo":"7.2.2","SPDXID":"SPDXRef-Package--redis-server","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/[email protected]?os_name=debian&os_version=bookworm"}],"licenseDeclared":"BSD-3-Clause"}]}' > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
17 changes: 16 additions & 1 deletion Dockerfile-alpine.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ include ".template-helper-functions" -}}
FROM alpine:{{ env.variant | ltrimstr("alpine") }}

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
Expand Down Expand Up @@ -89,7 +90,21 @@ RUN set -eux; \
apk del --no-network .build-deps; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo {{
{
name: "redis-server",
version: .version,
params: {
os_name: "alpine",
os_version: env.variant | ltrimstr("alpine")
},
licenses: [
"BSD-3-Clause"
]
} | sbom | tostring | @sh
}} > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
17 changes: 16 additions & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ include ".template-helper-functions" -}}
FROM debian:{{ env.variant }}-slim

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
Expand Down Expand Up @@ -107,7 +108,21 @@ RUN set -eux; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo {{
{
name: "redis-server",
version: .version,
params: {
os_name: "debian",
os_version: env.variant
},
licenses: [
"BSD-3-Clause"
]
} | sbom | tostring | @sh
}} > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
7 changes: 7 additions & 0 deletions apply-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ elif [ "$BASH_SOURCE" -nt "$jqt" ]; then
wget -qO "$jqt" 'https://github.com/docker-library/bashbrew/raw/9f6a35772ac863a0241f147c820354e4008edf38/scripts/jq-template.awk'
fi

jqf='.template-helper-functions.jq'
if [ -n "${BASHBREW_SCRIPTS:-}" ]; then
jqf="$BASHBREW_SCRIPTS/template-helper-functions.jq"
elif [ "$BASH_SOURCE" -nt "$jqf" ]; then
wget -qO "$jqf" 'https://github.com/docker-library/bashbrew/raw/master/scripts/template-helper-functions.jq'
fi

if [ "$#" -eq 0 ]; then
versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)"
eval "set -- $versions"
Expand Down

0 comments on commit 6690a93

Please sign in to comment.