|
| 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 }} |
0 commit comments