How to add custom authentication script? #1767
Replies: 3 comments 3 replies
-
Hi 👋 You'll need to mount the scripts as a file like we are mounting the scan config into the ZAP Advanced container. apiVersion: "execution.securecodebox.io/v1"
kind: Scan
metadata:
name: "zap-example"
spec:
scanType: "zap-advanced-scan"
parameters:
# target URL including the protocol
- "-t"
- "http://juice-shop.default.svc:3000/"
volumeMounts:
- name: zap-auth-scripts
mountPath: /home/zap/.ZAP_D/scripts/scripts/authentication/auth-script.js
subPath: auth-script.js
readOnly: true
- name: zap-advanced-scan-config
mountPath: /home/securecodebox/configs/2-zap-advanced-scan.yaml
subPath: 2-zap-advanced-scan.yaml
readOnly: true
volumes:
- name: zap-auth-scripts
configMap:
name: zap-auth-scripts
- name: zap-advanced-scan-config
configMap:
name: zap-advanced-scan-config
---
kind: ConfigMap
apiVersion: v1
metadata:
name: zap-auth-scripts
data:
auth-script.js: |
// your js auth script |
Beta Was this translation helpful? Give feedback.
-
@J12934
As @dhavalsimaria I didn't face this error - I recon that maybe the current ZAP version used in secureCodeBox is below |
Beta Was this translation helpful? Give feedback.
-
Hi all, The examples in the zap-advanced documentation explain how to configure zap-advanced, but they forgot to detail how the Helm chart is set up for zap-advanced. Specifically, there are three containers: zap-parser, zap-advanced, and zap-stable in the zap-advanced Helm chart. All these containers share the scanner.extraVolumes configuration. All examples refer to how to configure the zap-advanced container, which is responsible for converting the provided configuration YAML and calling zap-stable. If you mount a config map with your js script for the zap-advanced container, zap-stable when it receives the request with the name, filepath, etc., will look for the file path in the zap-stable container, which is not mounted. Solution: |
Beta Was this translation helpful? Give feedback.
-
The configMaps of zap scan contain scripts that are readily available at location:
/home/zap/.ZAP_D/scripts/scripts/httpsender/Alert_on_HTTP_Response_Code_Errors.js
But I am not able to figure out how to add a custom authentication script that will be used to authenticate against API for ZAP-API-scan.
Grateful for any help here.
Beta Was this translation helpful? Give feedback.
All reactions