DEV Community

丁久
丁久

Posted on • Originally published at dingjiu1989-hue.github.io

Container Runtime Security

This article was originally published on AI Study Room. For the full version with working code examples and related articles, visit the original post.

Container Runtime Security

Container Runtime Security

Container Runtime Security

Container Runtime Security

Container Runtime Security

Container Runtime Security

Container Runtime Security

Container Runtime Security

Container Runtime Security

Runtime Security Fundamentals

Container runtime security monitors and restricts container behavior during execution. It prevents attackers who gain container access from breaking out or causing damage.

seccomp Profiles

seccomp (Secure Computing Mode) restricts system calls:

{

"defaultAction": "SCMP_ACT_ERRNO",

"architectures": ["SCMP_ARCH_X86_64"],

"syscalls": [

{

"names": [

"accept4", "bind", "connect", "listen",

"read", "write", "open", "close",

"mmap", "munmap", "brk",

"exit", "exit_group", "getpid"

],

"action": "SCMP_ACT_ALLOW"

}

]

}

Apply profiles in Kubernetes:

apiVersion: v1

kind: Pod

metadata:

name: secure-app

spec:

securityContext:

seccompProfile:

type: Localhost

localhostProfile: profiles/audit.json

containers:

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\- name: app

image: myapp:latest

securityContext:

seccompProfile:

type: Localhost

localhostProfile: profiles/strict.json

AppArmor

AppArmor uses path-based access control:

AppArmor profile for container

include

profile container-strict flags=(attach_disconnected) {

include

Network

network inet tcp,

network inet udp,

Filesystem

/ r,

/proc/*/status r,


Read the full article on AI Study Room for complete code examples, comparison tables, and related resources.

Found this useful? Check out more developer guides and tool comparisons on AI Study Room.

Top comments (0)