Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion linters/trivy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ To enable/disable these, add the subcommands you want enabled in your trunk.yaml
```yaml
lint:
enabled:
- trivy@0.45.1:
- trivy@0.70.0:
commands: [config, fs-vuln]
```
4 changes: 2 additions & 2 deletions linters/trivy/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ tools:
- name: trivy
download: trivy
shims: [trivy]
known_good_version: 0.69.2
known_good_version: 0.70.0
lint:
definitions:
- name: trivy
tools: [trivy]
suggest_if: config_present
description: A comprehensive and versatile security scanner
known_good_version: 0.69.2
known_good_version: 0.70.0
# trivy supports --format template --template "@contrib/sarif.tpl", but it reports the wrong filepaths.
commands:
- name: fs-vuln
Expand Down
65 changes: 65 additions & 0 deletions linters/trivy/test_data/trivy_v0.70.0_config.check.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing linter trivy test config 1`] = `
{
"issues": [],
"lintActions": [
{
"command": "config",
"fileGroupName": "yaml",
"linter": "trivy",
"paths": [
".trunk/trunk.yaml",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "config",
"fileGroupName": "yaml",
"linter": "trivy",
"paths": [
"plugin.yaml",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "config",
"fileGroupName": "terraform",
"linter": "trivy",
"paths": [
"test_data/aws.tf",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "config",
"fileGroupName": "docker",
"linter": "trivy",
"paths": [
"test_data/basic.Dockerfile",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "config",
"fileGroupName": "yaml",
"linter": "trivy",
"paths": [
"test_data/basic.yaml",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "config",
"fileGroupName": "terraform",
"linter": "trivy",
"paths": [
"test_data/main.tf",
],
"verb": "TRUNK_VERB_CHECK",
},
],
"taskFailures": [],
"unformattedFiles": [],
}
`;
175 changes: 175 additions & 0 deletions linters/trivy/test_data/trivy_v0.70.0_fs-secret.check.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing linter trivy test fs-secret 1`] = `
{
"issues": [
{
"code": "private-key",
"file": "other_data/secrets.py",
"isSecurity": true,
"level": "LEVEL_HIGH",
"line": "12",
"linter": "trivy",
"message": "Asymmetric Private Key",
"targetType": "ALL",
},
],
"lintActions": [
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
".trunk/trunk.yaml",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"other_data/secrets.py",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"plugin.yaml",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"result.json",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"test_data/Gemfile.lock",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"test_data/aws.tf",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"test_data/basic.Dockerfile",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"test_data/basic.yaml",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"test_data/go.mod",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"test_data/main.tf",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"test_data/nested/requirements.txt",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"test_data/no_errors/requirements.txt",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"test_data/requirements.txt",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"trivy.test.ts",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"trivy_config_to_sarif.py",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"trivy_fs_secret_to_sarif.py",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-secret",
"fileGroupName": "ALL",
"linter": "trivy",
"paths": [
"trivy_fs_vuln_to_sarif.py",
],
"verb": "TRUNK_VERB_CHECK",
},
],
"taskFailures": [],
"unformattedFiles": [],
}
`;
56 changes: 56 additions & 0 deletions linters/trivy/test_data/trivy_v0.70.0_fs-vuln.check.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing linter trivy test fs-vuln 1`] = `
{
"issues": [],
"lintActions": [
{
"command": "fs-vuln",
"fileGroupName": "lockfile",
"linter": "trivy",
"paths": [
"test_data/Gemfile.lock",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-vuln",
"fileGroupName": "lockfile",
"linter": "trivy",
"paths": [
"test_data/go.mod",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-vuln",
"fileGroupName": "lockfile",
"linter": "trivy",
"paths": [
"test_data/nested/requirements.txt",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-vuln",
"fileGroupName": "lockfile",
"linter": "trivy",
"paths": [
"test_data/no_errors/requirements.txt",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "fs-vuln",
"fileGroupName": "lockfile",
"linter": "trivy",
"paths": [
"test_data/requirements.txt",
],
"verb": "TRUNK_VERB_CHECK",
},
],
"taskFailures": [],
"unformattedFiles": [],
}
`;
Loading