From 9b718458bd3a8277bd20d2ef66d60b5256cd3f87 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Tue, 24 Oct 2023 03:22:55 -0400 Subject: [PATCH] chore: sec tester integration test --- Earthfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Earthfile b/Earthfile index d8defd81..833841a9 100644 --- a/Earthfile +++ b/Earthfile @@ -87,6 +87,22 @@ integration-full-web-app-dir: RUN docker run --network=host lucky-image:latest END +# integration-sec-tester tests lucky full app with security tester enabled +integration-sec-tester: + FROM earthly/dind:alpine + COPY docker-compose.yml ./ + WITH DOCKER \ + --compose docker-compose.yml \ + --load lucky-image:latest=+integration-image-security + RUN --secret BRIGHT_TOKEN --secret BRIGHT_PROJECT_ID -- \ + docker run \ + --network=host \ + -e BRIGHT_TOKEN \ + -e BRIGHT_PROJECT_ID \ + lucky-image:latest \ + spec -Dwith_sec_tests + END + integration-base-image: RUN apt-get update \ && apt-get install -y postgresql-client ca-certificates curl gnupg \ @@ -165,3 +181,17 @@ integration-image-dir: RUN crystal run src/app.cr ENTRYPOINT ["crystal", "spec"] SAVE IMAGE lucky-image:dir + +integration-image-security: + FROM +integration-base-image + RUN npm install --global @neuralegion/nexploit-cli --unsafe-perm=true + RUN lucky init.custom test-project --with-sec-test + WORKDIR /workdir/test-project + RUN crystal tool format --check src spec config + RUN shards install + RUN crystal build src/start_server.cr + RUN crystal build src/test_project.cr + RUN crystal run src/app.cr + ENV LUCKY_ENV=test + ENV RUN_SEC_TESTER_SPECS=1 + SAVE IMAGE lucky-image:security