Skip to content

Commit

Permalink
Support for addition of SUT & Emissary strategies
Browse files Browse the repository at this point in the history
Add new bind mount to compose file for the App Tester to put ephemeral
files for the Emissary to consume.
Update .env.example for new bind mount.
Update README to mention new host mounted directory.
  • Loading branch information
binarymist committed Nov 18, 2021
1 parent f433869 commit 86204c1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
16 changes: 12 additions & 4 deletions README.md
Expand Up @@ -25,16 +25,24 @@ Clone this repository.

## app-emissary (Zap)

We use a .env file directly in the app-emissary directory for testing. We have created a .env.example file in the `app-emissary/` directory. Rename this to .env and set any values within appropriately.
We use a .env file directly in the app-emissary directory for testing. We have created a .env.example file in the app-emissary/ directory. Rename this to .env and set any values within appropriately.

**`ZAP_API_KEY`**
### `ZAP_API_KEY`

Make sure you have assigned a value to the `ZAP_API_KEY` environment variable.

The `ZAP_API_KEY` can be what ever you chose, just make sure that as well as defining it for app-emissary, you also add it to the app-scanner project configuration. The app-scanner project requires the Zap API Key to be configured in order to authenticate to Zap running in the Stage Two container. For the app-scanner project, this needs to be set in the following:
The `ZAP_API_KEY` can be what ever you chose, just make sure that as well as defining it for the app-emissary, you also add it to the app-scanner project configuration. The app-scanner project requires the Zap API Key to be configured in order to authenticate to Zap running in the Stage Two container. For the app-scanner project, this needs to be set in the following way in the configuration:
`{ "emissary": { "apiKey": <zap-api-key-here> } }`

**`HOST_ZAP_LOG4J_PROPERTIES_PATH`** and **`ZAP_LOG4J_PROPERTIES_PATH_MOUNT_TARGET`**
### `HOST_DIR_APP_SCANNER`

This environment variable along with the directory it refers to should have been set-up for the App _Tester_ as part of the [_orchestrator_ set-up](https://purpleteam-labs.com/doc/local/set-up/#orchestrator). Set this environment variable to the same value. This is the directory that the App _Tester_ puts ephemeral files for the app-emissary to consume.

### `ZAP_DIR_APP_SCANNER_MOUNT_TARGET`

This environment variable refers to the target directory (from the above host directory) mounted into the app-emissary container

### `HOST_ZAP_LOG4J_PROPERTIES_PATH` and `ZAP_LOG4J_PROPERTIES_PATH_MOUNT_TARGET`

If/when you need Zap debug logs you will also need to make sure the environment variables for the LOG4J debug configuration is added to the .env file.

Expand Down
8 changes: 7 additions & 1 deletion app-emissary/.env.example
@@ -1,4 +1,10 @@
ZAP_API_KEY=<zap-api-key-here>
# Permissions: This directory needs group rwx, and other r (for the Emissary to read).
# Both app-scanner and it's Emissary mount this directory.
# This environment variable and the same value is also required by the App Tester in the compose file of the purpleteam-orchestrator project.
HOST_DIR_APP_SCANNER=</mnt/your-spare-drive/purpleteam-app-scanner>
# The Emissary consumes files from this directory that the app-scaanner put there.
ZAP_DIR_APP_SCANNER_MOUNT_TARGET=/mnt/purpleteam-app-scanner
# Used to enable App Emissary debugging
HOST_ZAP_LOG4J_PROPERTIES_PATH=<absolute-path-to/purpleteam-s2-containers/app-emissary/log4j2.properties>
ZAP_LOG4J_PROPERTIES_PATH_MOUNT_TARGET=/home/zap/.ZAP/log4j2.properties

8 changes: 6 additions & 2 deletions app-emissary/docker-compose.yml
Expand Up @@ -31,8 +31,12 @@ services:
"-config",
"api.key=${ZAP_API_KEY}"
]
# Uncomment the bind mount to enable debug logs in Zap containers.
#volumes:
volumes:
- type: bind
# Same variables found in contOrc IAC variables.tf for cloud environment.
source: ${HOST_DIR_APP_SCANNER}
target: ${ZAP_DIR_APP_SCANNER_MOUNT_TARGET}
# Uncomment the bind mount to enable debug logs in Zap containers.
# - type: bind
# # Same variables found in contOrc IAC variables.tf for cloud environment.
# source: ${HOST_ZAP_LOG4J_PROPERTIES_PATH}
Expand Down

0 comments on commit 86204c1

Please sign in to comment.