Lee Siang Fong

Blog › Cloud

Cloud-Native Security Best Practices: A Plain Guide

Practical cloud-native security best practices for containers, Kubernetes, secrets, pipelines and monitoring, explained for busy teams in Southeast Asia.

Cloud-native security best practices come down to a few habits. Build small, scanned container images. Give every service and person the least access it needs. Keep secrets out of code. Lock down network traffic between services. Watch what runs in production.

"Cloud-native" means apps built from containers and small services, usually run on Kubernetes or a managed cloud platform. This guide explains each habit and where to start.

Why cloud-native apps need different security

In a traditional setup, you had a few servers behind a firewall. In a cloud-native setup, you might have hundreds of containers starting and stopping every hour.

That changes the risks:

  • More moving parts. Each container image, API and cloud account is something to secure.
  • Short-lived workloads. A container may exist for minutes, so old "scan the server monthly" habits miss it.
  • Configuration is the new perimeter. One wrong setting, like a public storage bucket, can expose everything.

The US standards body NIST has a free container security guide (SP 800-190) that covers these risks in depth. It is a good reference for your IT team.

The core cloud-native security best practices

1. Build security into the pipeline

Your CI/CD pipeline is the automated process that builds and ships code. Add checks there, so problems are caught before they reach customers. People call this "shift left" or DevSecOps.

Useful automatic checks:

  • Scan code and dependencies for known vulnerabilities (published security flaws).
  • Scan container images before they are pushed.
  • Check infrastructure files (Terraform, Kubernetes YAML) for risky settings.
  • Fail the build on serious findings, not just warn.

2. Keep container images small and patched

A container image is the packaged app plus everything it needs to run. Smaller images have fewer parts that can be broken.

  • Start from a minimal, trusted base image.
  • Rebuild images regularly to pick up patches.
  • Don't run containers as the root (admin) user.
  • Pull images only from registries you control or trust.

3. Protect the software supply chain

Your app includes code written by many strangers: open-source libraries, base images, build tools. A supply chain attack poisons one of those.

The SLSA framework gives levels of protection for how software is built. Simple starting points: pin dependency versions, sign your images, and keep a list of what is inside each one (a software bill of materials, or SBOM).

4. Use least privilege everywhere

Least privilege means each user, service and API key gets only the access it needs.

  • Use single sign-on and multi-factor authentication (or passkeys) for all admin access.
  • Give each service its own identity. Don't share one powerful key.
  • Use Kubernetes role-based access control (RBAC) to limit who can change what.
  • Review access every quarter and remove what is unused.

This is the same idea as zero trust: never assume something is safe just because it is inside your network.

5. Manage secrets properly

Secrets are passwords, API keys and certificates. They should never sit in source code or a Git repository.

  • Store them in a secrets manager, such as your cloud provider's vault service or HashiCorp Vault.
  • Rotate them on a schedule and immediately after staff leave.
  • Note that plain Kubernetes Secrets are not encrypted by default. The Kubernetes guidance recommends turning on encryption at rest and limiting who can read them.

6. Segment the network

By default, pods (running containers) in a Kubernetes cluster can usually talk to each other freely. If an attacker gets into one, they can move to others.

Network Policies let you say "the payment service can only talk to the database." A service mesh can add encrypted traffic between services too.

7. Enforce safe pod settings

Kubernetes publishes Pod Security Standards with three levels: Privileged, Baseline and Restricted. Aim for Restricted for normal apps. It blocks risky options like running privileged containers.

8. Monitor at runtime and keep logs

Scanning before launch is not enough. You also need to see what happens while things run.

  • Turn on cloud audit logs and Kubernetes audit logs.
  • Use a runtime security tool to flag odd behaviour, such as a web container starting a shell.
  • Send logs somewhere attackers can't delete them.

Good monitoring also helps with day-to-day troubleshooting. See monitoring vs observability for more.

9. Plan for compliance and recovery

If you hold personal data of Malaysians, the PDPA applies wherever your cloud servers are. Know which region your data lives in. Keep immutable backups that ransomware can't change, and test restoring them.

Where to start

If this feels like a lot, pick these five first:

  1. Turn on MFA for every cloud and admin account.
  2. Move secrets out of code into a secrets manager.
  3. Add image and dependency scanning to your pipeline.
  4. Apply default-deny Network Policies to production.
  5. Turn on audit logging and keep the logs for at least a few months.

My view: many cloud incidents come from simple misconfigurations, not clever hacks. Getting these cloud-native security basics right covers a lot of ground.

Quick answers

What is cloud-native security?

It is protecting apps built from containers, microservices and cloud services. It covers the code, the images, the pipeline, the cluster and the cloud account settings.

Are Kubernetes Secrets safe to use?

They are better than hard-coding passwords, but they are not encrypted by default. Turn on encryption at rest, limit access with RBAC, or use an external secrets manager.

What is shift-left security?

It means testing for security problems early, while code is being written and built. Fixing a flaw in the pipeline is cheaper than fixing it in production.

Does a small team need all of this?

Not all at once. Start with MFA, secrets management, scanning and logging, then add network policies and runtime monitoring as you grow.

Sources

Read next