Skip to content

Commit 53967c4

Browse files
author
Ben Sullivan
committed
Setup code analysis action
1 parent c176e65 commit 53967c4

File tree

3 files changed

+94
-1
lines changed

3 files changed

+94
-1
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Example Workflow Using SecureStack Action
2+
on: push
3+
jobs:
4+
security:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout repo for running code analysis within workflow
8+
id: checkout
9+
uses: actions/[email protected]
10+
with:
11+
fetch-depth: 0
12+
- name: Code Analysis Step
13+
id: code
14+
uses: SecureStackCo/actions-code@main
15+
with:
16+
securestack_api_key: ${{ secrets.SECURESTACK_API_KEY_SECRET }}
17+
securestack_app_id: 'a9ad205b-d519-4a95-833d-304b6e82be21'
18+
severity: critical
19+
language: node
20+
flags: '--path . --debug'

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1-
# actions-code
1+
# SecureStack GitHub Actions
2+
3+
A GitHub Action to execute SecureStack application attack surface analysis an application.
4+
5+
```
6+
name: Example Workflow Using SecureStack Action
7+
on: push
8+
jobs:
9+
security:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo for running code analysis within workflow
13+
id: checkout
14+
uses: actions/[email protected]
15+
with:
16+
fetch-depth: 0
17+
- name: Code Analysis Step
18+
id: code
19+
uses: SecureStackCo/actions-code@main
20+
with:
21+
securestack_api_key: ${{ secrets.SECURESTACK_API_KEY_SECRET }}
22+
securestack_app_id: 'a9ad205b-d519-4a95-833d-304b6e82be21'
23+
severity: critical
24+
language: node
25+
flags: '--path . --debug'
26+
```
27+
28+
## Getting your SecureStack API Key
29+
30+
1. Log in to [SecureStack](https://app.securestack.com) and go to the Profile -> GENERATE KEY screen.
31+
2. Generate an API key and copy the value.
32+
3. Paste into the value of a secret called SECURESTACK_API_KEY_SECRET in the GitHub repo settings.
33+
34+
## Getting your SecureStack Application ID
35+
36+
1. Log in to [SecureStack](https://app.securestack.com).
37+
2. Open the application you wish to analyse.
38+
3. Copy the value of the application id on the View Application screen.
39+
4. Paste into the value of the `securestack_app_id` action input for the step using the SecureStack action in your workflow.
40+
41+
42+
Made with 💜 by SecureStack

action.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'SecureStack Code Analysis'
2+
description: 'Execute SecureStack Code Analysis'
3+
inputs:
4+
securestack_api_key:
5+
description: 'SecureStack API key - generate an API key at https://app.securestack.com'
6+
required: true
7+
securestack_app_id:
8+
description: 'SecureStack Application ID - can be retrieved by accessing required application at https://app.securestack.com'
9+
required: true
10+
severity:
11+
description: 'Severities lower than this value will be reported in the workflow console but will not cause an error for the action; value should be one of: critical | high | medium | low'
12+
required: true
13+
language:
14+
description: 'Severities lower than this value will be reported in the workflow console but will not cause an error for the action; value should be one of: critical | high | medium | low'
15+
required: true
16+
flags:
17+
description: 'Optional flags for the bloodhound-cli code command'
18+
required: false
19+
default: ''
20+
runs:
21+
using: 'composite'
22+
steps:
23+
- name: Pull bloodhound-cli image
24+
shell: bash
25+
run: docker pull securestackau/bloodhound-cli
26+
- name: Run bloodhound-cli
27+
shell: bash
28+
env:
29+
BH_API_KEY: ${{ inputs.securestack_api_key }}
30+
BH_APP_ID: ${{ inputs.securestack_app_id }}
31+
BH_SEVERITY: ${{ inputs.severity }}
32+
run: docker run -e BH_API_KEY -e BH_APP_ID -e BH_SEVERITY securestackau/bloodhound-cli code -t ${{ inputs.language }} ${{ inputs.flags }}; echo $?

0 commit comments

Comments
 (0)