Title: Auto Discovery failed to fetch Scan for removed pod with no scans made before. · Issue #2699 · secureCodeBox/secureCodeBox · GitHub
Open Graph Title: Auto Discovery failed to fetch Scan for removed pod with no scans made before. · Issue #2699 · secureCodeBox/secureCodeBox
X Title: Auto Discovery failed to fetch Scan for removed pod with no scans made before. · Issue #2699 · secureCodeBox/secureCodeBox
Description: 🐞 Bug report I deployed SCB Auto Discovery to kubernetes, annotated existing namespace with some pods in it. Then killed nginx pod and Auto Discovery service failed to fetch Scan and process another events. Describe the bug Secure Code B...
Open Graph Description: 🐞 Bug report I deployed SCB Auto Discovery to kubernetes, annotated existing namespace with some pods in it. Then killed nginx pod and Auto Discovery service failed to fetch Scan and process anothe...
X Description: 🐞 Bug report I deployed SCB Auto Discovery to kubernetes, annotated existing namespace with some pods in it. Then killed nginx pod and Auto Discovery service failed to fetch Scan and process anothe...
Opengraph URL: https://github.com/secureCodeBox/secureCodeBox/issues/2699
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Auto Discovery failed to fetch Scan for removed pod with no scans made before.","articleBody":"## 🐞 Bug report\r\nI deployed SCB Auto Discovery to kubernetes, annotated existing namespace with some pods in it. Then killed nginx pod and Auto Discovery service failed to fetch `Scan` and process another events.\r\n\r\n### Describe the bug\r\nSecure Code Box auto discovery service tries to fetch ScheduledScan for pod with no scans made before.\r\n\r\n### Steps To Reproduce\r\n\r\nDeploy auto-dicovery by instruction to namespace `infra-securecodebox`.\r\nAnnotate namespace that already has pods in it.\r\n```shell\r\nk annotate ns infra-securecodebox auto-discovery.securecodebox.io/enabled=true\r\nk run -n infra-securecodebox --rm -it --image nginx:alpine3.17 nginx-test-scan --set config.containerAutoDiscovery.enabled=true\r\n```\r\n\r\n### Expected behavior\r\n\r\nSecure Code Box auto discovery service ignores deletion of pod with no scans.\r\n\r\n### System:\r\n - secureCodeBox: 4.9.0\r\n - Kubernetes Version: 1.30\r\n\r\n\r\n### Screenshots / Logs\r\nLogs from auto-discovery container\r\n```\r\n2024-10-08T08:27:19Z ERROR controllers.ContainerScanController Unable to fetch scan {\"name\": \"nginx-trivy-at-647c5c83418c19eef0cddc647b9899326e3081576390c4c\", \"error\": \"ScheduledScan.execution.securecodebox.io \\\"nginx-trivy-at-647c5c8\r\ngithub.com/secureCodeBox/secureCodeBox/auto-discovery/kubernetes/controllers.(*ContainerScanReconciler).getOrphanedScanImageIDs\r\n /workspace/controllers/container_scan_controller.go:422\r\ngithub.com/secureCodeBox/secureCodeBox/auto-discovery/kubernetes/controllers.(*ContainerScanReconciler).checkIfScansNeedToBeDeleted\r\n /workspace/controllers/container_scan_controller.go:406\r\ngithub.com/secureCodeBox/secureCodeBox/auto-discovery/kubernetes/controllers.(*ContainerScanReconciler).Reconcile\r\n /workspace/controllers/container_scan_controller.go:84\r\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\r\n /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.2/pkg/internal/controller/controller.go:114\r\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\r\n /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.2/pkg/internal/controller/controller.go:311\r\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\r\n /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.2/pkg/internal/controller/controller.go:261\r\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\r\n /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.2/pkg/internal/controller/controller.go:222\r\n```\r\n\r\n### Additional context\r\n\u003c!-- Add any other context about the problem here. --\u003e\r\n","author":{"url":"https://github.com/paraddise","@type":"Person","name":"paraddise"},"datePublished":"2024-10-08T08:37:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/2699/secureCodeBox/issues/2699"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:40718fd4-9d80-9a2e-7ced-54d348302450 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 881C:FB0A:23E5A9:2E7153:6990ADD5 |
| html-safe-nonce | 514f5586d91210ba4deadf329ecad7ced3c755b3d7b9103f46c88587dfd9f2ce |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODFDOkZCMEE6MjNFNUE5OjJFNzE1Mzo2OTkwQURENSIsInZpc2l0b3JfaWQiOiI3NTE2MzM0MTU1Nzk5NTA2Mzg5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3b167781e48bddc5c906b595626439457e5e6277366297c5ad62a45a0ce7bac6 |
| hovercard-subject-tag | issue:2572498194 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/secureCodeBox/secureCodeBox/2699/issue_layout |
| twitter:image | https://opengraph.githubassets.com/978410d50347543eb28d4876dba7780a8ff70fe3dbe6e98b427fea9b4a3f7209/secureCodeBox/secureCodeBox/issues/2699 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/978410d50347543eb28d4876dba7780a8ff70fe3dbe6e98b427fea9b4a3f7209/secureCodeBox/secureCodeBox/issues/2699 |
| og:image:alt | 🐞 Bug report I deployed SCB Auto Discovery to kubernetes, annotated existing namespace with some pods in it. Then killed nginx pod and Auto Discovery service failed to fetch Scan and process anothe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | paraddise |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/secureCodeBox/secureCodeBox git https://github.com/secureCodeBox/secureCodeBox.git |
| octolytics-dimension-user_id | 34573705 |
| octolytics-dimension-user_login | secureCodeBox |
| octolytics-dimension-repository_id | 80711933 |
| octolytics-dimension-repository_nwo | secureCodeBox/secureCodeBox |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 80711933 |
| octolytics-dimension-repository_network_root_nwo | secureCodeBox/secureCodeBox |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width