Skip to content

Commit

Permalink
Merge pull request #20 from kartverket/skip-severity-check
Browse files Browse the repository at this point in the history
Add option to disable severity check
  • Loading branch information
omaen committed Feb 19, 2024
2 parents 8afd771 + 3260952 commit d6601c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ As of v0.1.0 only GitHub registries are tested and supported.

### Inputs

| Key | Required | Description |
| -------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| image_url | | The Docker image url must be of the form `registry/repository:tag` or `registry/repository@digest` for run-security-scans. It is not required; however, in order to run Trivy image_url must be supplied. |
| trivy | | An optional boolean that determines whether trivy-scan will be run. Defaults to 'true'. |
| tfsec | | An optional boolean that determines whether tfsec-scan will be run. Defaults to 'true'. |
| allow_severity_level | | A string which determines the highest level of severity the security scans can find while still succeeding workflows. Only `medium`, `high` and `critical` are allowed as input strings. Note that these values are case sensitive. |
| trivy_category | | A category for describing the Trivy action. Useful for differentiating between different runs of different images. |
| Key | Required | Description |
|------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| image_url | | The Docker image url must be of the form `registry/repository:tag` or `registry/repository@digest` for run-security-scans. It is not required; however, in order to run Trivy image_url must be supplied. |
| trivy | | An optional boolean that determines whether trivy-scan will be run. Defaults to 'true'. |
| tfsec | | An optional boolean that determines whether tfsec-scan will be run. Defaults to 'true'. |
| allow_severity_level | | A string which determines the highest level of severity the security scans can find while still succeeding workflows. Only `medium`, `high` and `critical` are allowed as input strings. Note that these values are case sensitive. |
| disable_severity_check | | Disables the severity check to allow action to succeed regardless of result. Useful for ad-hoc runs to update the status for the given branch. Defaults to `false`. |
| trivy_category | | A category for describing the Trivy action. Useful for differentiating between different runs of different images. |

### Example usage

Expand Down
6 changes: 6 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
description: "A string which determines the highest level of severity the security scans can find while still succeeding workflows. Only `medium`, `high` and `critical` are allowed as input strings. Note that these values are case sensitive."
required: false
default: medium
disable_severity_check:
description: "Skip checking severity of scan results. Useful when running the action ad-hoc to update the Github security status."
required: false
default: "false"
trivy_category:
description: "A category for describing the Trivy action. Useful for differentiating between different runs of different images."
required: false
Expand Down Expand Up @@ -103,6 +107,7 @@ runs:
#

- name: Set high and critical severity outputs
if: inputs.disable_severity_check != 'true'
id: severity_check_outputs
shell: bash
env:
Expand All @@ -125,6 +130,7 @@ runs:
echo "is_critical_vuln_present=$is_critical_vuln_present" >> $GITHUB_OUTPUT
- name: Succeed or fail based on severity
if: inputs.disable_severity_check != 'true'
id: severity_check
shell: bash
env:
Expand Down

0 comments on commit d6601c1

Please sign in to comment.