You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The container image scan vulnerability assessment script no longer seems to be working. I don't know if there was a schema change or API change on the Graph but it never finds results, even if they do actually appear in Defender for Cloud UI dashboard.
Image Digest: sha256:4a3e5843...snip...2063
Query: securityresources
| where type == 'microsoft.security/assessments/subassessments'
| where id matches regex '(.+?)/providers/Microsoft.ContainerRegistry/registries/(.+)/providers/Microsoft.Security/assessments/dbd0cb49-b563-45e7-9724-889e799fa648/'
| extend registryResourceId = tostring(split(id, '/providers/Microsoft.Security/assessments/')[0])
| extend registryResourceName = tostring(split(registryResourceId, '/providers/Microsoft.ContainerRegistry/registries/')[1])
| extend imageDigest = tostring(properties.additionalData.imageDigest)
| extend repository = tostring(properties.additionalData.repositoryName)
| extend patchable = tobool(properties.additionalData.patchable)
| extend scanFindingSeverity = tostring(properties.status.severity), scanStatus = tostring(properties.status.code)
| summarize findingsCountOverAll = count(), scanFindingSeverityCount = countif(patchable or not(tobool(False))) by scanFindingSeverity, scanStatus, registryResourceId, registryResourceName, repository, imageDigest
| summarize findingsCountOverAll = sum(findingsCountOverAll), severitySummary = make_bag(pack(scanFindingSeverity, scanFindingSeverityCount)) by registryResourceId, registryResourceName, repository, imageDigest, scanStatus
| summarize findingsCountOverAll = sum(findingsCountOverAll) , scanReport = make_bag_if(pack('scanStatus', scanStatus, 'scanSummary', severitySummary), scanStatus != 'NotApplicable')by registryResourceId, registryResourceName, repository, imageDigest
| extend IsScanned = iif(findingsCountOverAll > 0, true, false)
| where imageDigest =~ 'sha256:4a3e5843...snip...2063' and repository =~ '<apprepository>' and registryResourceName =~ '<companyregistry_without_cr.io_suffix>'
No results for image <apprepository>:932 yet ...
No results for image <apprepository>:932 yet ...
Write-Error: No results were found for digest: sha256:4a3e5843...snip...2063 after 3 retries!
Expected behavior
Historically, this script has executed locally just fine for me.
Additional context
This script is integrated into my AzDO pipeline and it halts pushes to Development environments if it does not pass. It's pretty slow already, requiring a 5 minute waiting period on the previous step, but now that it's not even finding results, it's even more frustrating.
The text was updated successfully, but these errors were encountered:
I did see this in the past when I inadvertently included azurecr.io to my registry name. The script gives a log message saying it scrubs it from the input, but I don't think that's accurate and only once I set the registry to the name without the suffix did it finally work. It was tricky to find this issue because it was running on a build pipeline with injected envrionment vars for the registry and repo names. But running locally I was able to troubleshoot.
@wtomw is this kinda a "YMMV" sorta script or something Microsoft officially supports? Or is there some other tooling that would make it easier to tap into Defender results for new images?
Describe the bug
The container image scan vulnerability assessment script no longer seems to be working. I don't know if there was a schema change or API change on the Graph but it never finds results, even if they do actually appear in Defender for Cloud UI dashboard.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Historically, this script has executed locally just fine for me.
Additional context
This script is integrated into my AzDO pipeline and it halts pushes to Development environments if it does not pass. It's pretty slow already, requiring a 5 minute waiting period on the previous step, but now that it's not even finding results, it's even more frustrating.
The text was updated successfully, but these errors were encountered: