Hi team,
I am trying to run zap baseline scan against my website which is protected by cloudflare. I am aware that I can pass the auth token in the header via the var env (
ZAP_AUTH_HEADER_VALUE, ZAP_AUTH_HEADER) .
To start I wanted to try out the scan on local before running it on k8, so my first attempt is to run it on local(Mac):
1. I exported the env var from my terminal
2. I launched the UI in the same terminal using the following cmd /Applications/OWASP\ ZAP.app/Contents/Java/zap.sh
3. I tried to run spider against the site, but the authorization header field is not showing in my request.

Second attempt on setting the env on the container in my k8 job:
Here is how my job looks like:
apiVersion: batch/v1
kind: Job
metadata:
name: zap-baseline
spec:
template:
metadata:
name: zap-baseline
spec:
serviceAccountName: owasp-zap
containers:
- name: zap-baseline
image: owasp/zap2docker-stable
env:
- name: ZAP_AUTH_HEADER
value: cf-access-token
- name: ZAP_AUTH_HEADER_VALUE
value: [redacted]
command:
- "/bin/sh"
- "-c"
volumeMounts:
- name: zap-volume
mountPath: /zap/wrk
restartPolicy: Never
volumes:
- name: zap-volume
emptyDir: {}
backoffLimit: 0
completions: 1
I am still getting the error below which I believe that is coming from the authentication error:
Automation plan warnings:
Job spider error accessing URL https://staging.endow.us status code returned : 404 expected 200
Am I doing it wrong? Why the header is not picking up the env var?
Thanks,
Jin Yu