Skip to content

Commit

Permalink
Added RL Scanner Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
developerkunal committed Oct 30, 2024
1 parent 8c88c83 commit bd2aabd
Show file tree
Hide file tree
Showing 60 changed files with 2,687 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @auth0/dx-sdks-engineer
* @auth0/project-dx-sdks-engineer-codeowner
26 changes: 11 additions & 15 deletions .github/actions/maven-publish/action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: Publish release to Java

inputs:
java-version:
required: true
ossr-username:
required: true
ossr-password:
ossr-token:
required: true
signing-key:
required: true
signing-password:
required: true
java-version:
required: true
is-android:
required: true
version:
required: true


runs:
using: composite
Expand All @@ -33,12 +30,11 @@ runs:
- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # [email protected]

- name: Publish Java
shell: bash
if: inputs.is-android == 'false'
run: ./gradlew clean assemble sign publishMavenJavaPublicationToMavenRepository -PisSnapshot=false -Pversion="${{ inputs.version }}" -PossrhUsername="${{ inputs.ossr-username }}" -PossrhPassword="${{ inputs.ossr-password }}" -PsigningKey="${{ inputs.signing-key }}" -PsigningPassword="${{ inputs.signing-password }}"

- name: Publish Android
- name: Publish Android/Java Packages to Maven
shell: bash
if: inputs.is-android == 'true'
run: ./gradlew clean assemble sign publishAndroidLibraryPublicationToMavenRepository -PisSnapshot=false -Pversion="${{ inputs.version }}" -PossrhUsername="${{ inputs.ossr-username }}" -PossrhPassword="${{ inputs.ossr-password }}" -PsigningKey="${{ inputs.signing-key }}" -PsigningPassword="${{ inputs.signing-password }}"
run: ./gradlew publish -PisSnapshot=false --stacktrace
env:
MAVEN_USERNAME: ${{ inputs.ossr-username }}
MAVEN_PASSWORD: ${{ inputs.ossr-token }}
SIGNING_KEY: ${{ inputs.signing-key}}
SIGNING_PASSWORD: ${{ inputs.signing-password}}
71 changes: 71 additions & 0 deletions .github/actions/rl-scanner/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: "Reversing Labs Scanner"
description: "Runs the Reversing Labs scanner on a specified artifact."
inputs:
artifact-path:
description: "Path to the artifact to be scanned."
required: true
version:
description: "Version of the artifact."
required: true

runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install Python dependencies
shell: bash
run: |
pip install boto3 requests
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.PRODSEC_TOOLS_ARN }}
aws-region: us-east-1
mask-aws-account-id: true

- name: Install RL Wrapper
shell: bash
run: |
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"
- name: Run RL Scanner
shell: bash
env:
RLSECURE_LICENSE: ${{ env.RLSECURE_LICENSE }}
RLSECURE_SITE_KEY: ${{ env.RLSECURE_SITE_KEY }}
SIGNAL_HANDLER_TOKEN: ${{ env.SIGNAL_HANDLER_TOKEN }}
PYTHONUNBUFFERED: 1
run: |
if [ ! -f "${{ inputs.artifact-path }}" ]; then
echo "Artifact not found: ${{ inputs.artifact-path }}"
exit 1
fi
rl-wrapper \
--artifact "${{ inputs.artifact-path }}" \
--name "${{ github.event.repository.name }}" \
--version "${{ inputs.version }}" \
--repository "${{ github.repository }}" \
--commit "${{ github.sha }}" \
--build-env "github_actions" \
--suppress_output
# Check the outcome of the scanner
if [ $? -ne 0 ]; then
echo "RL Scanner failed."
echo "scan-status=failed" >> $GITHUB_ENV
exit 1
else
echo "RL Scanner passed."
echo "scan-status=success" >> $GITHUB_ENV
fi
outputs:
scan-status:
description: "The outcome of the scan process."
value: ${{ env.scan-status }}
10 changes: 3 additions & 7 deletions .github/workflows/java-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ on:
java-version:
required: true
type: string
is-android:
required: true
type: string

secrets:
ossr-username:
required: true
ossr-password:
ossr-token:
required: true
signing-key:
required: true
Expand Down Expand Up @@ -70,10 +68,8 @@ jobs:
- uses: ./.github/actions/maven-publish
with:
java-version: ${{ inputs.java-version }}
is-android: ${{ inputs.is-android }}
version: ${{ steps.get_version.outputs.version }}
ossr-username: ${{ secrets.ossr-username }}
ossr-password: ${{ secrets.ossr-password }}
ossr-token: ${{ secrets.ossr-token }}
signing-key: ${{ secrets.signing-key }}
signing-password: ${{ secrets.signing-password }}

Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,33 @@ on:

