Skip to content

Commit 82d49bc

Browse files
committed
#2940 Update zap-automation-framework examples
Signed-off-by: Samreet Singh <samreet.singh@iteratec.com>
1 parent 3422c71 commit 82d49bc

6 files changed

Lines changed: 38 additions & 9 deletions

File tree

‎auto-discovery/kubernetes/.helm-docs.gotmpl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This example deploys [JuiceShop](https://owasp.org/www-project-juice-shop/) to a
4444
(You can find the kubernetes manifests for the deployment [here](./demo/juice-shop.yaml))
4545

4646
The AutoDiscovery will automatically pick up this new deployment and then starts a ZAP Scan against it.
47-
The scan created uses our `zap-advanced` ScanType by default, this can be changed with the `config.serviceAutoDiscovery.scanConfig.scanType` config on the autoDiscovery helm release.
47+
The scan created uses our `zap-automation-framework` ScanType by default, this can be changed with the `config.serviceAutoDiscovery.scanConfig.scanType` config on the autoDiscovery helm release.
4848

4949
When the ContainerAutoDiscovery is enabled, the AutoDiscovery can also create a trivy scan for each unique container image (having multiple pods with the same container will only create one scan). The scan type can be defined with `config.containerAutoDiscovery.scanConfig.scanType`.
5050
{{- end }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!--
2+
SPDX-FileCopyrightText: the secureCodeBox authors
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
This example generates a scan with the target specified as an environment variable instead in the target section of the ConfigMap. This gives more flexibility to use the same ConfigMap for different scans.
8+
You can find a template for a baseline scan with an active scan in the `template folder`.

‎scanners/zap-automation-framework/examples/demo-nginx-automation-scan/scan.yaml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ data:
1313
env: # The environment, mandatory
1414
contexts : # List of 1 or more contexts, mandatory
1515
- name: test-config # Name to be used to refer to this context in other jobs, mandatory
16-
urls: ["http://nginx.demo-targets.svc"] # A mandatory list of top level urls, everything under each url will be included
16+
urls: ["${TARGET_URL}"] # A mandatory list of top level urls, everything under each url will be included
1717
includePaths:
18-
- "http://nginx.demo-targets.svc/.*" # An optional list of regexes to include
18+
- "${TARGET_URL}" # An optional list of regexes to include
1919
excludePaths:
2020
- ".*socket\\.io.*"
2121
- ".*\\.png"
@@ -74,4 +74,7 @@ spec:
7474
volumes:
7575
- name: zap-automation-framework-config
7676
configMap:
77-
name: zap-automation-framework-config
77+
name: zap-automation-framework-config
78+
env:
79+
- name: TARGET_URL
80+
value: "http://nginx.demo-targets.svc/.*"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
SPDX-FileCopyrightText: the secureCodeBox authors
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
This example shows how to configure the `zap-automation-framework` to run an advanced scan.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!--
2+
SPDX-FileCopyrightText: the secureCodeBox authors
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
This example generates a scan with the target specified as an environment variable instead in the target section of the ConfigMap. This gives more flexibility to use the same ConfigMap for different scans.
8+
You can find a template for a baseline scan with an active scan in the `templates` folder.

‎scanners/zap-automation-framework/examples/demo-zap-baseline-scan/scan.yaml‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ data:
1212
1313
env: # The environment, mandatory
1414
contexts : # List of 1 or more contexts, mandatory
15-
- name: zap-baseline-automation-scan # Name to be used to refer to this context in other jobs, mandatory
16-
urls: ["http://juice-shop.demo-targets.svc:3000/"] # A mandatory list of top level urls, everything under each url will be included
15+
- name: baseline-config # Name to be used to refer to this context in other jobs, mandatory
16+
urls: ["${TARGET_URL}"] # A mandatory list of top level urls, everything under each url will be included
1717
jobs:
1818
- type: spider # The traditional spider - fast but doesnt handle modern apps so well
1919
parameters:
@@ -24,9 +24,9 @@ data:
2424
maxDuration: 5 # Int: The max time to wait for the passive scanner, default: 0 unlimited
2525
- type: report # Report generation
2626
parameters:
27-
template: traditional-xml # String: The template id, default : modern
28-
reportDir: /home/securecodebox/ # String: The directory into which the report will be written
29-
reportFile: zap-results # String: The report file name pattern, default: {{yyyy-MM-dd}}-ZAP-Report-[[site]]
27+
template: traditional-xml # String: The template id, default : modern
28+
reportDir: /home/securecodebox/ # String: The directory into which the report will be written
29+
reportFile: zap-results # String: The report file name pattern, default: {{yyyy-MM-dd}}-ZAP-Report-[[site]]
3030
risks: # List: The risks to include in this report, default all
3131
- high
3232
- medium
@@ -52,3 +52,6 @@ spec:
5252
- name: zap-baseline-automation-framework-config
5353
configMap:
5454
name: zap-baseline-automation-framework-config
55+
env:
56+
- name: TARGET_URL
57+
value: "http://juice-shop.demo-targets.svc:3000/"

0 commit comments

Comments
 (0)