|
| 1 | +name: RL Scan |
| 2 | +run-name: rl-scan |
| 3 | + |
| 4 | +# Reusable malware-scan workflow — call this from your release or CI pipeline via |
| 5 | +# workflow_call. The trigger lives in the calling workflow; the build steps are |
| 6 | +# defined here as a placeholder that you replace with your own toolchain setup, |
| 7 | +# compilation, and packaging steps before merging. |
| 8 | +# |
| 9 | +# Caller pattern (minimal): |
| 10 | +# jobs: |
| 11 | +# release-and-scan: |
| 12 | +# uses: ./.github/workflows/rl.yml |
| 13 | +# with: |
| 14 | +# artifact-name: my-artifact |
| 15 | +# artifact-path: dist/my-artifact.tgz |
| 16 | +# version: ${{ github.event.release.tag_name }} |
| 17 | +# secrets: inherit |
| 18 | +# |
| 19 | +# Artifact contract |
| 20 | +# ───────────────── |
| 21 | +# artifact-path MUST be a concrete file path — the action's internal existence |
| 22 | +# check uses [ -f ], which does NOT expand globs. A missing artifact fails the job. |
| 23 | +# |
| 24 | +# Required org secrets (configured at org level in auth0/): |
| 25 | +# RLSECURE_LICENSE — ReversingLabs license key |
| 26 | +# RLSECURE_SITE_KEY — ReversingLabs site key |
| 27 | +# SIGNAL_HANDLER_TOKEN — scan-service telemetry auth |
| 28 | +# SIGNAL_HANDLER_DOMAIN — scan-service endpoint domain |
| 29 | +# PRODSEC_TOOLS_ARN — AWS role ARN for ProdSec tools |
| 30 | +# PRODSEC_TOOLS_USER — ProdSec Python tools repo user |
| 31 | +# PRODSEC_TOOLS_TOKEN — ProdSec Python tools repo token |
| 32 | +# PRODSEC_PYTHON_TOOLS_REPO — ProdSec Python tools repo URL |
| 33 | + |
| 34 | +on: |
| 35 | + workflow_call: |
| 36 | + inputs: |
| 37 | + artifact-name: |
| 38 | + description: Name assigned to the artifact (used for RL reporting) |
| 39 | + type: string |
| 40 | + required: true |
| 41 | + artifact-path: |
| 42 | + description: Concrete file path of the built artifact on the runner — no globs |
| 43 | + type: string |
| 44 | + required: true |
| 45 | + version: |
| 46 | + description: Version string for the artifact (e.g. release tag) |
| 47 | + type: string |
| 48 | + required: true |
| 49 | + secrets: |
| 50 | + RLSECURE_LICENSE: |
| 51 | + required: true |
| 52 | + RLSECURE_SITE_KEY: |
| 53 | + required: true |
| 54 | + SIGNAL_HANDLER_TOKEN: |
| 55 | + required: true |
| 56 | + SIGNAL_HANDLER_DOMAIN: |
| 57 | + required: true |
| 58 | + PRODSEC_TOOLS_ARN: |
| 59 | + required: true |
| 60 | + PRODSEC_TOOLS_USER: |
| 61 | + required: true |
| 62 | + PRODSEC_TOOLS_TOKEN: |
| 63 | + required: true |
| 64 | + PRODSEC_PYTHON_TOOLS_REPO: |
| 65 | + required: true |
| 66 | + |
| 67 | +jobs: |
| 68 | + # ── Malware scan via ReversingLabs composite action ───────────────────────── |
| 69 | + rl-scan: |
| 70 | + name: RL Scan |
| 71 | + runs-on: ubuntu-latest |
| 72 | + permissions: |
| 73 | + contents: read |
| 74 | + id-token: write # required for AWS OIDC federation (PRODSEC_TOOLS_ARN) |
| 75 | + steps: |
| 76 | + - name: Checkout |
| 77 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 78 | + |
| 79 | + # ── Build the artifact ──────────────────────────────────────────────────── |
| 80 | + # Replace this placeholder with ALL steps required to produce the artifact, |
| 81 | + # including: runtime/toolchain setup (e.g. actions/setup-node, setup-go, |
| 82 | + # setup-dotnet), dependency installation, compilation, and packaging (e.g. |
| 83 | + # tar, zip, docker save). The final step must place the artifact at the |
| 84 | + # path passed as inputs.artifact-path. The rl-scan action uses [ -f ] to |
| 85 | + # verify the file exists — a missing or incorrect path fails the job. |
| 86 | + - name: Build artifact # TODO: replace with your toolchain setup + build + package steps |
| 87 | + run: | |
| 88 | + echo "TODO: replace this step with your build commands" |
| 89 | + echo " The built file must be at: ${{ inputs.artifact-path }}" |
| 90 | +
|
| 91 | + - name: Run RL malware scan |
| 92 | + id: rl-scan-conclusion |
| 93 | + uses: auth0/devsecops-tooling/.github/actions/rl-scan@e29f26478db18ff0bcbe4bc447a8fbd54fbeec9e |
| 94 | + with: |
| 95 | + # ── Artifact inputs ───────────────────────────────────────────────── |
| 96 | + artifact-name: ${{ inputs.artifact-name }} |
| 97 | + artifact-path: ${{ inputs.artifact-path }} |
| 98 | + version: ${{ inputs.version }} |
| 99 | + # ── Required secrets ──────────────────────────────────────────────── |
| 100 | + RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }} |
| 101 | + RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }} |
| 102 | + SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }} |
| 103 | + SIGNAL_HANDLER_DOMAIN: ${{ secrets.SIGNAL_HANDLER_DOMAIN }} |
| 104 | + PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }} |
| 105 | + PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }} |
| 106 | + PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }} |
| 107 | + PRODSEC_PYTHON_TOOLS_REPO: ${{ secrets.PRODSEC_PYTHON_TOOLS_REPO }} |
| 108 | + |
| 109 | + - name: Gate on scan result |
| 110 | + if: always() |
| 111 | + env: |
| 112 | + SCAN_STATUS: ${{ steps.rl-scan-conclusion.outputs.scan-status }} |
| 113 | + run: | |
| 114 | + if [ "$SCAN_STATUS" != "success" ]; then |
| 115 | + echo "::error title=Malware::RL scan did not pass (status: ${SCAN_STATUS:-none})" |
| 116 | + exit 1 |
| 117 | + fi |
0 commit comments