Skip to content

Commit

Permalink
Add SARIF example & screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsnyk committed Apr 20, 2022
1 parent 2d7d180 commit 6637d6e
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .dccache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"/Users/jonathangruber/Documents/4-Code/snyk-cicd-integration-examples/AzurePipelineDecorator/cli:simple-example/snyk-pipeline-decorator-extension-hub.html":[658,1631194645801.656,"24f9204660fb72439c35d2aea8873e8bde34bcde0f4dbae42f9407accaca47b9"],"/Users/jonathangruber/Documents/4-Code/snyk-cicd-integration-examples/AzurePipelineDecorator/extension/snyk-hub.html":[658,1631194645802.9692,"24f9204660fb72439c35d2aea8873e8bde34bcde0f4dbae42f9407accaca47b9"]}
{"/Users/sebastian/git/snyk-labs.snyk-cicd-integration-examples/AzurePipelineDecorator/cli:simple-example/snyk-pipeline-decorator-extension-hub.html":[658,1650357571289.4814,"24f9204660fb72439c35d2aea8873e8bde34bcde0f4dbae42f9407accaca47b9"],"/Users/sebastian/git/snyk-labs.snyk-cicd-integration-examples/AzurePipelineDecorator/extension/snyk-hub.html":[658,1650357571289.939,"24f9204660fb72439c35d2aea8873e8bde34bcde0f4dbae42f9407accaca47b9"]}
12 changes: 12 additions & 0 deletions AzurePipelines/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Azure Pipelines

## Inline display

Azure pipelines support the inline display of scan results via a [plugin][sarif-viewer-plugin].

A sample screenshot is shown below:

![](azure-pipelines-inline-sarif-example.png)


[sarif-viewer-plugin]: https://marketplace.visualstudio.com/items?itemName=sariftools.scans&targetId=bf3858e2-f2d0-4e06-962a-2107402a1234
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Runs 4 Snyk Products (Code, Open Source, Container, IaC)
# Outputs the results to the pipeline

# Prerequisites:
# - Set a SNYK_TOKEN in the pipelines secrets
# - Install the SARIF viewer extension
# https://marketplace.visualstudio.com/items?itemName=sariftools.scans&targetId=bf3858e2-f2d0-4e06-962a-2107402a1234

# NOTE: Change this to a different pool to run the scripts.
pool: sebsnyk.pool

steps:
- checkout: self

# .. your instructions on building the app or preparing the repository

# install & prepare snyk
- script: |
npm install -g snyk
snyk auth $(SNYK_TOKEN)
displayName: 'snyk install & auth'
# snyk code
- script: snyk code test --sarif-file-output=CodeAnalysisLogs/snyk-code.sarif
continueOnError: true
displayName: 'snyk code'

# snyk open source
- script: snyk test --sarif-file-output=CodeAnalysisLogs/snyk-open-source.sarif
continueOnError: true
displayName: 'snyk open source'

# snyk container
# NOTE: Change this to your container name
- script: snyk container test sebsnyk/juice-shop --file=Dockerfile --sarif-file-output=CodeAnalysisLogs/snyk-container.sarif
continueOnError: true
displayName: 'snyk container'

# snyk iac
- script: snyk iac test --sarif-file-output=CodeAnalysisLogs/snyk-iac.sarif
continueOnError: true
displayName: 'snyk iac'

# publish the results
- task: PublishBuildArtifacts@1
displayName: "Publish Artifact: CodeAnalysisLogs"
condition: succeededOrFailed()
inputs:
PathtoPublish: $(Build.SourcesDirectory)/CodeAnalysisLogs
ArtifactName: CodeAnalysisLogs

0 comments on commit 6637d6e

Please sign in to comment.