Closed carrodher closed 7 months ago
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
We are currently working on improving the overall security in our charts. During the following days, we will publish PRs with the following titles:
[bitnami/APP] feat!: :lock: :boom: Improve security defaults
Changes
These PRs perform the following changes:
Set
runAsGroup
to1001
Up until now, Bitnami charts were using user
1001
and grouproot
(following Openshift standards). However, there are Kubernetes platforms that do not allow using grouproot
. With the new changes, containers will no longer need grouproot
to work, becoming1001
the new defaultrunAsGroup
.This behavior can be reverted by setting
runAsGroup
back to0
.Set
readOnlyRootFilesystem
totrue
Using immutable filesystems is a mandatory requirement in most security checklists (such as NSA or MITRE). To allow this, we needed to change all writable paths of containers to
emptyDir
volumes. In some cases, we needed to add extra init containers that copy folders likeconf
,plugins
orlogs
. This is because mounted volumes substitute the contents of the original folders.IMPACT: This may cause issues with customization scripts like
initScripts
or using customcommand
andargs
. Using older versions of Bitnami containers may cause issues as they may not contain the required bash changes to allowreadOnlyRootFilesystem
.This behavior can be reverted by setting
readOnlyRootFilesystem
back tofalse
.Enable
resourcePresets
by defaultHaving pods without any resource requests or limits is strongly discouraged. These containers may cause major problems like draining node resources. Currently, our charts warn the user if the
resources
object is not set. In addition to this, we have theresourcesPreset
value to help users test different resource configurations, but this is not recommended for production. In the new changes, we set theresourcesPreset
value to the minimum size that works in our internal testing. This is by no means the recommended size by the Bitnami team, but it is the minimum size to perform basic testing of the solution. We insist that users should set their ownresource
values according to their needs and use case.IMPACT: Users already setting the
resource
value should be unaffected by this change. Those that were not setting resources may see a performance drop in their workloads as they would be configured to a minimal value for basic testing. If that is the case, we strongly advise you to set theresources
value before performing any upgrade.This behavior can be reverted by setting
resourcesPreset
back tonone
Perform automatic adaptation of
securityContext
sections in OpenshiftBefore this change, Bitnami charts were not working in Openshift restricted-v2 SCC because they were setting user and group to 1001. To fix this, we enabled the automatic adaptation of the
containerSecurityContext
andpodSecurityContext
sections when running in Openshift installations. If the detected platform is Openshift, the valuesrunAsUser
,runAsGroup
andfsGroup
will be removed automatically, letting the Openshift platform select the proper user and group IDs.IMPACT: Users deploying in platforms different from Openshift are unaffected by this change. Openshift users setting their own
runAsUser
,runAsGroup
andfsGroup
values will find that these are removed on upgrade.This behavior can be reverted by setting
global.compatibility.openshift.adaptSecurityContext
to false.Other changes previous to this major
In the previous major, we also performed a set of non-breaking changes
Do not use the default
serviceAccount
Now charts are generating their service account to avoid using the default in the namespace, which could have unwanted RBAC permissions or image pull credentials.
This behavior can be reverted by setting
serviceAccount.create=false
Create NetworkPolicies by default
Charts are creating NetworkPolicy objects with the following default behavior:
networkPolicy.allowExternalEgress=false
containerPorts
This behavior can be reverted by setting
networkPolicy.enabled=false
Add liveness/readiness probe to all objects
While this is part of our default behavior since the beginning, some objects were missing the probes section. Now all objects contain liveness and readiness probes.
This behavior can be reverted by setting
readinessProbe.enabled=false
andlivenessProbe.enabled=false
Support Kubernetes PSA restricted
To support the Kubernetes Pod Security Admission
restricted
, we needed to change the default values forcontainerSecurityContext
, such as 'runAsUser=1001',capabalities.drop=["ALL"]
,allowPrivilegeEscalation=false
,runAsRoot=false
, orhostNetwork=false
. This has been implemented in all applications that do not require privileges to run. Exceptions include applications like metallb, fluentd, whereabouts or multus-cni.