Merge pull request #1601 from Contrast-Security-OSS/main

Adds Contrast Scan workflow
This commit is contained in:
Sampark Sharma
2022-06-20 17:39:22 +05:30
committed by GitHub
3 changed files with 75 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will initiate a Contrast Scan on your built artifact, and subsequently upload the results SARIF to Github.
# Because Contrast Scan is designed to run against your deployable artifact, you need to build an artifact that will be passed to the Contrast Scan Action.
# Contrast Scan currently supports Java, JavaScript and .NET artifacts.
# For more information about the Contrast Scan GitHub Action see here: https://github.com/Contrast-Security-OSS/contrastscan-action
# Pre-requisites:
# All Contrast related account secrets should be configured as GitHub secrets to be passed as inputs to the Contrast Scan Action.
# The required secrets are CONTRAST_API_KEY, CONTRAST_ORGANIZATION_ID and CONTRAST_AUTH_HEADER.
on:
push:
branches: [ $default-branch, $protected-branches ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ $default-branch ]
schedule:
- cron: $cron-weekly
permissions:
contents: read
name: Scan analyze workflow
jobs:
build-and-scan:
permissions:
contents: read # for actions/checkout
security-events: write # for github/codeql-action/upload-sarif
runs-on: ubuntu-latest
# check out project
steps:
- uses: actions/checkout@v3
# Since Contrast Scan is designed to run against your deployable artifact, the steps to build your artifact should go here.
# -name: Build Project
# ...
# Scan Artifact
- name: Contrast Scan Action
uses: Contrast-Security-OSS/contrastscan-action@7352a45d9678ec8a434cf061b07ffb51c1e351a1
with:
artifact: mypath/target/myartifact.jar # replace this path with the path to your built artifact
apiKey: ${{ secrets.CONTRAST_API_KEY }}
orgId: ${{ secrets.CONTRAST_ORGANIZATION_ID }}
authHeader: ${{ secrets.CONTRAST_AUTH_HEADER }}
#Upload the results to GitHub
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif # The file name must be 'results.sarif', as this is what the Github Action will output
@@ -0,0 +1,7 @@
{
"name": "Contrast Scan",
"creator": "Contrast Security Inc",
"description": "Scans Pull Requests on each push for the introduction and/or resolution of vulnerabilities to the repository.",
"iconName": "contrast",
"categories": ["Code Scanning", "java", "javascript", "dotnet"]
}
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 209.4 177.4" style="enable-background:new 0 0 209.4 177.4;" xml:space="preserve">
<style type="text/css">
.st0{fill:#004D45;}
.st1{fill:#0E9E53;}
.st2{fill:#FFFFFF;}
</style>
<path class="st0" d="M65.4,90.2c0,26.2,10.1,49.4,26.7,65.1c-2.6,0.2-5.3,0.4-8.1,0.4c-46.9,0-79.4-27.1-79.4-64.3
S37,27.1,83.9,27.1c1.9,0,3.7,0,5.4,0.1C74.3,42.9,65.4,65.4,65.4,90.2z"/>
<path class="st1" d="M203.9,39.5c2.2,14.3-8.8,26-27.4,26c-28.1,0-33-36.1-87.1-38.4C103,12.8,121.8,4,143.5,4c0.4,0,0.8,0,1.3,0
C176,4,201.5,23.9,203.9,39.5z"/>
<path class="st2" d="M187.7,117.9c7.2,1.4,16.5,6.4,16.5,21.4c0,20.9-32.5,36.4-59.5,36.7c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1,0s0,0,0,0
c-20.6,0-38.7-7.8-52.4-20.7C139.6,151.3,161.9,112.9,187.7,117.9z"/>
</svg>

After

Width:  |  Height:  |  Size: 1003 B