Share CLI results with the Snyk Web UI

Introduction

You can use the CLI snyk iac test command to address known configuration issues.
To see these issues displayed in the Snyk Web UI, run the following CLI command:
snyk iac test myproject --report

Example

1
> snyk iac test myproject --report
2
3
Testing arm-file.tf...
4
5
6
Infrastructure as code issues:
7
✗ VM Agent is not provisioned automatically for Windows [Low Severity] [SNYK-CC-AZURE-667] in Compute
8
introduced by resource > azurerm_virtual_machine[my_terraformvm] > os_profile_windows_config > provision_vm_agent
9
10
11
Organization: my.org
12
Type: Terraform
13
Target file: arm-file.tf
14
Project name: myproject
15
Open source: no
16
Project path: myproject
17
18
Tested arm-file.tf for known issues, found 1 issues
19
20
Your test results are available at: https://app.snyk.io/org/my.org/projects under the name myproject
Copied!
This sends a snapshot of your current configuration issues to your Snyk dashboard, to view in the Snyk Web UI.

Viewing snapshots in the Snyk Web UI

Log in to the Snyk Web UI (https://app.snyk.io) and go to your organization's project page, to see the specific snapshot of your scanned project.
Newly scanned project in the projects page
You can also open the project itself and see the usual individual project view:
individual project view

Ignores

You can ignore issues using the Snyk Web UI, or by creating a .snyk policy file along with your project when scanning. For more information, see Iac Ignores using the .snyk policy file.
Issues that are ignored by using the .snyk policy file can not be unignored in the Snyk web UI.

Project tags

You can attach tags to the scanned projects using the --project-tags flag. The flag accepts a comma-separated list of tags, where each tag is a key-value pair. Keys and values are separated by an = sign. The --project-tags flag is valid only when used with --report.
The following example attaches the tags department and team to the scanned projects, with values platform and persistence, respectively.
1
> snyk iac test myproject --report \
2
--project-tags=department=platform,team=persistence
Copied!

Project attributes

You can set attributes for the scanned projects using the --project-business-criticality, --project-environment, and --project-lifecycle tags. These flags are valid only when used with --report.
  • --project-business-criticality accepts a comma-separated list of the following values: critical, high, medium, low.
  • --project-environment accepts a comma-separated list of the following values: frontend, backend, internal, external, mobile, saas, onprem, hosted, distributed.
  • --project-lifecycle accepts a comma-separated list of the following values: production, development, sandbox.
The following example sets the business criticality to high, the environment to the values frontend and internal, and the lifecycle to development for each scanned project.
1
> snyk iac test myproject --report \
2
--project-business-criticality=high \
3
--project-environment=frontend,internal \
4
--project-lifecycle=development
Copied!

Target reference

You can set the target reference for the scanned projects using the --target-reference flag. This flag is valid only only when used with --report.
The following example sets the target reference for the scanned projects to the name of the current Git branch.
1
snyk iac test myproject --report \
2
--target-reference="$(git branch --show-current)"
Copied!

Notes

Using Custom rules and the Share Results functionality together is not currently supported.
Snyk does not share any file contents over the network, only the required metadata for the configuration issues that were just scanned.