permissions:
contents: write
id-token: write # This is required for requesting the JWT

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

jobs:
rl-scanner:
uses: ./.github/workflows/rl-scanner.yml
with:
java-version: 8
artifact-name: "auth0-react.tgz"
secrets:
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
release:
uses: ./.github/workflows/java-release.yml
needs: rl-scanner
with:
java-version: 8.0.382-tem
is-android: false
secrets:
ossr-username: ${{ secrets.OSSR_USERNAME }}
ossr-password: ${{ secrets.OSSR_PASSWORD }}
ossr-token: ${{ secrets.OSSR_TOKEN }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
github-token: ${{ secrets.GITHUB_TOKEN }}
69 changes: 69 additions & 0 deletions .github/workflows/rl-scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: RL-Secure Workflow

on:
workflow_call:
inputs:
java-version:
required: true
type: string
artifact-name:
required: true
type: string
secrets:
RLSECURE_LICENSE:
required: true
RLSECURE_SITE_KEY:
required: true
SIGNAL_HANDLER_TOKEN:
required: true
PRODSEC_TOOLS_USER:
required: true
PRODSEC_TOOLS_TOKEN:
required: true
PRODSEC_TOOLS_ARN:
required: true
jobs:
checkout-build-scan-only:
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
runs-on: ubuntu-latest
outputs:
scan-status: ${{ steps.rl-scan-conclusion.outcome }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ inputs.java-version }}

- name: Build with Gradle
uses: gradle/gradle-build-action@4c39dd82cd5e1ec7c6fa0173bb41b4b6bb3b86ff
with:
arguments: assemble apiDiff check jacocoTestReport --continue --console=plain

- id: get_version
uses: ./.github/actions/get-version

- name: Create tgz build artifact
run: |
tar -czvf ${{ inputs.artifact-name }} *
- name: Run RL Scanner
id: rl-scan-conclusion
uses: ./.github/actions/rl-scanner
with:
artifact-path: "$(pwd)/${{ inputs.artifact-name }}"
version: "${{ steps.get_version.outputs.version }}"
env:
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}

- name: Output scan result
run: echo "scan-status=${{ steps.rl-scan-conclusion.outcome }}" >> $GITHUB_ENV
10 changes: 1 addition & 9 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Semgrep

on:
merge_group:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand All @@ -20,16 +20,8 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
authorize:
name: Authorize
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

run:
needs: authorize # Require approval before running on forked pull requests

name: Check for Vulnerabilities
runs-on: ubuntu-latest

Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Snyk
on:
merge_group:
workflow_dispatch:
pull_request_target:
pull_request:
types:
- opened
- synchronize
Expand All @@ -21,16 +21,8 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
authorize:
name: Authorize
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

check:
needs: authorize

name: Check for Vulnerabilities
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.12.0
2.14.0
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log

## [2.14.0](https://github.com/auth0/auth0-java/tree/2.14.0) (2024-10-16)
[Full Changelog](https://github.com/auth0/auth0-java/compare/2.13.0...2.14.0)

**Added**
- SDKs support for Control Your Own Key [\#671](https://github.com/auth0/auth0-java/pull/671) ([tanya732](https://github.com/tanya732))
- Added client credentials changes [\#670](https://github.com/auth0/auth0-java/pull/670) ([tanya732](https://github.com/tanya732))
- Added support for HRI phase 2 changes [\#668](https://github.com/auth0/auth0-java/pull/668) ([tanya732](https://github.com/tanya732))

## [2.13.0](https://github.com/auth0/auth0-java/tree/2.13.0) (2024-09-11)
[Full Changelog](https://github.com/auth0/auth0-java/compare/2.12.0...2.13.0)

**Added**
- Add sessions and refresh tokens to Users Management API [\#661](https://github.com/auth0/auth0-java/pull/661) ([tanya732](https://github.com/tanya732))

## [2.12.0](https://github.com/auth0/auth0-java/tree/2.12.0) (2024-05-29)
[Full Changelog](https://github.com/auth0/auth0-java/compare/2.11.0...2.12.0)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ Add the dependency via Maven:
<dependency>
<groupId>com.auth0</groupId>
<artifactId>auth0</artifactId>
<version>2.12.0</version>
<version>2.14.0</version>
</dependency>
```

or Gradle:

```gradle
implementation 'com.auth0:auth0:2.12.0'
implementation 'com.auth0:auth0:2.14.0'
```

### Configure the SDK
Expand Down
Loading

0 comments on commit bd2aabd

Please sign in to comment.