Title: AutoDiscovery: volume is propagated as emptyDir to ScheduledScan · Issue #2724 · secureCodeBox/secureCodeBox · GitHub
Open Graph Title: AutoDiscovery: volume is propagated as emptyDir to ScheduledScan · Issue #2724 · secureCodeBox/secureCodeBox
X Title: AutoDiscovery: volume is propagated as emptyDir to ScheduledScan · Issue #2724 · secureCodeBox/secureCodeBox
Description: 🐞 Bug report Describe the bug Deployed auto-discovery service with custom zap config and added volumes, but in ScheduledScan volume is emptyDir, but must be configMap. Steps To Reproduce Create configMap with zap config. Deploy configmap...
Open Graph Description: 🐞 Bug report Describe the bug Deployed auto-discovery service with custom zap config and added volumes, but in ScheduledScan volume is emptyDir, but must be configMap. Steps To Reproduce Create con...
X Description: 🐞 Bug report Describe the bug Deployed auto-discovery service with custom zap config and added volumes, but in ScheduledScan volume is emptyDir, but must be configMap. Steps To Reproduce Create con...
Opengraph URL: https://github.com/secureCodeBox/secureCodeBox/issues/2724
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AutoDiscovery: volume is propagated as emptyDir to ScheduledScan","articleBody":"## 🐞 Bug report\r\n\r\n### Describe the bug\r\nDeployed auto-discovery service with custom zap config and added volumes, but in ScheduledScan volume is emptyDir, but must be configMap.\r\n\r\n### Steps To Reproduce\r\n1. Create configMap with zap config.\r\n2. Deploy configmap with serviceDiscovery config:\r\n```yaml\r\nserviceAutoDiscovery:\r\n enabled: true\r\n scanConfigs:\r\n - scanType: zap-advanced-scan\r\n name: \"zap\"\r\n parameters:\r\n - \"-t\"\r\n - \"{{ .Host.Type }}://{{ .Service.Name }}.{{ .Service.Namespace }}.svc:{{ .Host.Port }}\"\r\n repeatInterval: \"168h\"\r\n labels: {}\r\n annotations:\r\n defectdojo.securecodebox.io/product-type-name: \"SecureCodeBox\"\r\n defectdojo.securecodebox.io/product-name: \"{{ .Cluster.Name }} | {{ .Namespace.Name }} | {{ .Target.Name }}\"\r\n defectdojo.securecodebox.io/product-tags: \"cluster/{{ .Cluster.Name }},namespace/{{ .Namespace.Name }}\"\r\n defectdojo.securecodebox.io/engagement-name: \"{{ .Target.Name }}\"\r\n defectdojo.securecodebox.io/engagement-version: \"{{if (index .Target.Labels `app.kubernetes.io/version`) }}{{ index .Target.Labels `app.kubernetes.io/version` }}{{end}}\"\r\n volumes:\r\n - name: zap-advanced-scan-config\r\n configMap:\r\n name: zap-advanced-scan-config\r\n optional: true\r\n volumeMounts:\r\n - name: zap-advanced-scan-config\r\n mountPath: /home/securecodebox/configs/2-zap-advanced-scan.yaml\r\n subPath: 2-zap-advanced-scan.yaml\r\n readOnly: true\r\n hookSelector: {}\r\n env: []\r\n```\r\n3. Observer ScheduledScan\r\n```shell\r\nk get -n default scheduledscan juice-shop-service-zap-port-3000 -o jsonpath='{ .spec }' | jq\r\n```\r\n```json\r\n{\r\n \"interval\": \"168h0m0s\",\r\n \"retriggerOnScanTypeChange\": true,\r\n \"scanSpec\": {\r\n \"parameters\": [\r\n \"-t\",\r\n \"http://juice-shop.default.svc:3000\"\r\n ],\r\n \"resourceMode\": \"namespaceLocal\",\r\n \"scanType\": \"zap-advanced-scan\",\r\n \"volumeMounts\": [\r\n {\r\n \"mountPath\": \"/home/securecodebox/configs/2-zap-advanced-scan.yaml\",\r\n \"name\": \"zap-advanced-scan-config\",\r\n \"readOnly\": true,\r\n \"subPath\": \"2-zap-advanced-scan.yaml\"\r\n }\r\n ],\r\n \"volumes\": [\r\n {\r\n \"name\": \"zap-advanced-scan-config\"\r\n }\r\n ]\r\n }\r\n}\r\n```\r\n4. pod will be created with emptyDir.\r\n\r\n### Expected behavior\r\nvolume propagated to pod\r\n\r\n### System (please complete the following information):\r\n - secureCodeBox Version: 4.9.0\r\n - Kubernetes Version: 1.30\r\n\r\n### Additional context\r\nI checked source, I saw there just reference to `corev1.Volume` https://github.com/secureCodeBox/secureCodeBox/blob/main/auto-discovery/kubernetes/pkg/config/autodiscovery_config.go#L76\r\nSo I don't understand why auto-discovery ignores configMap.\r\n","author":{"url":"https://github.com/paraddise","@type":"Person","name":"paraddise"},"datePublished":"2024-10-21T10:04:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2724/secureCodeBox/issues/2724"}
| 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:d047a8b6-0aa0-e291-e3d3-d6c93032cfc2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E10C:DA633:520A840:6A75BEB:697525E1 |
| html-safe-nonce | 6dbe2f2cce2b19257c265df292991565eac1b104ebe68e25fafe220df725f933 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTBDOkRBNjMzOjUyMEE4NDA6NkE3NUJFQjo2OTc1MjVFMSIsInZpc2l0b3JfaWQiOiI0NTUzNzkwMjUxODg4NjE2OTI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f74ae6f47e46de2175e39c0d3e1e88e962ccd79363344f0c4768d7d6e28811d0 |
| hovercard-subject-tag | issue:2602028326 |
| 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/2724/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fb147a0d211e11813e6c935d827dd25988957f31b70bc175c81be76e0d2172e6/secureCodeBox/secureCodeBox/issues/2724 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fb147a0d211e11813e6c935d827dd25988957f31b70bc175c81be76e0d2172e6/secureCodeBox/secureCodeBox/issues/2724 |
| og:image:alt | 🐞 Bug report Describe the bug Deployed auto-discovery service with custom zap config and added volumes, but in ScheduledScan volume is emptyDir, but must be configMap. Steps To Reproduce Create con... |
| 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 | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| 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 | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width