AWS ECR image scanning using Python, AWS ECR tutorial
ฝัง
- เผยแพร่เมื่อ 13 ม.ค. 2023
- How to automate ECR image scanning using Python
#ecr #scanning #aws #python #awstutorial #ecrtutorial
Source code: github.com/CodeSam621/Demo/tr...
AWS CLI for ECR: awscli.amazonaws.com/v2/docum...
Setup AWS CLI: docs.aws.amazon.com/cli/lates...
Would be possible now to check if the ECR images with some Critical vulnerabilities are in use on ECS?
Hey mate,
I am really not sure. But this article could help on your query repost.aws/questions/QUDRMHIEVcRIS04Gq-0W_3zA/how-do-we-know-what-ecr-images-are-being-used-and-which-are-not
Can we automate it via jenkins pipeline
Hey @prashantsukhadeve9642 ,
Sorry I am not comfortable with Jenkins. This article could help you linuxhint.com/run-python-script-from-jenkins/
Thanks.
I'm getting an error at line 50 KeyError: 'findings'
Hi @king,
I believe the variable (`json_finding_result`) doesn't have this key 'findings'. Please try to print `json_finding_result` and see what is in there.
eg:
def finding_vulnarablity(repo_name, json_finding_result):
print(json_finding_result) # PRINT THE json_finding_result to see
print_to_json( json_finding_result['imageScanFindings']['findings'])
for result in json_finding_result['imageScanFindings']['findings']:
if(result['severity'] == "CRITICAL"):
item = Vulnurability()
item.repo_name = repo_name
item.uri = result['uri']
list_critical.append(item)
attributes = result['attributes']