I know how to get repositories, we can use
az acr repository list --name myregistry
.
But, how to get repositories with tags that are having security/vulnerability issues after security scans using azure cli?
I know how to get repositories, we can use
az acr repository list --name myregistry
.
But, how to get repositories with tags that are having security/vulnerability issues after security scans using azure cli?
You can't get the results directly from the CLI unfortunately. All the scan data is stored in Log Analytics (via Azure Security Centre/Defender) so you would need to query it through that using the Kusto language. This query will get the information:
securityresources
| where type == "microsoft.security/assessments"
| summarize by assessmentKey=name //the ID of the assessment
| join kind=inner (
securityresources
| where type == "microsoft.security/assessments/subassessments"
| extend assessmentKey = extract(".*assessments/(.+?)/.*",1, id)
) on assessmentKey
| where properties.additionalData.assessedResourceType == "ContainerRegistryVulnerability"
| extend status = properties.status.code
| extend severity = properties.status.severity