Skip to content

Commit 7729927

Browse files
Added Reversing Labs scan workflow (#765)
Co-authored-by: KunalOfficial <[email protected]>
1 parent dcf37dd commit 7729927

File tree

3 files changed

+166
-0
lines changed

3 files changed

+166
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
name: 'RL-Security-Scanner'
3+
description: 'Runs the Reversing Labs scanner on a specified artifact.'
4+
inputs:
5+
artifact-path:
6+
description: 'Path to the artifact to be scanned.'
7+
required: true
8+
version:
9+
description: 'Version of the artifact.'
10+
required: true
11+
12+
13+
runs:
14+
using: 'composite'
15+
steps:
16+
- name: Set up python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.10'
20+
21+
- name: Install Python dependencies
22+
shell: bash
23+
run: |
24+
pip install boto3 requests
25+
26+
- name: Configure AWS credentials
27+
uses: aws-actions/configure-aws-credentials@v1
28+
with:
29+
role-to-assume: ${{ env.PRODSEC_TOOLS_ARN }}
30+
aws-region: 'us-east-1'
31+
mask-aws-account-id: true
32+
33+
- name: Install RL Wrapper
34+
shell: bash
35+
run: |
36+
pip install rl-wrapper>=1.0.0 --index-url "https://${{ env.PRODSEC_TOOLS_USER }}:${{ env.PRODSEC_TOOLS_TOKEN }}@a0us.jfrog.io/artifactory/api/pypi/python-local/simple"
37+
38+
- name: Run RL Scanner
39+
shell: bash
40+
env:
41+
RLSECURE_LICENSE: ${{ env.RLSECURE_LICENSE }}
42+
RLSECURE_SITE_KEY: ${{ env.RLSECURE_SITE_KEY }}
43+
SIGNAL_HANDLER_TOKEN: ${{ env.SIGNAL_HANDLER_TOKEN }}
44+
PYTHONUNBUFFERED: 1
45+
run: |
46+
if [ ! -f "${{ inputs.artifact-path }}" ]; then
47+
echo "Artifact not found: ${{ inputs.artifact-path }}"
48+
exit 1
49+
fi
50+
51+
rl-wrapper \
52+
--artifact "${{ inputs.artifact-path }}" \
53+
--version "${{ inputs.version }}" \
54+
--name "${{ github.event.repository.name }}" \
55+
--repository "${{ github.repository }}" \
56+
--commit "${{ github.sha }}" \
57+
--build-env "github_actions" \
58+
--suppress_output
59+
60+
# Check the outcome of the scanner
61+
if [ $? -ne 0 ]; then
62+
echo "RL Scanner failed."
63+
echo "scan-status=failed" >> $GITHUB_ENV
64+
exit 1
65+
else
66+
echo "RL Scanner passed."
67+
echo "scan-status=success" >> $GITHUB_ENV
68+
fi
69+
70+
outputs:
71+
scan-status:
72+
description: 'The outcome of the scan process.'
73+
value: ${{ env.scan-status }}

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,30 @@ on:
77
workflow_dispatch:
88

99
permissions:
10+
id-token: write
1011
contents: write
1112

1213
### TODO: Replace instances of './.github/workflows/' w/ `auth0/dx-sdk-actions/workflows/` and append `@latest` after the common `dx-sdk-actions` repo is made public.
1314
### TODO: Also remove `get-prerelease`, `get-release-notes`, `get-version`, `maven-publish`, `release-create`, and `tag-exists` actions from this repo's .github/actions folder once the repo is public.
1415
### TODO: Also remove `java-release` workflow from this repo's .github/workflows folder once the repo is public.
1516

1617
jobs:
18+
rl-scanner:
19+
uses: ./.github/workflows/rl-scanner.yml
20+
with:
21+
java-version: 8.0.402-zulu
22+
artifact-name: 'auth0-release.aar'
23+
secrets:
24+
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
25+
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
26+
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
27+
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
28+
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
29+
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
30+
1731
release:
1832
uses: ./.github/workflows/java-release.yml
33+
needs: rl-scanner
1934
with:
2035
java-version: 8.0.402-zulu
2136
secrets:

.github/workflows/rl-scanner.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: RL-Security-Scanner
2+
run-name: rl-security-scanner
3+
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
java-version:
9+
required: true
10+
type: string
11+
artifact-name:
12+
required: true
13+
type: string
14+
secrets:
15+
RLSECURE_LICENSE:
16+
required: true
17+
RLSECURE_SITE_KEY:
18+
required: true
19+
SIGNAL_HANDLER_TOKEN:
20+
required: true
21+
PRODSEC_TOOLS_USER:
22+
required: true
23+
PRODSEC_TOOLS_TOKEN:
24+
required: true
25+
PRODSEC_TOOLS_ARN:
26+
required: true
27+
28+
29+
jobs:
30+
rl-scanner:
31+
name: Run Reversing Labs Scanner
32+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
33+
runs-on: ubuntu-latest
34+
outputs:
35+
scan-status: ${{ steps.rl-scan-conclusion.outcome }}
36+
37+
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
44+
- name: Build with gradle
45+
shell: bash
46+
run: ./gradlew :auth0:assembleRelease
47+
48+
- name: Get Artifact Version
49+
id: get_version
50+
run: |
51+
version=$(cat .version)
52+
echo "version=$version" >> $GITHUB_OUTPUT
53+
54+
- name: List build contents
55+
run: ls -la auth0/build/outputs/aar
56+
57+
- name: Output build artifact
58+
id: output_build_artifact
59+
run: |
60+
echo "scanfile=$(pwd)/auth0/build/outputs/aar/auth0-release-${{ steps.get_version.outputs.version }}.aar" >> $GITHUB_OUTPUT
61+
62+
63+
- name: Run Reversing Labs Scanner
64+
id: rl-scan-conclusion
65+
uses: ./.github/actions/rl-scanner
66+
with:
67+
artifact-path: "$(pwd)/auth0/build/outputs/aar/${{ inputs.artifact-name }}"
68+
version: "${{ steps.get_version.outputs.version }}"
69+
env:
70+
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
71+
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
72+
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
73+
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
74+
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
75+
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
76+
77+
- name: Output scan result
78+
run: echo "scan-status=${{ steps.rl-scan-conclusion.outcome }}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)