Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ tags:
- OWASP ZAP automation
- Authentication
description: This post describes how to automate ZAP to authenticate against an API
draft: true
---

<!-- TODO Change this -->
![A burning log](/img/blog/2022-02-24-burninglog.jpg)
Cover photo by [Ray Shrewsberry](https://unsplash.com/@ray12119) on [Unsplash](https://unsplash.com/photos/AXRYB88LAXs).
![A Robot Hand](/img/blog/2023-09-01-robot.jpg)
Cover photo by [@possessedphotography](https://unsplash.com/@possessedphotography) on [Unsplash](https://unsplash.com/de/fotos/jIBMSMs4_kA).

The [OWASP Zed Attack Proxy (ZAP)](https://www.zaproxy.org/) can be a powerful tool for pentesters and AppSec testing. However, some of its functionality can be a bit hard to wrap your head around at first. In this post, we will describe how to use one of the more powerful features of the software: Authentication and session management. First, we will show you how to develop an authentication script for a new, previously-unsupported authentication scheme, using the graphical ZAP interface. Afterwards, we will dive into how the same can be achieved inside the secureCodeBox using the newly-supported ZAP Automation Framework.

Expand Down Expand Up @@ -346,7 +344,7 @@ env:
urls:
includePaths:
excludePaths:
authentication: # Include your authentication method here
authentication: # Include your authentication method here
...
jobs:
...
Expand All @@ -366,7 +364,7 @@ data:

env: # The environment, mandatory
contexts : # List of 1 or more contexts, mandatory
- name: test-config # Name to be used to refer to this context in other jobs, mandatory
- name: test-config # Name to be used to refer to this context in other jobs, mandatory
urls:
- "https://.*.example.com"
includePaths:
Expand Down Expand Up @@ -442,7 +440,7 @@ kubectl create secret generic pwordsecret --from-literal='password=<PASSWORD>'
```

You can now include the secrets in the scan definition and reference them in the ConfigMap that defines the scan options.
The following defines two secrets for the use in JSON-based authentication. The secrets can be referenced in the ConfigMap via ${EMAIl} and ${PASS}.
The following defines two secrets for the use in JSON-based authentication. The secrets can be referenced in the ConfigMap via `${EMAIL}` and `${PASS}`.

```yaml
apiVersion: "execution.securecodebox.io/v1"
Expand Down Expand Up @@ -476,3 +474,10 @@ spec:
name: pwordsecret
key: password
```

## Conclusion

With this, you should have everything you need to use a custom authentication script with ZAP in the secureCodeBox.
Done right, scripting can become an indispensible part of your workflows for automated security scans, and enable you to gain a significantly improved scan coverage for applications that require authentication.
To get you started, the [ZAP Community Scripts](https://github.com/zaproxy/community-scripts) repository contains a wide variety of scripts for different purposes, which illustrate the different ways scripting can be used, and which can serve as a template for your own scripting.
We can't wait to see what you will do with the combined power of ZAP scripting and the secureCodeBox!
Binary file added static/img/blog/2023-09-01-robot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.