Security Context Configuration
Configure security contexts for Harness services to enhance container security and compliance
Security contexts define privilege and access control settings for containers. This document covers the readOnlyRootFilesystem security context field. Additional security context configurations will be added as they become available.
Why enable read-only root filesystems
Read-only root filesystems provide essential security hardening:
Prevent malware persistence: Attackers cannot install backdoors or modify system binaries, limiting damage from successful breaches
Ensure deployment consistency: Containers remain identical to their original image, eliminating configuration drift and unexpected behavior
Meet compliance requirements: Satisfies regulatory frameworks like SOC 2 and PCI DSS that mandate immutable infrastructure controls
Block privilege escalation: Prevents exploitation of vulnerabilities that rely on writing to system directories
The implementation automatically provisions writable volumes at /tmp, /var/log, and service-specific directories to maintain full functionality.
Supported services
Read-only root filesystem configuration is supported for these Harness services:
Chaos module:
chaos-web
Platform module:
audit-event-streamingaccess-controlchange-data-capturedebezium-servicegatewaylog-serviceng-managerng-dashboard-aggregatorpipeline-serviceplatform-servicepolicy-mgmtqueue-servicescm-servicetemplate-serviceng-auth-uiharness-managernext-gen-ui
Configuration methods
Individual service configuration
Enable read-only root filesystem for specific services using Helm overrides:
Replace <module_name> with either chaos or platform depending on the service, and <service_name> with one of the services listed above.
Example for gateway service:
Complete configuration
To enable read-only root filesystems for all supported services, create an override file named readonly-filesystem-override.yaml and add the following configuration:
Implementation
Apply the read-only filesystem configuration during your Harness deployment:
This command upgrades your existing Harness installation with read-only root filesystem security enabled for all configured services.
Last updated
Was this helpful?