ThreatMapper icon indicating copy to clipboard operation
ThreatMapper copied to clipboard

[v2] starting a scan on any single image tag triggers scan on all image tags for that image

Open manV opened this issue 1 year ago • 1 comments

Describe the bug Registries - starting a scan on any single image tag triggers scan on all image tags for that image

To Reproduce Steps to reproduce the behavior:

  1. Go to any registry image tags page
  2. start any scan on any single tag
  3. scan is started for all tags for the same image.

Expected behavior It should start scan on a specific tag

Components/Services affected

  • [x] UI/Frontend
  • [x] API/Backend
  • [ ] Agent
  • [ ] Deployment/YAMLs
  • [ ] CI/CD Integration
  • [ ] Other (specify)

manV avatar Jul 18 '23 10:07 manV

API request for start scan of image tag for instance: { "filters": { "cloud_account_scan_filter": { "filter_in": null }, "container_scan_filter": { "filter_in": null }, "host_scan_filter": { "filter_in": null }, "image_scan_filter": { "filter_in": null }, "kubernetes_cluster_scan_filter": { "filter_in": null } }, "node_ids": [ { "node_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "node_type": "image" } ] }

Where we see presence of a single node_id. This could happen because of node ids are same for those tags: [ { "node_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "node_name": "docker-extension:0.0.2", "docker_image_name": "docker-extension", "docker_image_tag": "0.0.3", "docker_image_size": "1282", "docker_image_created_at": "", "docker_image_virtual_size": "", "docker_image_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "metadata": { "digest": "sha256:7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "last_pushed": 1679356130, "last_updated": 1679356131, "status": "inactive" }, "vulnerabilities_count": 0, "vulnerability_scan_status": "ERROR", "vulnerability_latest_scan_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c-1689652124", "secrets_count": 0, "secret_scan_status": "STARTING", "secret_latest_scan_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c-1689679118", "malwares_count": 0, "malware_scan_status": "ERROR", "malware_latest_scan_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c-1689603671", "containers": null }, { "node_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "node_name": "docker-extension:0.0.2", "docker_image_name": "docker-extension", "docker_image_tag": "0.0.2", "docker_image_size": "1282", "docker_image_created_at": "", "docker_image_virtual_size": "", "docker_image_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "metadata": { "digest": "sha256:7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "last_pushed": 1679356130, "last_updated": 1679356131, "status": "inactive" }, "vulnerabilities_count": 0, "vulnerability_scan_status": "ERROR", "vulnerability_latest_scan_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c-1689652124", "secrets_count": 0, "secret_scan_status": "STARTING", "secret_latest_scan_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c-1689679118", "malwares_count": 0, "malware_scan_status": "ERROR", "malware_latest_scan_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c-1689603671", "containers": null }, { "node_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "node_name": "docker-extension:0.0.2", "docker_image_name": "docker-extension", "docker_image_tag": "0.0.1", "docker_image_size": "1282", "docker_image_created_at": "", "docker_image_virtual_size": "", "docker_image_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "metadata": { "digest": "sha256:7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c", "last_pushed": 1679356130, "last_updated": 1679356131, "status": "inactive" }, "vulnerabilities_count": 0, "vulnerability_scan_status": "ERROR", "vulnerability_latest_scan_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c-1689652124", "secrets_count": 0, "secret_scan_status": "STARTING", "secret_latest_scan_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c-1689679118", "malwares_count": 0, "malware_scan_status": "ERROR", "malware_latest_scan_id": "7fa35ea714050361090fa28ea09a1b4f234af8365ea79ac4925ec325662a1d8c-1689603671", "containers": null } ]

@ramanan-ravi @shyam-dev

milan-deepfence avatar Jul 18 '23 11:07 milan-deepfence