Security Best Practices
In addition to the out-of-the-box security capabilities provides by App Platform, it is a responsibility of Teams to keep their applications safe from bad actors. Here is a list of security best-practices Teams should implement:
-
Use secrets to secure sensitive data and use a
secretKeyRef
to map an environment variable to the secret data. -
Drop
ALL
or specific capabilities in the Pod or containerSecurityContext
to ensure all (unused) capabilities are disabled. -
Make sure containers are running with a read-only root file system by setting the
readOnlyRootFilesystem
totrue
in the Pod or containerSecurityContext
. -
Prevent pods from sharing the host’s IPC or network namespace by setting the
hostNetwork
parameter tofalse
. -
Avoid running containers in privileged mode by setting the
allowPrivilegeEscalation
parameter to false in the Pod or containerSecurityContext
. -
Identify and mitigate threats in running containers. See the Detect threats in running containers hands-on lab for more information.
-
Scan running container for vulnerabilities. See the Scan running containers for vulnerabilities hands-on lab for more information.
-
Scan images pushed to the Team's private container registry in Harbor for vulnerabilities. See the Scan images for vulnerabilities hands-on lab for more information.