1- name : RL-Secure
2- run-name : rl-scanner
1+ name : RL-Secure Workflow
32
43on :
5- merge_group :
6- workflow_dispatch :
7- push :
8- branches : ["master"]
9- pull_request :
10- types :
11- - opened
12- - synchronize
4+ workflow_call :
5+ inputs :
6+ ruby-version :
7+ required : true
8+ type : string
9+ secrets :
10+ RLSECURE_LICENSE :
11+ required : true
12+ RLSECURE_SITE_KEY :
13+ required : true
14+ SIGNAL_HANDLER_TOKEN :
15+ required : true
16+ PRODSEC_TOOLS_USER :
17+ required : true
18+ PRODSEC_TOOLS_TOKEN :
19+ required : true
20+ PRODSEC_TOOLS_ARN :
21+ required : true
1322
1423jobs :
1524 rl-scanner :
16- if : github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request')
25+ if : github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/') )
1726 runs-on : ubuntu-latest
18-
19- environment : security
27+ outputs :
28+ scan-status : ${{ steps.rl-scan-conclusion.outcome }}
2029
2130 permissions :
2231 pull-requests : write
3241 - name : Configure Ruby
3342 uses : ./.github/actions/setup
3443 with :
35- ruby-version : 3.2
44+ ruby-version : ${{ inputs.ruby-version }}
3645
3746 - name : Build RubyGems
3847 shell : bash
@@ -41,45 +50,21 @@ jobs:
4150
4251 - name : Get Artifact Version
4352 id : get_version
44- run : echo "::set-output name=version::$(cat .version)"
45-
46- - name : Output build artifact
47- id : output_build_artifact
48- run : |
49- echo "scanfile=$(ls *.gem)" >> $GITHUB_OUTPUT
50-
51- - name : Set up Python
52- uses : actions/setup-python@v4
53- with :
54- python-version : " 3.10"
53+ uses : ./.github/actions/get-version
5554
56- - name : Install Python dependencies
57- run : |
58- pip install --upgrade pip
59- pip install boto3 requests
60-
61- - name : Configure AWS credentials
62- uses : aws-actions/configure-aws-credentials@v1
55+ - name : Run RL Scanner
56+ id : rl-scan-conclusion
57+ uses : ./.github/actions/rl-scanner
6358 with :
64- role-to-assume : ${{ secrets.PRODSEC_TOOLS_ARN }}
65- aws-region : us-east-1
66- mask-aws-account-id : true
67-
68- - name : Run Reversing Labs Wrapper Scanner
59+ artifact-path : " $(pwd)/*.gem"
60+ version : " ${{ steps.get_version.outputs.version }}"
6961 env :
7062 RLSECURE_LICENSE : ${{ secrets.RLSECURE_LICENSE }}
7163 RLSECURE_SITE_KEY : ${{ secrets.RLSECURE_SITE_KEY }}
7264 SIGNAL_HANDLER_TOKEN : ${{ secrets.SIGNAL_HANDLER_TOKEN }}
73- WRAPPER_INDEX_URL : " https://${{ secrets.PRODSEC_TOOLS_USER }}:${{ secrets.PRODSEC_TOOLS_TOKEN }}@a0us.jfrog.io/artifactory/api/pypi/python-local/simple"
74- PYTHONUNBUFFERED : 1
75- run : |
76- pip install rl-wrapper --index-url "$WRAPPER_INDEX_URL" && \
77- rl-wrapper \
78- --artifact "${{ steps.output_build_artifact.outputs.scanfile }}" \
79- --version "${{ steps.get_version.outputs.version }}" \
80- --name "${{ github.event.repository.name }}" \
81- --repository "${{ github.repository }}" \
82- --commit "${{ github.sha }}" \
83- --build-env "github_actions" \
84- --suppress_output
85- continue-on-error : true
65+ PRODSEC_TOOLS_USER : ${{ secrets.PRODSEC_TOOLS_USER }}
66+ PRODSEC_TOOLS_TOKEN : ${{ secrets.PRODSEC_TOOLS_TOKEN }}
67+ PRODSEC_TOOLS_ARN : ${{ secrets.PRODSEC_TOOLS_ARN }}
68+
69+ - name : Output scan result
70+ run : echo "scan-status=${{ steps.rl-scan-conclusion.outcome }}" >> $GITHUB_ENV
0 commit comments