Skip to content

Commit a7b7478

Browse files
Adding Reversing Lab Scanner (#196)
### Changes Integrating Reversing Labs Scanner to add an extra layer of protection from threats ### References [Reversing Labs Integration Documentation](https://www.reversinglabs.com/integrations) ### Testing NA ### Checklist - [x] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md) - [x] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
1 parent c827329 commit a7b7478

File tree

4 files changed

+155
-3
lines changed

4 files changed

+155
-3
lines changed

.github/actions/get-version/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,5 @@ runs:
1717
- id: get_version
1818
shell: bash
1919
run: |
20-
VERSION=$(echo ${BRANCH_NAME} | sed -r 's#release/+##g')
20+
VERSION=$(head -1 .version)
2121
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
22-
env:
23-
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,28 @@ on:
77

88
permissions:
99
contents: write
10+
id-token: write # This is required for requesting the JWT
1011

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

1415
jobs:
16+
rl-scanner:
17+
uses: ./.github/workflows/rl-scanner.yml
18+
with:
19+
php-version: 8.1
20+
artifact-name: 'symfony-auth0.zip'
21+
secrets:
22+
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
23+
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
24+
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
25+
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
26+
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
27+
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
28+
1529
release:
1630
if: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/')
31+
needs: rl-scanner
1732
runs-on: ubuntu-latest
1833
environment: release
1934

.github/workflows/rl-scanner.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: RL-Secure Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
php-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+
rl-scanner:
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@v4
36+
with:
37+
ref: ${{ github.event.pull_request.head.sha || github.sha || github.ref }}
38+
39+
- name: Setup PHP
40+
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # [email protected]
41+
with:
42+
php-version: ${{ inputs.php-version }}
43+
44+
- name: Build Symfony
45+
shell: bash
46+
run: |
47+
zip -r ${{ inputs.artifact-name }} ./*
48+
49+
- name: Get Artifact Version
50+
id: get_version
51+
uses: ./.github/actions/get-version
52+
53+
- name: Run RL Scanner
54+
id: rl-scan-conclusion
55+
uses: ./.github/actions/rl-scanner
56+
with:
57+
artifact-path: "$(pwd)/${{ inputs.artifact-name }}"
58+
version: "${{ steps.get_version.outputs.version }}"
59+
env:
60+
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
61+
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
62+
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
63+
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
64+
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
65+
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
66+
67+
- name: Output scan result
68+
run: echo "scan-status=${{ steps.rl-scan-conclusion.outcome }}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)