Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AST-43960 Add support for Authentication Agent and authentication recording #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM checkmarx/dast:2.2.0
FROM checkmarx/dast:2.3.0

USER zap

Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ steps:
| fail_on | high | The minimum severity in which the action should fail | false |
| retry | 3 | Retry requests to AST on connection failure (default: 3) | false |
| retry_delay | 20 | Time between retries in seconds, use with retry (default: 20) | false |
| recording-path | ./recording.js | The path to the recording of the authentication process | false |
| proxy-url | http://myproxy.com | Override the proxy used by the ZAP Engine | false |
| proxy-port | 8088 | The port number for the proxy | false |
| poll-timeout | 600 | Poll timeout in seconds, for uploading results (default: 600) | false |
Expand Down Expand Up @@ -117,3 +118,27 @@ steps:
fail_on: "HIGH"
verbose: true
```

### API Scan with recording

```yaml
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Scan Iac with kics
- name: Checkmarx DAST Github Action
uses: Checkmarx/[email protected]
env:
CX_APIKEY: ${{ secrets.CX_ONE_API_KEY }}
with:
command: "api"
config: 'zap_api_config.yaml'
base_url: "localhost.cxast.net"
environment_id: "c608a51a-ec4e-4eef-81c4-a0241737efd7"
openapi: "swagger.yaml"
project_id: "fd093dde-b64a-466f-b2cd-8bf141b4db94"
recording-path: "recording_10_09_24.js"
fail_on: "HIGH"
verbose: true
```
4 changes: 4 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ inputs:
poll-ticker:
required: false
description: "Time interval between sending poll requests"
recording-path:
required: false
description: "The path to the recording of the authentication process"
runs:
using: docker
image: Dockerfile
Expand All @@ -94,3 +97,4 @@ runs:
- ${{ inputs.port }}
- ${{ inputs.poll-timeout }}
- ${{ inputs.poll-ticker }}
- ${{ inputs.recording-path }}
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ fi
[[ -n "$INPUT_PROXY_PORT" ]] && PROXY_PORT_PARAM="--proxy-port=$INPUT_PROXY_PORT"
[[ -n "$INPUT_POLL_TIMEOUT" ]] && POLL_TIMEOUT_PARAM="--poll-timeout=$INPUT_POLL_TIMEOUT"
[[ -n "$INPUT_POLL_INTERVAL" ]] && POLL_DELAY_PARAM="--poll-ticker=$INPUT_POLL_INTERVAL"
[[ -n "$INPUT_RECORDING_PATH" ]] && RECORDING_PATH="--recording-path=$INPUT_RECORDING_PATH"


####################
# Run DAST Scan #
####################
cd "$GITHUB_WORKSPACE" || exit
echo "${DATETIME} - INF : DAST command - dast $INPUT_COMMAND $ENVIRONMENT_ID_PARAM $INPUT_PARAM $BASE_URL_PARAM $OUTPUT_PARAM $TIMEOUT_PARAM $UPDATE_INTERVAL_PARAM $JVM_PROPERTIES_PARAM $LOG_LEVEL_PARAM $VERBOSE_PARAM $FAIL_ON_PARAM $OPENAPI_PARAM $POSTMAN_PARAM $RETRY_PARAM $RETRY_DELAY_PARAM $PROXY_URL_PARAM $PROXY_PORT_PARAM $POLL_TIMEOUT_PARAM $POLL_DELAY_PARAM"
echo "${DATETIME} - INF : DAST command - dast $INPUT_COMMAND $ENVIRONMENT_ID_PARAM $INPUT_PARAM $BASE_URL_PARAM $OUTPUT_PARAM $TIMEOUT_PARAM $UPDATE_INTERVAL_PARAM $JVM_PROPERTIES_PARAM $LOG_LEVEL_PARAM $VERBOSE_PARAM $FAIL_ON_PARAM $OPENAPI_PARAM $POSTMAN_PARAM $RETRY_PARAM $RETRY_DELAY_PARAM $PROXY_URL_PARAM $PROXY_PORT_PARAM $POLL_TIMEOUT_PARAM $POLL_DELAY_PARAM $RECORDING_PATH"

/app/bin "$INPUT_COMMAND" "$ENVIRONMENT_ID_PARAM" "$INPUT_PARAM" "$BASE_URL_PARAM" "$OUTPUT_PARAM" "$TIMEOUT_PARAM" "$UPDATE_INTERVAL_PARAM" "$JVM_PROPERTIES_PARAM" "$LOG_LEVEL_PARAM" "$VERBOSE_PARAM" "$FAIL_ON_PARAM" "$OPENAPI_PARAM" "$POSTMAN_PARAM" "$RETRY_PARAM" "$RETRY_DELAY_PARAM" "$PROXY_URL_PARAM" "$PROXY_PORT_PARAM" "$POLL_TIMEOUT_PARAM" "$POLL_DELAY_PARAM"
/app/bin "$INPUT_COMMAND" "$ENVIRONMENT_ID_PARAM" "$INPUT_PARAM" "$BASE_URL_PARAM" "$OUTPUT_PARAM" "$TIMEOUT_PARAM" "$UPDATE_INTERVAL_PARAM" "$JVM_PROPERTIES_PARAM" "$LOG_LEVEL_PARAM" "$VERBOSE_PARAM" "$FAIL_ON_PARAM" "$OPENAPI_PARAM" "$POSTMAN_PARAM" "$RETRY_PARAM" "$RETRY_DELAY_PARAM" "$PROXY_URL_PARAM" "$PROXY_PORT_PARAM" "$POLL_TIMEOUT_PARAM" "$POLL_DELAY_PARAM" "$RECORDING_PATH"