Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: new testimages #1484

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions connaisseur/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Main method for Connaisseur. Start the web server.
"""

import os
from logging.config import dictConfig

Expand Down
6 changes: 3 additions & 3 deletions connaisseur/validators/cosign/cosign_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ def __get_envs(self):
# Extend the OS env vars only for passing to the subprocess below
env["DOCKER_CONFIG"] = f"/app/connaisseur-config/{self.name}/.docker/"
env["TUF_ROOT"] = "/app/.sigstore"
env[
"SIGSTORE_NO_CACHE"
] = "1" # Otherwise, Cosign will try to write cache files to disk
env["SIGSTORE_NO_CACHE"] = (
"1" # Otherwise, Cosign will try to write cache files to disk
)
if safe_path_func(
os.path.exists, "/app/certs/cosign", f"/app/certs/cosign/{self.name}.crt"
):
Expand Down
2 changes: 1 addition & 1 deletion scripts/get_root_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

async def get_pub_root_key(host: str, image: Image):
notary = Notary("no", host, ["not_empty"])
async with (aiohttp.ClientSession()) as session:
async with aiohttp.ClientSession() as session:
token = await notary.get_auth(session, image)
root_td = await notary.get_trust_data(session, image, TUFRole("root"), token)

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test_cases:
- id: rstd
txt: Testing signed image with tag and digest...
type: deploy
ref: securesystemsengineering/testimage:signed@sha256:fa65f55bd50c700fa691291d5b9d06b98cc7c906bc5bf4048683cb085f7c237b
ref: securesystemsengineering/testimage:signed@sha256:fe542477b92fb84c38eda9c824f6566d5c2536ef30af9c47152fa8a5fadb58dd
namespace: default
expected_msg: pod/pod-rstd-${RAND} created
expected_result: VALID
Expand All @@ -73,7 +73,7 @@ test_cases:
- id: recs
txt: Testing ephemeral container with signed image...
type: debug
ref: securesystemsengineering/testimage:signed@sha256:fa65f55bd50c700fa691291d5b9d06b98cc7c906bc5bf4048683cb085f7c237b
ref: securesystemsengineering/testimage:signed@sha256:fe542477b92fb84c38eda9c824f6566d5c2536ef30af9c47152fa8a5fadb58dd
namespace: default
expected_msg: Defaulting debug container name to debugger-
expected_result: VALID
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ regular_int_test() {
else
DEPLOYED_SHA=$(kubectl get "${POD}" -o yaml | yq e '.spec.containers[0].image' - | sed 's/.*sha256://')
kubectl get "${POD}" -o yaml | yq e '.spec.containers[0].image' - | sed 's/.*sha256://'
if [[ "${DEPLOYED_SHA}" != 'fa65f55bd50c700fa691291d5b9d06b98cc7c906bc5bf4048683cb085f7c237b' ]]; then
if [[ "${DEPLOYED_SHA}" != 'fe542477b92fb84c38eda9c824f6566d5c2536ef30af9c47152fa8a5fadb58dd' ]]; then
echo -e "${FAILED}"
EXIT="1"
else
Expand Down
12 changes: 12 additions & 0 deletions tests/testimages/double_sig/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM gcc@sha256:f993601701a37bef71e7f8fc1ef9410b09b15556f4371b06dcc10202cc81f9ea as builder

WORKDIR /

COPY main.c /main.c
RUN gcc -o /main -static /main.c

FROM scratch

COPY --from=builder /main /main

ENTRYPOINT ["./main"]
11 changes: 11 additions & 0 deletions tests/testimages/double_sig/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <unistd.h>
#include <sys/syscall.h>

const char message[] = "Double_sig.\n";

int main()
{
syscall(SYS_write, STDOUT_FILENO, message, sizeof(message) - 1);
pause();
return 0;
}
12 changes: 12 additions & 0 deletions tests/testimages/signed/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM gcc@sha256:f993601701a37bef71e7f8fc1ef9410b09b15556f4371b06dcc10202cc81f9ea as builder

WORKDIR /

COPY main.c /main.c
RUN gcc -o /main -static /main.c

FROM scratch

COPY --from=builder /main /main

ENTRYPOINT ["./main"]
11 changes: 11 additions & 0 deletions tests/testimages/signed/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <unistd.h>
#include <sys/syscall.h>

const char message[] = "Signed.\n";

int main()
{
syscall(SYS_write, STDOUT_FILENO, message, sizeof(message) - 1);
pause();
return 0;
}
12 changes: 12 additions & 0 deletions tests/testimages/special_sig/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM gcc@sha256:f993601701a37bef71e7f8fc1ef9410b09b15556f4371b06dcc10202cc81f9ea as builder

WORKDIR /

COPY main.c /main.c
RUN gcc -o /main -static /main.c

FROM scratch

COPY --from=builder /main /main

ENTRYPOINT ["./main"]
11 changes: 11 additions & 0 deletions tests/testimages/special_sig/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <unistd.h>
#include <sys/syscall.h>

const char message[] = "Special_sig.\n";

int main()
{
syscall(SYS_write, STDOUT_FILENO, message, sizeof(message) - 1);
pause();
return 0;
}
12 changes: 12 additions & 0 deletions tests/testimages/unsigned/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM gcc@sha256:f993601701a37bef71e7f8fc1ef9410b09b15556f4371b06dcc10202cc81f9ea as builder

WORKDIR /

COPY main.c /main.c
RUN gcc -o /main -static /main.c

FROM scratch

COPY --from=builder /main /main

ENTRYPOINT ["./main"]
11 changes: 11 additions & 0 deletions tests/testimages/unsigned/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <unistd.h>
#include <sys/syscall.h>

const char message[] = "Unsigned.\n";

int main()
{
syscall(SYS_write, STDOUT_FILENO, message, sizeof(message) - 1);
pause();
return 0;
}
12 changes: 12 additions & 0 deletions tests/testimages/wrong_signer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM gcc@sha256:f993601701a37bef71e7f8fc1ef9410b09b15556f4371b06dcc10202cc81f9ea as builder

WORKDIR /

COPY main.c /main.c
RUN gcc -o /main -static /main.c

FROM scratch

COPY --from=builder /main /main

ENTRYPOINT ["./main"]
11 changes: 11 additions & 0 deletions tests/testimages/wrong_signer/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <unistd.h>
#include <sys/syscall.h>

const char message[] = "Wrong_signer.\n";

int main()
{
syscall(SYS_write, STDOUT_FILENO, message, sizeof(message) - 1);
pause();
return 0;
}
Loading