Ajout d'un pipeline Lighthouse
+ améliorations/corrections sur le pipeline d'audit W3AF
This commit is contained in:
54
resources/com/cadoles/lighthouse/Dockerfile
Normal file
54
resources/com/cadoles/lighthouse/Dockerfile
Normal file
@ -0,0 +1,54 @@
|
||||
FROM golang:1.11.4 as envtpl
|
||||
|
||||
ARG HTTP_PROXY=
|
||||
ARG HTTPS_PROXY=
|
||||
ARG http_proxy=
|
||||
ARG https_proxy=
|
||||
|
||||
RUN apt-get update -y && apt-get install -y git
|
||||
|
||||
RUN git clone https://github.com/subfuzion/envtpl /src \
|
||||
&& cd /src \
|
||||
&& git checkout v1.0.0 \
|
||||
&& CGO_ENABLED=0 GOOS=linux go build \
|
||||
-ldflags "-X main.AppVersionMetadata=$(date -u +%s)" \
|
||||
-a -installsuffix cgo -o ./bin/envtpl ./cmd/envtpl/.
|
||||
|
||||
FROM alpine:3.10
|
||||
|
||||
ARG HTTP_PROXY=
|
||||
ARG HTTPS_PROXY=
|
||||
ARG http_proxy=
|
||||
ARG https_proxy=
|
||||
|
||||
COPY --from=envtpl /src/bin/envtpl /usr/local/bin/envtpl
|
||||
|
||||
RUN apk add --no-cache \
|
||||
nss \
|
||||
freetype \
|
||||
freetype-dev \
|
||||
harfbuzz \
|
||||
ca-certificates \
|
||||
ttf-freefont \
|
||||
nodejs \
|
||||
npm \
|
||||
chromium
|
||||
|
||||
RUN npm install -g lighthouse
|
||||
|
||||
RUN adduser -D lighthouse
|
||||
|
||||
COPY run-audit.sh /usr/local/bin/run-audit
|
||||
RUN chmod +x /usr/local/bin/run-audit
|
||||
|
||||
COPY config.js.tmpl /home/lighthouse/config.js.tmpl
|
||||
|
||||
WORKDIR /home/lighthouse
|
||||
|
||||
RUN mkdir /home/lighthouse/reports
|
||||
|
||||
RUN chown -R lighthouse: /home/lighthouse
|
||||
|
||||
USER lighthouse
|
||||
|
||||
CMD /usr/local/bin/run-audit
|
4
resources/com/cadoles/lighthouse/config.js.tmpl
Normal file
4
resources/com/cadoles/lighthouse/config.js.tmpl
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
extends: 'lighthouse:default',
|
||||
settings: {},
|
||||
};
|
17
resources/com/cadoles/lighthouse/run-audit.sh
Normal file
17
resources/com/cadoles/lighthouse/run-audit.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
envtpl -o config.js /home/lighthouse/config.js.tmpl
|
||||
|
||||
mkdir -p reports
|
||||
rm -f reports/*
|
||||
|
||||
cd reports
|
||||
|
||||
lighthouse \
|
||||
--no-enable-error-reporting \
|
||||
--chrome-flags="--headless --disable-dev-shm-usage --no-sandbox --disable-gpu" \
|
||||
--config=../config.js \
|
||||
--output json --output html \
|
||||
--output-path=lighthouse \
|
||||
-- \
|
||||
"$LIGHTHOUSE_URL"
|
Reference in New Issue
Block a user