Skip to content

Commit

Permalink
some ci examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kcberg committed Feb 5, 2024
1 parent 0cd3aef commit 0e38b3a
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
3 changes: 0 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,3 @@ steps:
APP_ENV: $(imageName)
APP_ID: $(appId2)
SARIF_ARTIFACT: true
- script: ls -lah
displayName: Check the condition of my condition
condition: eq(variables['imageName'], 'ubuntu-latest')
39 changes: 39 additions & 0 deletions ci-examples/azure-devops/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# HawkScan Scanning in Azure Pipelines

pool:
vmImage: ubuntu-latest

trigger: none

steps:
- checkout: self

# install the latest version of hawkscan
- task: HawkScanInstall@1
inputs:
version: "3.5.28"
installerType: "auto"

# azure pipelines default jdk is 8, so we upgrade to 17 to run JavaSpringVulny
- task: JavaToolInstaller@0
inputs:
versionSpec: "17"
jdkArchitectureOption: "x64"
jdkSourceOption: "PreInstalled"

# download, then start javaspringVulny in the background
- script: |
curl -Ls https://github.com/kaakaww/javaspringvulny/releases/download/0.1.0/java-spring-vuly-0.1.0.jar -o ./java-spring-vuly-0.1.0.jar
java -jar ./java-spring-vuly-0.1.0.jar &
displayName: Download and Start JavaSpringVulny
# run hawkscan with the StackHawk Azure Extension
- task: RunHawkScan@1
inputs:
configFile: "stackhawk.yml"
version: "3.5.28"
env:
HAWK_API_KEY: $(HAWK_API_KEY) # use variables in the azure devops ui to configure secrets and env vars
APP_ENV: 'Azure Pipeline'
APP_ID: $(appId2)
SARIF_ARTIFACT: true
26 changes: 26 additions & 0 deletions ci-examples/github/hawkscan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: HawkScan

jobs:
hawkscan:
name: HawkScan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download and run JavaSpringVulny release jar
run: |
curl -Ls https://github.com/kaakaww/javaspringvulny/releases/download/0.1.0/java-spring-vuly-0.1.0.jar -o ./java-spring-vuly-0.1.0.jar
java -jar ./java-spring-vuly-0.1.0.jar &
# - name: Build and run JavaSpringVulny (slower)
# run: |
# ./gradlew build
# ./gradlew bootRun &
- name: Run HawkScan
id: run-hawkscan
uses: stackhawk/hawkscan-action@main
with:
apiKey: ${{ secrets.HAWK_API_KEY }}
sourceURL: https://download.stackhawk.com/dev/hawk/cli
version: 3.5.28
env:
APP_ID: ${{ secrets.appId }}
SARIF_ARTIFACT: true

0 comments on commit 0e38b3a

Please sign in to comment.