Skip to content

Commit dadd55c

Browse files
authored
Add rl scanner (#199)
1 parent d271de9 commit dadd55c

File tree

3 files changed

+161
-0
lines changed

3 files changed

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

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,31 @@ on:
88

99
permissions:
1010
contents: write
11+
id-token: write # This is required for requesting the JWT
12+
1113

1214
### 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.
1315
### 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.
1416
### TODO: Also remove `java-release` workflow from this repo's .github/workflows folder once the repo is public.
1517

1618
jobs:
19+
20+
rl-scanner:
21+
uses: ./.github/workflows/rl-secure.yml
22+
with:
23+
java-version: 8
24+
artifact-name: "jwks-rsa-java.tgz"
25+
secrets:
26+
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
27+
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
28+
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
29+
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
30+
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
31+
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
32+
1733
release:
1834
uses: ./.github/workflows/java-release.yml
35+
needs: rl-scanner
1936
with:
2037
java-version: 8.0.382-tem
2138
is-android: false

.github/workflows/rl-secure.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: RL-Secure Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
java-version:
7+
required: true
8+
type: string
9+
artifact-name:
10+
required: true
11+
type: string
12+
secrets:
13+
RLSECURE_LICENSE:
14+
required: true
15+
RLSECURE_SITE_KEY:
16+
required: true
17+
SIGNAL_HANDLER_TOKEN:
18+
required: true
19+
PRODSEC_TOOLS_USER:
20+
required: true
21+
PRODSEC_TOOLS_TOKEN:
22+
required: true
23+
PRODSEC_TOOLS_ARN:
24+
required: true
25+
26+
jobs:
27+
checkout-build-scan-only:
28+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
29+
runs-on: ubuntu-latest
30+
outputs:
31+
scan-status: ${{ steps.rl-scan-conclusion.outcome }}
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v3
36+
with:
37+
fetch-depth: 0
38+
39+
- name: Set up Java
40+
uses: actions/setup-java@v4
41+
with:
42+
distribution: temurin
43+
java-version: ${{ inputs.java-version }}
44+
45+
- name: Build with Gradle
46+
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c
47+
with:
48+
arguments: assemble apiDiff check jacocoTestReport --continue --console=plain
49+
50+
- name: Get Artifact Version
51+
id: get_version
52+
uses: ./.github/actions/get-version
53+
54+
- name: Create tgz build artifact
55+
run: |
56+
tar -czvf ${{ inputs.artifact-name }} *
57+
58+
- name: Run RL Scanner
59+
id: rl-scan-conclusion
60+
uses: ./.github/actions/rl-scanner
61+
with:
62+
artifact-path: "$(pwd)/${{ inputs.artifact-name }}"
63+
version: "${{ steps.get_version.outputs.version }}"
64+
env:
65+
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
66+
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
67+
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
68+
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
69+
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
70+
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
71+
72+
- name: Output scan result
73+
run: echo "scan-status=${{ steps.rl-scan-conclusion.outcome }}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)