Skip to content

Endor Labs Scan Test #127

Endor Labs Scan Test

Endor Labs Scan Test #127

Workflow file for this run

name: Endor Labs Scan Test
on:
workflow_dispatch:
inputs:
api:
description: "Enter the target Endor Labs API"
required: true
type: choice
default: https://api.endorlabs.com
options:
- https://api.staging.endorlabs.com
- https://api.endorlabs.com
tenant_name:
description: "Enter your Endor Labs namespace?"
required: true
type: string
jobs:
scan-repo:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Setup namespace Environment Variables
run: |
NAMESPACE=$(jq -r '.inputs.tenant_name' $GITHUB_EVENT_PATH)
echo "::add-mask::$NAMESPACE"
echo NAMESPACE=$NAMESPACE >> $GITHUB_ENV
echo ENDOR_JS_ENABLE_TSSERVER=true >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: microsoft
java-version: "17"
cache: maven
cache-dependency-path: pom.xml
- name: Compile Package
run: mvn clean install
- uses: actions/checkout@v4
with:
repository: "endorlabs/js_vuln_test"
path: js_vuln_test
- name: Remove tsserver
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
set -euo pipefail
mv /usr/local/bin/tsserver /usr/local/bin/tsserver.tmp
echo "Moved!!!!"
- name: Setup with Endor Labs
uses: endorlabs/github-action/setup@244f78124850918c7924a7cbcb42b8d6f60911bd
with:
namespace: ${{ github.event.inputs.tenant_name }}
enable_github_action_token: true
- name: Endor Labs Call Graph Generation
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
set -euo pipefail
echo "Checking for tsserver"
which tsserver
echo "======================="
ENDOR_JS_ENABLE_TSSERVER=true endorctl scan --log-level debug --verbose --call-graph-languages=javascript,typescript --languages=javascript,typescript --path $GITHUB_WORKSPACE/js_vuln_test