Skip to content

Commit

Permalink
Merge pull request #2 from datatheorem/rename-inputs
Browse files Browse the repository at this point in the history
Rename SIGNED_BINARY_PATH -> BINARY_PATH
  • Loading branch information
victowang authored Jul 15, 2024
2 parents 0d6d7df + e4ab05e commit 5607b93
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Add the following to your `pipeline.yml`:
```yml
steps:
- label: "Build Mobile App Binary"
# replace this step with your own logix to build the pre-prod mobile binary that you want to scan
# replace this step with your own logic to build the pre-prod mobile binary that you want to scan
command: "echo 'Example mobile binary build step...'"

- label: "Upload Mobile App Binary to Data Theorem for scanning"
plugins:
- datatheorem/data-theorem-mobile-secure:
UPLOAD_API_KEY: $(buildkite-agent secret get DT_UPLOAD_API_KEY)
SIGNED_BINARY_PATH: "app-debug.apk" # path to the pre-prod mobile binary built in the previous step
BINARY_PATH: "app-debug.apk" # path to the pre-prod mobile binary built in the previous step
```
### Example with optional `SOURCEMAP_PATH`:
Expand All @@ -30,19 +30,19 @@ An optional Java mapping.txt file for deobfuscating Android binaries.
```yml
steps:
- label: "Build Mobile App Binary"
# replace this step with your own logix to build the pre-prod mobile binary that you want to scan
# replace this step with your own logic to build the pre-prod mobile binary that you want to scan
command: "echo 'Example mobile binary build step...'"
- label: "Upload Mobile App Binary to Data Theorem for scanning"
plugins:
- datatheorem/data-theorem-mobile-secure:
UPLOAD_API_KEY: $(buildkite-agent secret get DT_UPLOAD_API_KEY)
SIGNED_BINARY_PATH: "app-debug.apk" # path to the pre-prod mobile binary built in the previous step
BINARY_PATH: "app-debug.apk" # path to the pre-prod mobile binary built in the previous step
SOURCEMAP_PATH: "mapping.txt" # path to mapping.txt
```

### Example with scan result polling
Optionally, you can configure the plugin to wait for the scan to complete and print out hte number of new security findings.
Optionally, you can configure the plugin to wait for the scan to complete and print out the number of new security findings.
To do this, add the extra flag `POLL_SCAN_RESULTS: true`
This mode will also require to set up a Data Theorem Mobile Results API Key
It can be retrieved or created at [DevSecOps -> Data Theorem Results API](https://www.securetheorem.com/devsecops/v2/results_api_access)
Expand All @@ -51,14 +51,14 @@ And set it as a secret accessible to your BuildKite pipeline.
```yml
steps:
- label: "Build Mobile App Binary"
# replace this step with your own logix to build the pre-prod mobile binary that you want to scan
# replace this step with your own logic to build the pre-prod mobile binary that you want to scan
command: "echo 'Example mobile binary build step...'"
- label: "Upload Mobile App Binary to Data Theorem for scanning"
plugins:
- datatheorem/data-theorem-mobile-secure:
UPLOAD_API_KEY: $(buildkite-agent secret get DT_UPLOAD_API_KEY)
SIGNED_BINARY_PATH: "app-debug.apk" # path to the pre-prod mobile binary built in the previous step
BINARY_PATH: "app-debug.apk" # path to the pre-prod mobile binary built in the previous step
POLL_SCAN_RESULTS: true
MOBILE_RESULTS_API_KEY: $(buildkite-agent secret get DT_MOBILE_RESULTS_API_KEY)
```
Expand All @@ -77,7 +77,7 @@ We recommend using [BuildKite Secrets](https://buildkite.com/docs/pipelines/secu
- On your agent cluster, define a secret named `DT_UPLOAD_API_KEY` and set the value to what you have retrieved from the Data Theorem Portal
- In the BuildKite pipeline definition, you can pass the API Key as `UPLOAD_API_KEY: $(buildkite-agent secret get DT_UPLOAD_API_KEY)` in the plugin's inputs

### `SIGNED_BINARY_PATH` (Required, string)
### `BINARY_PATH` (Required, string)
Path to the mobile binary (APK, IPA, APPX or XAP) to be scanned.

### `SOURCEMAP_PATH` (Optional, string)
Expand Down
6 changes: 3 additions & 3 deletions hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ if [ -z "$DT_UPLOAD_API_KEY" ]; then
fi

# Check if the environment variable is set
if [ -z "$BUILDKITE_PLUGIN_DATA_THEOREM_MOBILE_SECURE_SIGNED_BINARY_PATH" ]; then
echo "Error: Environment variable BUILDKITE_PLUGIN_DATA_THEOREM_MOBILE_SECURE_SIGNED_BINARY_PATH is not set."
if [ -z "$BUILDKITE_PLUGIN_DATA_THEOREM_MOBILE_SECURE_BINARY_PATH" ]; then
echo "Error: Environment variable BUILDKITE_PLUGIN_DATA_THEOREM_MOBILE_SECURE_BINARY_PATH is not set."
exit 1
fi

Expand All @@ -45,7 +45,7 @@ if [ -n "$source_map_path" ]; then
fi

# Get the file path from the environment variable
file_path="$BUILDKITE_PLUGIN_DATA_THEOREM_MOBILE_SECURE_SIGNED_BINARY_PATH"
file_path="$BUILDKITE_PLUGIN_DATA_THEOREM_MOBILE_SECURE_BINARY_PATH"

# Check if the file exists
if [ -f "$file_path" ]; then
Expand Down
4 changes: 2 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ configuration:
properties:
UPLOAD_API_KEY:
type: string
SIGNED_BINARY_PATH:
BINARY_PATH:
type: string
SOURCEMAP_PATH:
type: string
Expand All @@ -26,5 +26,5 @@ configuration:
type: string
required:
- UPLOAD_API_KEY
- SIGNED_BINARY_PATH
- BINARY_PATH
additionalProperties: false

0 comments on commit 5607b93

Please sign in to comment.