Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f0aa582c8 | ||
|
|
43849adf01 | ||
|
|
8bd2f9fbda | ||
|
|
cff3e9a7f6 | ||
|
|
ab15891596 | ||
|
|
cacfd7a243 | ||
|
|
1e0bef4613 |
@@ -1,7 +1,7 @@
|
|||||||
name: "build"
|
name: "build"
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
env:
|
env:
|
||||||
TRIVY_VERSION: 0.34.0
|
TRIVY_VERSION: 0.38.1
|
||||||
BATS_LIB_PATH: '/usr/lib/'
|
BATS_LIB_PATH: '/usr/lib/'
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM ghcr.io/aquasecurity/trivy:0.34.0
|
FROM ghcr.io/aquasecurity/trivy:0.38.1
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
RUN apk --no-cache add bash curl npm
|
RUN apk --no-cache add bash curl npm
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ jobs:
|
|||||||
sarif_file: 'trivy-results.sarif'
|
sarif_file: 'trivy-results.sarif'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using Trivy to scan Infrastucture as Code
|
### Using Trivy to scan Infrastructure as Code
|
||||||
It's also possible to scan your IaC repos with Trivy's built-in repo scan. This can be handy if you want to run Trivy as a build time check on each PR that gets opened in your repo. This helps you identify potential vulnerablites that might get introduced with each PR.
|
It's also possible to scan your IaC repos with Trivy's built-in repo scan. This can be handy if you want to run Trivy as a build time check on each PR that gets opened in your repo. This helps you identify potential vulnerablites that might get introduced with each PR.
|
||||||
|
|
||||||
If you have [GitHub code scanning](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning) available you can use Trivy as a scanning tool as follows:
|
If you have [GitHub code scanning](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning) available you can use Trivy as a scanning tool as follows:
|
||||||
@@ -478,29 +478,31 @@ jobs:
|
|||||||
|
|
||||||
Following inputs can be used as `step.with` keys:
|
Following inputs can be used as `step.with` keys:
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|-------------------|---------|------------------------------------|-------------------------------------------------------------------------------------------------|
|
|------------------------------|---------|------------------------------------|-------------------------------------------------------------------------------------------------|
|
||||||
| `scan-type` | String | `image` | Scan type, e.g. `image` or `fs` |
|
| `scan-type` | String | `image` | Scan type, e.g. `image` or `fs` |
|
||||||
| `input` | String | | Tar reference, e.g. `alpine-latest.tar` |
|
| `input` | String | | Tar reference, e.g. `alpine-latest.tar` |
|
||||||
| `image-ref` | String | | Image reference, e.g. `alpine:3.10.2` |
|
| `image-ref` | String | | Image reference, e.g. `alpine:3.10.2` |
|
||||||
| `scan-ref` | String | `/github/workspace/` | Scan reference, e.g. `/github/workspace/` or `.` |
|
| `scan-ref` | String | `/github/workspace/` | Scan reference, e.g. `/github/workspace/` or `.` |
|
||||||
| `format` | String | `table` | Output format (`table`, `json`, `sarif`, `github`) |
|
| `format` | String | `table` | Output format (`table`, `json`, `sarif`, `github`) |
|
||||||
| `template` | String | | Output template (`@/contrib/gitlab.tpl`, `@/contrib/junit.tpl`) |
|
| `template` | String | | Output template (`@/contrib/gitlab.tpl`, `@/contrib/junit.tpl`) |
|
||||||
| `output` | String | | Save results to a file |
|
| `output` | String | | Save results to a file |
|
||||||
| `exit-code` | String | `0` | Exit code when specified vulnerabilities are found |
|
| `exit-code` | String | `0` | Exit code when specified vulnerabilities are found |
|
||||||
| `ignore-unfixed` | Boolean | false | Ignore unpatched/unfixed vulnerabilities |
|
| `ignore-unfixed` | Boolean | false | Ignore unpatched/unfixed vulnerabilities |
|
||||||
| `vuln-type` | String | `os,library` | Vulnerability types (os,library) |
|
| `vuln-type` | String | `os,library` | Vulnerability types (os,library) |
|
||||||
| `severity` | String | `UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL` | Severities of vulnerabilities to scanned for and displayed |
|
| `severity` | String | `UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL` | Severities of vulnerabilities to scanned for and displayed |
|
||||||
| `skip-dirs` | String | | Comma separated list of directories where traversal is skipped |
|
| `skip-dirs` | String | | Comma separated list of directories where traversal is skipped |
|
||||||
| `skip-files` | String | | Comma separated list of files where traversal is skipped |
|
| `skip-files` | String | | Comma separated list of files where traversal is skipped |
|
||||||
| `cache-dir` | String | | Cache directory |
|
| `cache-dir` | String | | Cache directory |
|
||||||
| `timeout` | String | `5m0s` | Scan timeout duration |
|
| `timeout` | String | `5m0s` | Scan timeout duration |
|
||||||
| `ignore-policy` | String | | Filter vulnerabilities with OPA rego language |
|
| `ignore-policy` | String | | Filter vulnerabilities with OPA rego language |
|
||||||
| `hide-progress` | String | `true` | Suppress progress bar |
|
| `hide-progress` | String | `true` | Suppress progress bar |
|
||||||
| `list-all-pkgs` | String | | Output all packages regardless of vulnerability |
|
| `list-all-pkgs` | String | | Output all packages regardless of vulnerability |
|
||||||
| `security-checks` | String | `vuln,secret` | comma-separated list of what security issues to detect (`vuln`,`secret`,`config`) |
|
| `scanners` | String | `vuln,secret` | comma-separated list of what security issues to detect (`vuln`,`secret`,`config`) |
|
||||||
| `trivyignores` | String | | comma-separated list of relative paths in repository to one or more `.trivyignore` files |
|
| `trivyignores` | String | | comma-separated list of relative paths in repository to one or more `.trivyignore` files |
|
||||||
| `github-pat` | String | | GitHub Personal Access Token (PAT) for sending SBOM scan results to GitHub Dependency Snapshots |
|
| `trivy-config` | String | | Path to trivy.yaml config |
|
||||||
|
| `github-pat` | String | | GitHub Personal Access Token (PAT) for sending SBOM scan results to GitHub Dependency Snapshots |
|
||||||
|
| `limit-severities-for-sarif` | Boolean | false | By default *SARIF* format enforces output of all vulnerabilities regardless of configured severities. To override this behavior set this parameter to **true** |
|
||||||
|
|
||||||
[release]: https://github.com/aquasecurity/trivy-action/releases/latest
|
[release]: https://github.com/aquasecurity/trivy-action/releases/latest
|
||||||
[release-img]: https://img.shields.io/github/release/aquasecurity/trivy-action.svg?logo=github
|
[release-img]: https://img.shields.io/github/release/aquasecurity/trivy-action.svg?logo=github
|
||||||
|
|||||||
+6
-2
@@ -71,7 +71,7 @@ inputs:
|
|||||||
description: 'output all packages regardless of vulnerability'
|
description: 'output all packages regardless of vulnerability'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
security-checks:
|
scanners:
|
||||||
description: 'comma-separated list of what security issues to detect'
|
description: 'comma-separated list of what security issues to detect'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
@@ -88,6 +88,9 @@ inputs:
|
|||||||
trivy-config:
|
trivy-config:
|
||||||
description: 'path to trivy.yaml config'
|
description: 'path to trivy.yaml config'
|
||||||
required: false
|
required: false
|
||||||
|
limit-severities-for-sarif:
|
||||||
|
description: 'limit severities for SARIF format'
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
@@ -111,7 +114,8 @@ runs:
|
|||||||
- '-p ${{ inputs.hide-progress }}'
|
- '-p ${{ inputs.hide-progress }}'
|
||||||
- '-q ${{ inputs.skip-files }}'
|
- '-q ${{ inputs.skip-files }}'
|
||||||
- '-r ${{ inputs.list-all-pkgs }}'
|
- '-r ${{ inputs.list-all-pkgs }}'
|
||||||
- '-s ${{ inputs.security-checks }}'
|
- '-s ${{ inputs.scanners }}'
|
||||||
- '-t ${{ inputs.trivyignores }}'
|
- '-t ${{ inputs.trivyignores }}'
|
||||||
- '-u ${{ inputs.github-pat }}'
|
- '-u ${{ inputs.github-pat }}'
|
||||||
- '-v ${{ inputs.trivy-config }}'
|
- '-v ${{ inputs.trivy-config }}'
|
||||||
|
- '-z ${{ inputs.limit-severities-for-sarif }}'
|
||||||
|
|||||||
+17
-14
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:" o; do
|
while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:z:" o; do
|
||||||
case "${o}" in
|
case "${o}" in
|
||||||
a)
|
a)
|
||||||
export scanType=${OPTARG}
|
export scanType=${OPTARG}
|
||||||
@@ -57,7 +57,7 @@ while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:" o; do
|
|||||||
export listAllPkgs=${OPTARG}
|
export listAllPkgs=${OPTARG}
|
||||||
;;
|
;;
|
||||||
s)
|
s)
|
||||||
export securityChecks=${OPTARG}
|
export scanners=${OPTARG}
|
||||||
;;
|
;;
|
||||||
t)
|
t)
|
||||||
export trivyIgnores=${OPTARG}
|
export trivyIgnores=${OPTARG}
|
||||||
@@ -68,6 +68,9 @@ while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:" o; do
|
|||||||
v)
|
v)
|
||||||
export trivyConfig=${OPTARG}
|
export trivyConfig=${OPTARG}
|
||||||
;;
|
;;
|
||||||
|
z)
|
||||||
|
export limitSeveritiesForSARIF=${OPTARG}
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -81,8 +84,10 @@ input=$(echo $input | tr -d '\r')
|
|||||||
if [ $input ]; then
|
if [ $input ]; then
|
||||||
artifactRef="--input $input"
|
artifactRef="--input $input"
|
||||||
fi
|
fi
|
||||||
|
#trim leading spaces for boolean params
|
||||||
ignoreUnfixed=$(echo $ignoreUnfixed | tr -d '\r')
|
ignoreUnfixed=$(echo $ignoreUnfixed | tr -d '\r')
|
||||||
hideProgress=$(echo $hideProgress | tr -d '\r')
|
hideProgress=$(echo $hideProgress | tr -d '\r')
|
||||||
|
limitSeveritiesForSARIF=$(echo $limitSeveritiesForSARIF | tr -d '\r')
|
||||||
|
|
||||||
GLOBAL_ARGS=""
|
GLOBAL_ARGS=""
|
||||||
if [ $cacheDir ];then
|
if [ $cacheDir ];then
|
||||||
@@ -109,9 +114,9 @@ if [ $vulnType ] && [ "$scanType" != "config" ] && [ "$scanType" != "sbom" ];the
|
|||||||
ARGS="$ARGS --vuln-type $vulnType"
|
ARGS="$ARGS --vuln-type $vulnType"
|
||||||
SARIF_ARGS="$SARIF_ARGS --vuln-type $vulnType"
|
SARIF_ARGS="$SARIF_ARGS --vuln-type $vulnType"
|
||||||
fi
|
fi
|
||||||
if [ $securityChecks ];then
|
if [ $scanners ];then
|
||||||
ARGS="$ARGS --security-checks $securityChecks"
|
ARGS="$ARGS --scanners $scanners"
|
||||||
SARIF_ARGS="$SARIF_ARGS --security-checks $securityChecks"
|
SARIF_ARGS="$SARIF_ARGS --scanners $scanners"
|
||||||
fi
|
fi
|
||||||
if [ $severity ];then
|
if [ $severity ];then
|
||||||
ARGS="$ARGS --severity $severity"
|
ARGS="$ARGS --severity $severity"
|
||||||
@@ -164,7 +169,13 @@ if [ "$skipFiles" ];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
trivyConfig=$(echo $trivyConfig | tr -d '\r')
|
trivyConfig=$(echo $trivyConfig | tr -d '\r')
|
||||||
if [ $trivyConfig ]; then
|
if [ "${format}" == "sarif" ] && [ "${limitSeveritiesForSARIF}" != "true" ]; then
|
||||||
|
# SARIF is special. We output all vulnerabilities,
|
||||||
|
# regardless of severity level specified in this report.
|
||||||
|
# This is a feature, not a bug :)
|
||||||
|
echo "Building SARIF report with options: ${SARIF_ARGS}" "${artifactRef}"
|
||||||
|
trivy --quiet ${scanType} --format sarif --output ${output} $SARIF_ARGS ${artifactRef}
|
||||||
|
elif [ $trivyConfig ]; then
|
||||||
echo "Running Trivy with trivy.yaml config from: " $trivyConfig
|
echo "Running Trivy with trivy.yaml config from: " $trivyConfig
|
||||||
trivy --config $trivyConfig ${scanType} ${artifactRef}
|
trivy --config $trivyConfig ${scanType} ${artifactRef}
|
||||||
returnCode=$?
|
returnCode=$?
|
||||||
@@ -175,14 +186,6 @@ else
|
|||||||
returnCode=$?
|
returnCode=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# SARIF is special. We output all vulnerabilities,
|
|
||||||
# regardless of severity level specified in this report.
|
|
||||||
# This is a feature, not a bug :)
|
|
||||||
if [[ "${format}" == "sarif" ]]; then
|
|
||||||
echo "Building SARIF report with options: ${SARIF_ARGS}" "${artifactRef}"
|
|
||||||
trivy --quiet ${scanType} --format sarif --output ${output} $SARIF_ARGS ${artifactRef}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${format}" == "github" ]]; then
|
if [[ "${format}" == "github" ]]; then
|
||||||
if [[ "$(echo $githubPAT | xargs)" != "" ]]; then
|
if [[ "$(echo $githubPAT | xargs)" != "" ]]; then
|
||||||
printf "\n Uploading GitHub Dependency Snapshot"
|
printf "\n Uploading GitHub Dependency Snapshot"
|
||||||
|
|||||||
@@ -35,9 +35,36 @@
|
|||||||
"HIGH"
|
"HIGH"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "DS026",
|
||||||
|
"name": "Misconfiguration",
|
||||||
|
"shortDescription": {
|
||||||
|
"text": "No HEALTHCHECK defined"
|
||||||
|
},
|
||||||
|
"fullDescription": {
|
||||||
|
"text": "You shoud add HEALTHCHECK instruction in your docker container images to perform the health check on running containers."
|
||||||
|
},
|
||||||
|
"defaultConfiguration": {
|
||||||
|
"level": "note"
|
||||||
|
},
|
||||||
|
"helpUri": "https://avd.aquasec.com/misconfig/ds026",
|
||||||
|
"help": {
|
||||||
|
"text": "Misconfiguration DS026\nType: Dockerfile Security Check\nSeverity: LOW\nCheck: No HEALTHCHECK defined\nMessage: Add HEALTHCHECK instruction in your Dockerfile\nLink: [DS026](https://avd.aquasec.com/misconfig/ds026)\nYou shoud add HEALTHCHECK instruction in your docker container images to perform the health check on running containers.",
|
||||||
|
"markdown": "**Misconfiguration DS026**\n| Type | Severity | Check | Message | Link |\n| --- | --- | --- | --- | --- |\n|Dockerfile Security Check|LOW|No HEALTHCHECK defined|Add HEALTHCHECK instruction in your Dockerfile|[DS026](https://avd.aquasec.com/misconfig/ds026)|\n\nYou shoud add HEALTHCHECK instruction in your docker container images to perform the health check on running containers."
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"precision": "very-high",
|
||||||
|
"security-severity": "2.0",
|
||||||
|
"tags": [
|
||||||
|
"misconfiguration",
|
||||||
|
"security",
|
||||||
|
"LOW"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version": "0.34.0"
|
"version": "0.38.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"results": [
|
"results": [
|
||||||
@@ -67,6 +94,33 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ruleId": "DS026",
|
||||||
|
"ruleIndex": 1,
|
||||||
|
"level": "note",
|
||||||
|
"message": {
|
||||||
|
"text": "Artifact: Dockerfile\nType: dockerfile\nVulnerability DS026\nSeverity: LOW\nMessage: Add HEALTHCHECK instruction in your Dockerfile\nLink: [DS026](https://avd.aquasec.com/misconfig/ds026)"
|
||||||
|
},
|
||||||
|
"locations": [
|
||||||
|
{
|
||||||
|
"physicalLocation": {
|
||||||
|
"artifactLocation": {
|
||||||
|
"uri": "Dockerfile",
|
||||||
|
"uriBaseId": "ROOTPATH"
|
||||||
|
},
|
||||||
|
"region": {
|
||||||
|
"startLine": 1,
|
||||||
|
"startColumn": 1,
|
||||||
|
"endLine": 1,
|
||||||
|
"endColumn": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"message": {
|
||||||
|
"text": "Dockerfile"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"columnKind": "utf16CodeUnits",
|
"columnKind": "utf16CodeUnits",
|
||||||
|
|||||||
+28
-2
@@ -20,8 +20,8 @@
|
|||||||
"Class": "config",
|
"Class": "config",
|
||||||
"Type": "dockerfile",
|
"Type": "dockerfile",
|
||||||
"MisconfSummary": {
|
"MisconfSummary": {
|
||||||
"Successes": 21,
|
"Successes": 22,
|
||||||
"Failures": 1,
|
"Failures": 2,
|
||||||
"Exceptions": 0
|
"Exceptions": 0
|
||||||
},
|
},
|
||||||
"Misconfigurations": [
|
"Misconfigurations": [
|
||||||
@@ -50,6 +50,32 @@
|
|||||||
"Lines": null
|
"Lines": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Type": "Dockerfile Security Check",
|
||||||
|
"ID": "DS026",
|
||||||
|
"AVDID": "AVD-DS-0026",
|
||||||
|
"Title": "No HEALTHCHECK defined",
|
||||||
|
"Description": "You shoud add HEALTHCHECK instruction in your docker container images to perform the health check on running containers.",
|
||||||
|
"Message": "Add HEALTHCHECK instruction in your Dockerfile",
|
||||||
|
"Namespace": "builtin.dockerfile.DS026",
|
||||||
|
"Query": "data.builtin.dockerfile.DS026.deny",
|
||||||
|
"Resolution": "Add HEALTHCHECK instruction in Dockerfile",
|
||||||
|
"Severity": "LOW",
|
||||||
|
"PrimaryURL": "https://avd.aquasec.com/misconfig/ds026",
|
||||||
|
"References": [
|
||||||
|
"https://blog.aquasec.com/docker-security-best-practices",
|
||||||
|
"https://avd.aquasec.com/misconfig/ds026"
|
||||||
|
],
|
||||||
|
"Status": "FAIL",
|
||||||
|
"Layer": {},
|
||||||
|
"CauseMetadata": {
|
||||||
|
"Provider": "Dockerfile",
|
||||||
|
"Service": "general",
|
||||||
|
"Code": {
|
||||||
|
"Lines": null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
"Class": "config",
|
"Class": "config",
|
||||||
"Type": "dockerfile",
|
"Type": "dockerfile",
|
||||||
"MisconfSummary": {
|
"MisconfSummary": {
|
||||||
"Successes": 21,
|
"Successes": 22,
|
||||||
"Failures": 1,
|
"Failures": 2,
|
||||||
"Exceptions": 0
|
"Exceptions": 0
|
||||||
},
|
},
|
||||||
"Misconfigurations": [
|
"Misconfigurations": [
|
||||||
@@ -50,6 +50,32 @@
|
|||||||
"Lines": null
|
"Lines": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Type": "Dockerfile Security Check",
|
||||||
|
"ID": "DS026",
|
||||||
|
"AVDID": "AVD-DS-0026",
|
||||||
|
"Title": "No HEALTHCHECK defined",
|
||||||
|
"Description": "You shoud add HEALTHCHECK instruction in your docker container images to perform the health check on running containers.",
|
||||||
|
"Message": "Add HEALTHCHECK instruction in your Dockerfile",
|
||||||
|
"Namespace": "builtin.dockerfile.DS026",
|
||||||
|
"Query": "data.builtin.dockerfile.DS026.deny",
|
||||||
|
"Resolution": "Add HEALTHCHECK instruction in Dockerfile",
|
||||||
|
"Severity": "LOW",
|
||||||
|
"PrimaryURL": "https://avd.aquasec.com/misconfig/ds026",
|
||||||
|
"References": [
|
||||||
|
"https://blog.aquasec.com/docker-security-best-practices",
|
||||||
|
"https://avd.aquasec.com/misconfig/ds026"
|
||||||
|
],
|
||||||
|
"Status": "FAIL",
|
||||||
|
"Layer": {},
|
||||||
|
"CauseMetadata": {
|
||||||
|
"Provider": "Dockerfile",
|
||||||
|
"Service": "general",
|
||||||
|
"Code": {
|
||||||
|
"Lines": null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version": "0.34.0"
|
"version": "0.38.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"results": [
|
"results": [
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@ bats_load_library bats-assert
|
|||||||
bats_load_library bats-file
|
bats_load_library bats-file
|
||||||
|
|
||||||
@test "trivy repo with securityCheck secret only" {
|
@test "trivy repo with securityCheck secret only" {
|
||||||
# trivy repo --format json --output repo.test --security-checks=secret https://github.com/krol3/demo-trivy/
|
# trivy repo --format json --output repo.test --scanners=secret https://github.com/krol3/demo-trivy/
|
||||||
run ./entrypoint.sh '-b json' '-h repo.test' '-s secret' '-a repo' '-j https://github.com/krol3/demo-trivy/'
|
run ./entrypoint.sh '-b json' '-h repo.test' '-s secret' '-a repo' '-j https://github.com/krol3/demo-trivy/'
|
||||||
run diff repo.test ./test/data/repo.test
|
run diff repo.test ./test/data/repo.test
|
||||||
echo "$output"
|
echo "$output"
|
||||||
@@ -52,7 +52,7 @@ bats_load_library bats-file
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "trivy fs with securityChecks option" {
|
@test "trivy fs with securityChecks option" {
|
||||||
# trivy fs --format json --security-checks=vuln,config --output fs-scheck.test .
|
# trivy fs --format json --scanners=vuln,config --output fs-scheck.test .
|
||||||
run ./entrypoint.sh '-a fs' '-b json' '-j .' '-s vuln,config,secret' '-h fs-scheck.test'
|
run ./entrypoint.sh '-a fs' '-b json' '-j .' '-s vuln,config,secret' '-h fs-scheck.test'
|
||||||
run diff fs-scheck.test ./test/data/fs-scheck.test
|
run diff fs-scheck.test ./test/data/fs-scheck.test
|
||||||
echo "$output"
|
echo "$output"
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|||||||
Reference in New Issue
Block a user