Skip to content

Commit

Permalink
[container analysis] effective severity [(#3478)](GoogleCloudPlatform…
Browse files Browse the repository at this point in the history
…/python-docs-samples#3478)

Use new effective_severity field

fixes b/142836422
  • Loading branch information
daniel-sanche authored and busunkim96 committed Aug 7, 2020
1 parent e37c870 commit fe9e206
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def find_high_severity_vulnerabilities_for_image(resource_url, project_id):
vulnerabilities = grafeas_client.list_occurrences(project_name, filter_str)
filtered_list = []
for v in vulnerabilities:
if v.severity == Severity.HIGH or v.severity == Severity.CRITICAL:
if v.effective_severity == Severity.HIGH or v.effective_severity == Severity.CRITICAL:
filtered_list.append(v)
return filtered_list
# [END containeranalysis_filter_vulnerability_occurrences]
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ def test_find_high_severity_vulnerabilities(self):
'note_name': client.note_path(PROJECT_ID, note_id),
'resource_uri': self.image_url,
'vulnerability': {
'effective_severity': Severity.CRITICAL,
'package_issue': [
{
'affected_cpe_uri': 'your-uri-here',
Expand Down

0 comments on commit fe9e206

Please sign in to comment.