Skip to content

Commit 0928b3e

Browse files
bluesentinelsecMichael Long
andauthored
Minor Fixes (#37)
* add --out-scan-markdown CLI arg * change --out-scan-markdown to string from bool * pass --display-vuln-findings as string * write markdown report to disk * testing --------- Co-authored-by: Michael Long <mlongii@amazon.com>
1 parent 8117153 commit 0928b3e

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

.github/workflows/example_display_findings.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727

2828
# modify this block to scan your intended artifact
29-
- name: Scan container
29+
- name: Inspector Scan
3030
id: inspector
3131
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@main
3232
with:
@@ -40,13 +40,14 @@ jobs:
4040
artifact_path: 'ubuntu:14.04'
4141

4242
# If enabled, this setting will display Inspector's vulnerability scan findings
43-
# as a GitHub actions job summary. See here for an example:
43+
# as a GitHub actions job summary. See here for an example summary:
4444
# https://github.com/aws-actions/vulnerability-scan-github-action-for-amazon-inspector/actions/runs/8800085041
45-
display_vulnerability_findings: true
45+
display_vulnerability_findings: "enabled"
4646

47-
# Set vulnerability thresholds; if the number of vulns is
48-
# equal to or greater than any of the specified thresholds, set
49-
# the 'vulnerability_threshold_exceeded' output flag to 1.
47+
# Set vulnerability thresholds; if the number of vulnerabilities is
48+
# equal to or greater than any of the specified thresholds, this
49+
# action will set the 'vulnerability_threshold_exceeded'
50+
# output flag to 1.
5051
critical_threshold: 1
5152
high_threshold: 1
5253
medium_threshold: 1
@@ -69,8 +70,8 @@ jobs:
6970
- name: Display Inspector vulnerability scan results (CSV)
7071
run: cat ${{ steps.inspector.outputs.inspector_scan_results_csv }}
7172

72-
# - name: Display Inspector vulnerability scan results (Markdown)
73-
# run: cat ${{ steps.inspector.outputs.inspector_scan_results_markdown }}
73+
- name: Display Inspector vulnerability scan results (Markdown)
74+
run: cat ${{ steps.inspector.outputs.inspector_scan_results_markdown }}
7475

7576

7677
# The following steps illustrate how to
@@ -83,7 +84,7 @@ jobs:
8384
${{ steps.inspector.outputs.inspector_scan_results }}
8485
${{ steps.inspector.outputs.inspector_scan_results_csv }}
8586
${{ steps.inspector.outputs.artifact_sbom }}
86-
# ${{ steps.inspector.outputs.inspector_scan_results_markdown }}
87+
${{ steps.inspector.outputs.inspector_scan_results_markdown }}
8788
8889
8990
# This step illustrates how to add custom logic if

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,16 @@ outputs:
105105
inspector_scan_results_csv:
106106
description: "The filepath to the Inspector vulnerability scan in CSV format."
107107

108+
inspector_scan_results_markdown:
109+
description: "The filepath to the Inspector vulnerability scan in markdown format."
110+
108111
vulnerability_threshold_exceeded:
109112
description: "This variable is set to 1 if any vulnerability threshold was exceeded, otherwise it is 0."
110113

111114
runs:
112115
using: 'docker'
113116
image: 'Dockerfile'
114-
args:
117+
args:
115118
- --artifact-type=${{ inputs.artifact_type }}
116119
- --artifact-path=${{ inputs.artifact_path }}
117120
- --display-vuln-findings=${{ inputs.display_vulnerability_findings }}

entrypoint/entrypoint/orchestrator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,14 @@ def execute(args) -> int:
335335
others=others)
336336

337337
if args.display_vuln_findings == "enabled":
338-
logging.info("posting markdown to job summary")
338+
339+
logging.info("posting Inspector scan findings to GitHub Actions step summary page")
339340
converter.post_github_step_summary(markdown)
340341

342+
logging.info(f"writing markdown report to: {args.out_scan_markdown}")
341343
with open(args.out_scan_markdown, "w") as f:
342344
f.write(markdown)
345+
set_github_actions_output('inspector_scan_results_markdown', args.out_scan_csv)
343346

344347
is_exceeded = exceeds_threshold(criticals, args.critical,
345348
highs, args.high,

0 commit comments

Comments
 (0)