323 task create helm subchart for clamav service#326
323 task create helm subchart for clamav service#326Aravinda-HWK wants to merge 11 commits intoLSFLK:mainfrom
Conversation
….yaml for persistence handling
- Introduced Redis chart with service, statefulset, and service account templates. - Added Rspamd chart including service, statefulset, config maps, and network policies. - Implemented liveness and readiness probes for both Redis and Rspamd. - Configured persistence for Redis and Rspamd with volume claim templates. - Created helper templates for both charts to manage naming and labels. - Added README files for both charts with installation and configuration instructions. - Established dependencies between Rspamd and Redis, Unbound, and ClamAV.
… checks and security context
…lates (LSFLK#320) * Create Helm subchart for OpenDKIM service with configuration and templates * Add detailed local testing instructions for OpenDKIM chart * Refactor OpenDKIM Helm chart: remove PVC template and adjust workload.yaml for persistence handling
….yaml for persistence handling
…uired directories
|
@maneeshaxyz Can you have a look on this PR as well? |
There was a problem hiding this comment.
Code Review
This pull request introduces new Helm subcharts for Redis, Unbound, ClamAV, and Rspamd to the silver umbrella chart. The review identified several security and configuration improvements, including the need to run containers as non-root users, the use of more restrictive file permissions, and the replacement of fragile string manipulation in Helm templates with more robust integer-based configurations.
| privileged: true | ||
| allowPrivilegeEscalation: true | ||
| runAsUser: 0 |
There was a problem hiding this comment.
Running Unbound with privileged: true and as root is a significant security risk. Unbound should run as a non-privileged user. If it needs to bind to port 53, use the NET_BIND_SERVICE capability instead of full privileges.
privileged: false
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
runAsUser: 100| command: | ||
| - /bin/sh | ||
| - -c | ||
| - chmod -R 0777 /var/lib/clamav /var/log/clamav /var/run/clamav |
There was a problem hiding this comment.
Setting directory permissions to 0777 is a security risk as it allows any user in the container to write to these paths. It is better to change the ownership of the directories to the specific user running the application (typically UID 100 for ClamAV) and use more restrictive permissions like 0770.
- chmod -R 0770 /var/lib/clamav /var/log/clamav /var/run/clamav && chown -R 100:101 /var/lib/clamav /var/log/clamav /var/run/clamav| runAsUser: 0 | ||
| runAsNonRoot: false |
| host: silver-clamav | ||
| port: 3310 | ||
| strictInitChecks: true | ||
| initCheckTimeout: 60s |
| - -c | ||
| - | | ||
| echo "Checking Redis connectivity at {{ .Values.dependencies.redis.host }}:{{ .Values.dependencies.redis.port }}" | ||
| timeout_sec={{ .Values.dependencies.initCheckTimeout | replace "s" "" }} |
| runAsUser: 0 | ||
| runAsNonRoot: false |
📌 Description
Adds a new Helm subchart for ClamAV so the Silver mail stack can run virus scanning as part of the Kubernetes deployment.
Closes #323
🔍 Changes Made
✅ Checklist (Email System)
🧪 Testing Instructions
3310📷 Screenshots / Logs (if applicable)