For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overriding Security Contexts

Override the default pod, container, and init container security contexts for Connectware and Connectware agent components, including OpenShift-specific configuration.

Advanced configuration, use with caution

Default Security Contexts

By default, the connectware and connectware-agent Helm charts apply the following security contexts to follow best practice by running with low privileges:

Pod security context

runAsNonRoot: true
seccompProfile:
  type: RuntimeDefault
fsGroup: 1000

Container and init container security context

allowPrivilegeEscalation: false
capabilities:
  drop:
    - ALL

These defaults follow Kubernetes security best practices, running all containers as a non-root user with a minimal set of capabilities.

When to Override Security Contexts

You may need to customize these defaults when:

  • Custom compliance requirements: Your organization may require specific runAsUser, runAsGroup, or fsGroup values to meet security policy or regulatory requirements.

  • Restricted cluster policies: Some clusters enforce admission controllers or OPA policies that require specific security context values. For example, OpenShift manages UID/GID assignments through SecurityContextConstraints (SCC), and setting fsGroup can conflict with OpenShift's pod admission.

Configuration Values

The following Helm values can be used to customize security contexts. All overrides accept standard Kubernetes security context definitions.

Value
Description

global.podSecurityContextOverride

Overrides the pod security context.

global.containerSecurityContextOverride

Overrides the container security context.

global.initContainerSecurityContextOverride

Overrides the init container security context. If not set, falls back to containerSecurityContext.

${COMPONENT_NAME}.podSecurityContextOverride

Overrides the pod security context for a specific component.

${COMPONENT_NAME}.containerSecurityContextOverride

Overrides the container security context for a specific component.

${COMPONENT_NAME}.initContainerSecurityContextOverride

Overrides the init container security context for a specific component. If not set, falls back to containerSecurityContext.

Overrides fully replace defaults without key merging

Configuring Security Contexts

The following tabs show how to configure security context overrides for the connectware Helm chart and the connectware-agent Helm chart.

Configuring a Global Security Context Override

To apply a custom security context to all Connectware components at once, set the override values under global.

Example: Setting a custom pod security context globally

Example: Setting a custom container security context globally

Example: Setting a separate init container security context globally

If not set, initContainerSecurityContextOverride falls back to containerSecurityContextOverride.

Configuring a Per-Component Security Context Override

You can override the security contexts for individual components by setting the same values under their own configuration section. A component-level value takes precedence over the global value.

All Connectware components support this value.

Example: Overriding the pod security context for the auth-server only

Only the authServer pod security context is overridden here. All other components retain their default security contexts, including other containers within the authServer pod.

Setting a Global Override with a Per-Component Exception

To apply a global security context while overriding a specific component, combine global values with a component-specific podSecurityContextOverride.

Example: Global override with a per-component exception for the broker

The broker component uses its own podSecurityContextOverride, which takes precedence over the global value. All other components use the global security context override.

Unsetting fsGroup for OpenShift

On OpenShift, setting fsGroup in the pod security context can conflict with OpenShift's SecurityContextConstraints (SCC) admission. The recommended approach is to set fsGroup to null, which allows OpenShift to manage the security context according to the applied SCC.

Override the default pod security context in the connectware Helm chart to allow OpenShift to manage the fsGroup assignment:

Reference

For the full list of security-context-related Helm values, see the Helm Chart Reference.

Last updated

Was this helpful?