Technical architectural analysis, practical configuration manifests, and deployment instructions for AppArmor Security Profiles for Kubernetes.
๐ Table of Contents
- Understanding AppArmor behavior
- Why AppArmor? (DAC vs MAC)
- AppArmor’s core mode and profile controls
- AppArmor integration in Kubernetes (K8s) environments
- Key summary
- References
- Summary of Kubernetes usage
- 1. Overview & Concepts
- 2. System Architecture
- 3. Sequence Diagram
- 4. System binary
- 5. Utility binary
- Tips for taking and using the Certified Kubernetes Security Specialist (CKS)
Understanding AppArmor behavior
Why AppArmor? (DAC vs MAC)
- Discretionary Access Control (DAC)
- Definition: Linux’s basic security model that grants file permissions (
rwxrwxrwx) based on user/group identity. - Limits: The process inherits all privileges of the user that runs it.
- Vulnerability Example: When a simple log cleanup program (
cleanup.sh) is running with root privileges, even if it is contaminated by an attacker and attempts to leak important data to the external Internet or execute a binary such asping, there is no way to restrict this in the DAC environment because the user is root. - Mandatory Access Control (MAC)
- Definition: Forcibly constrains the behavior of a process based on a central, predefined security policy (profile).
- Effect: Even if the process runs with root privileges, any actions not specified in the profile (e.g. connecting to the Internet, accessing unauthorized files, etc.) are blocked.
- Alternative solutions: Representative examples include SELinux (RedHat family, complex configuration) and AppArmor (Ubuntu/Debian family, intuitive and relatively easy configuration).
AppArmor’s core mode and profile controls
AppArmor can operate in three modes on your system:
1. AppArmor 3 modes
- Enforce (enforcement mode): Immediately blocks unauthorized activity by enforcing the defined security profile.
- Complain (report mode): Does not block policy violations, but only records them in the logs (
syslog,audit.log). (Mainly used in the testing phase before application to the operating environment) - Unconfined: Runs like a normal process without any restrictions.
# ํน์ ํ๋กํ์ผ์ 'Enforce (์ค์ ์ฐจ๋จํ๋ ๋ชจ๋)'๋ก ๋ณ๊ฒฝ
sudo aa-enforce /etc/apparmor.d/$profile
# ํน์ ํ๋กํ์ผ์ 'Complain (๋ก๊ทธ๋ง ๋จ๊ธฐ๋ ๋ชจ๋)'๋ก ๋ณ๊ฒฝ
sudo aa-complain /etc/apparmor.d/$profile
# ํ๋กํ ์ ๊ฑฐ = 'Unconfined (ํ๋กํ์ด ์ ์ฉ๋์ง ์์ ์ํ)'๋ก ๋ณ๊ฒฝ
sudo apparmor_parser -R /etc/apparmor.d/$profile
2. Hands-on: Automatic profile creation process
Instead of writing rules manually, you can easily build profiles using AppArmor’s monitoring tools.
- Utility Installation
# auditd ์ค์น (syslog์ Appํ๋ ๊ธฐ๋ก, profile ์๋์์ฑ์ ํ์)
sudo apt install -y auditd
# auditd ์๋น์ค ์์ ๋ฐ ๋ถํ
์ ์๋ ์คํ ์ค์
sudo systemctl start auditd
sudo systemctl enable auditd
sudo apt-get install -y apparmor-utils
- Write target script (
/root/apparmor/app.sh)
mkdir -p /root/apparmor/
cat <<EOF > /root/apparmor/app.sh
#!/bin/bash
touch /tmp/file.txt # ์์ ํ์ผ ์์ฑ
echo "File Created"
rm /tmp/file.txt # ์์ ํ์ผ ์ญ์
echo "File Removed"
EOF
- Run automatic profile creation
sudo aa-genprof /root/apparmor/app.sh
- After execution, actually run the script (
./app.sh) in another terminal to create the file access pattern you normally need. - Return to the
aa-genprofscreen, enterSto scan the log, and selectInheritorAllowfor access requests. - Once the profile is saved, a file is created in the
/etc/apparmor.d/root.apparmor.app.shpath.
Allow Guide (S โ I โ I โ A โ A โ A โ A โ S โ F)
[(S)can system log for AppArmor events] / (F)inish
Reading log entries from /var/log/audit/audit.log.
Profile: /root/apparmor/app.sh
Execute: /usr/bin/touch
Severity: 3
(I)nherit / (C)hild / (N)amed / (X) ix On / (D)eny / Abo(r)t / (F)inish
Profile: /root/apparmor/app.sh
Execute: /usr/bin/rm
Severity: unknown
(I)nherit / (C)hild / (N)amed / (X) ix On / (D)eny / Abo(r)t / (F)inish
Complain-mode changes:
Profile: /root/apparmor/app.sh
Path: /dev/tty
New Mode: owner rw
Severity: 9
[1 - include <abstractions/consoles>]
2 - owner /dev/tty rw,
(A)llow / [(D)eny] / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Audi(t) / (O)wner permissions off / Abo(r)t / (F)inish
Adding include <abstractions/consoles> to profile.
Profile: /root/apparmor/app.sh
Path: /etc/ld.so.cache
New Mode: owner r
Severity: 1
[1 - owner /etc/ld.so.cache r,]
(A)llow / [(D)eny] / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Audi(t) / (O)wner permissions off / Abo(r)t / (F)inish
Adding owner /etc/ld.so.cache r, to profile.
Profile: /root/apparmor/app.sh
Path: /etc/locale.alias
New Mode: owner r
Severity: unknown
[1 - owner /etc/locale.alias r,]
(A)llow / [(D)eny] / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Audi(t) / (O)wner permissions off / Abo(r)t / (F)inish
Adding owner /etc/locale.alias r, to profile.
Profile: /root/apparmor/app.sh
Path: /tmp/file.txt
New Mode: owner w
Severity: unknown
[1 - include <abstractions/user-tmp>]
2 - owner /tmp/file.txt w,
(A)llow / [(D)eny] / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Audi(t) / (O)wner permissions off / Abo(r)t / (F)inish
Adding include <abstractions/user-tmp> to profile.
= Changed Local Profiles =
The following local profiles were changed. Would you like to save them?
[1 - /root/apparmor/app.sh]
(S)ave Changes / Save Selec(t)ed Profile / [(V)iew Changes] / View Changes b/w (C)lean profiles / Abo(r)t
Writing updated profile for /root/apparmor/app.sh.
Profiling: /root/apparmor/app.sh
Please start the application to be profiled in
another window and exercise its functionality now.
Once completed, select the "Scan" option below in
order to scan the system logs for AppArmor events.
For each AppArmor event, you will be given the
opportunity to choose whether the access should be
allowed or denied.
[(S)can system log for AppArmor events] / (F)inish
Setting /root/apparmor/app.sh to enforce mode.
Reloaded AppArmor profiles in enforce mode.
Please consider contributing your new profile!
See the following wiki page for more information:
https://gitlab.com/apparmor/apparmor/wikis/Profiles
Finished generating profile for /root/apparmor/app.sh.
4. Testing unauthorized behavior
โ If you secretly add an unauthorized binary call such as ping localhost to the script and then run it, operation will be severely restricted with a Permission Denied error even if the executor is root.
5. How to deactivate (remove) a profile
sudo apparmor_parser -R /etc/apparmor.d/root.apparmor.app.sh
AppArmor integration in Kubernetes (K8s) environments
Kubernetes can load and apply a node-level AppArmor profile to improve the security of containers inside a Pod.
1. Prerequisites
- AppArmor must be enabled in the Node kernel.
- The AppArmor profile to be applied to the container must be preloaded on the file system of all nodes on which the pod will run.
2. Example AppArmor profile for K8s (deny all writes)
How to parse after registering in /etc/apparmor.d/k8s-deny-write file:
cat <<EOF > /etc/apparmor.d/k8s-deny-write
profile k8s-apparmor-example-deny-write flags=(attach_disconnected) {
file,
# ๋ชจ๋ ์ฐ๊ธฐ ๋์ ์ฐจ๋จ (์ฌ๊ธฐ์์ #์ ์ค์ ์ฃผ์์
๋๋ค)
deny /** w,
}
EOF
# ๋ก๋
sudo apparmor_parser -r -W /etc/apparmor.d/k8s-deny-write
# ํ๋กํ ๋ก๋ ์ํ ํ์ธ
aa-status | grep k8s-apparmor-example-deny-write
3. Pod manifest settings (apply securityContext)
Declare the profile via securityContext according to the V1.30+ specification or the general Pod specification.
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: hello-apparmor
spec:
securityContext:
appArmorProfile:
type: Localhost
localhostProfile: k8s-apparmor-example-deny-write # ๋
ธ๋์ ๋ก๋๋ ํ๋กํ ์ด๋ฆ
containers:
- name: busybox
image: busybox:1.36
command: ["sh", "-c", "echo 'Hello AppArmor' && sleep 3600"]
EOF
k get pods hello-apparmor
[!IMPORTANT]
Troubleshooting
- If the profile with the name specified by
localhostProfileis not actually loaded on the node, the Pod will not run and will remain in theContainerCreatingstate. - When you run
kubectl describe pod, you will see the error messageFailed to create container... AppArmor profile not found. Therefore, you must deploy security profiles to all nodes in batches using DaemonSet or a provisioning tool.
4. Profile application test
kubectl exec -it hello-apparmor -- sh
# in container
touch /tmp/test.txt
```prompt
touch: /tmp/test.txt: Permission denied
`
echo "test" > /var/log/test.log
```prompt
sh: can't create /var/log/test.log: nonexistent directory
`
5. Clean up test resources
# ํ๋กํ ์ ๊ฑฐ
sudo apparmor_parser -R /etc/apparmor.d/k8s-deny-write
# ํ๋กํ ํ์ผ ์ ๊ฑฐ
rm /etc/apparmor.d/k8s-deny-write
# ์ ๊ฑฐ
k delete pods hello-apparmor --force
Key summary
- AppArmor is a powerful Linux security module that complements DACโs โexcessive root privilege inheritanceโ problem.
- Production application strategy: If you apply Enforce mode right from the beginning, a disaster may occur where actual service functions are interrupted. Therefore, it is standard to start with Complain mode, analyze logs, and then change to Enforce when it is stabilized.
- K8s Security Fundamentals: The pattern of combining AppArmor settings with Pod-level
securityContextis essential to solidify the security perimeter in CKS testing and enterprise environments.
References
- AppArmor | Killer Shell CKS | Killercoda
- Restrict a Containerโs Access to Resources with AppArmor
- Configure a Security Context for a Pod or Container
- Certified Kubernetes Security Specialist 2026
Summary of Kubernetes usage
1. Overview & Concepts
AppArmor (Application Armor) is a Mandatory Access Control (MAC) system implemented in the Linux kernel. Complements traditional Unix-style discretionary access control (DAC, based on file owner and permissions) to restrict processes from accessing system resources (files, networks, functions, etc.).
Key concepts
- Path-based restrictions: While SELinux operates based on the โLabelโ of the file system, AppArmor applies security rules based on the absolute path of the file, making it intuitive and easy to manage.
- Profile: A text file that defines a list of tasks that a particular application or executable can perform. It is mainly located in the
/etc/apparmor.d/directory. - Execution Modes:
- Enforce (Enforce mode): Do not allow, block, and log actions not defined in the profile.
- Complain: Does not block if rules are violated, just logs what actions are not allowed. (Mainly used during development and profile learning stages)
Flow in Kubernetes environment
โ Applies to: Executable files (binaries) or processes in a specific path
โ Operates in: not inside the container, in the Linux kernel (LSM: Linux Security Module) on the host device
โ Restricting actions: * Read, write, and execute permissions for specific files/directories (r, w, x)
โ Network socket creation and communication
โ Use special functions (Capabilities) such as RAW capture
If you look at the flow of applying AppArmor in Kubernetes, it becomes clear why the process is subject to control.
- Load profile to host node: First, register the profile with AppArmor on the Kubernetes worker node (host OS). (Example:
k8s-apparmor-deny-write) - Declared in Pod YAML: Assigns that profile to a specific container through Pod settings.
- Applied when running the container: When the container runs, the container’s main process (PID 1) and its child processes are subject to profile restrictions by the host kernel.
Easy to understand example
If a process inside the container attempts to modify the /etc/passwd file or attempts an unauthorized network binding, AppArmor intercepts this at the host kernel level, generates a Permission Denied error, and blocks it.
Cluster Requirements
- Kubernetes version: 1.4\~
- AppArmor kernel module must be available. โ In order to force the AppArmor profile to the Linux kernel, the AppArmor kernel module must be installed and available. For example, distributions such as Ubuntu and SUSE support the module by default, while many others support it optionally.
# ๋ชจ๋์ด ์ฌ์ฉ ๊ฐ๋ฅํ์ง ํ์ธํ๋ ค๋ฉดย ๋ค์์ด `Y`์ธ์ง ํ์ธ
cat /sys/module/apparmor/parameters/enabled
- Container runtime supports AppArmor. โ Container runtimes such as Docker (original, Docker), CRI-O or containerd that currently support all common Kubernetes use AppArmor. Must support. You should refer to this runtime documentation to ensure that your cluster meets the requirements to use AppArmor.
- The profile is loaded. โ AppArmor applies to pods by specifying the AppArmor profile that should run with each container. If the profile specified in the kernel is not loaded, Kubelet (>= v1.4) rejects the pod.
# ํด๋น ๋
ธ๋์ ์ด๋ค ํ๋กํ์ผ์ด ์ ์ฌ๋์๋์ง๋ย ๋ค์์ ํตํด ํ์ธ
ssh nodename "sudo cat /sys/kernel/security/apparmor/profiles | sort"
About scope of application and profile designation
- AppArmor profiles can be specified at the pod level or container level. Container AppArmor profiles have higher priority than pod profiles.
pod.spec.containers.securityContext.appArmorProfilepod.spec.securityContext.appArmorProfileappArmorProfile
securityContext:
appArmorProfile:
type: <profile_type>
is one of the following:RuntimeDefault: Use the runtime’s default profileLocalhost: Use profile loaded on host (see below)Unconfined: Run without AppArmor
-
Description
โ`yaml
k explain pod.spec.securityContext.appArmorProfile
โ
KIND: Pod
VERSION: v1FIELD: appArmorProfile
DESCRIPTION:
appArmorProfile is the AppArmor options to use by the containers in this
pod. Note that this field cannot be set when spec.os.name is windows.
AppArmorProfile defines a pod or containerโs AppArmor settings.FIELDS:
localhostProfile
localhostProfile indicates a profile loaded on the node that should be used.
The profile must be preconfigured on the node to work. Must match the loaded
name of the profile. Must be set if and only if type is โLocalhostโ.type
-required-
enum: Localhost, RuntimeDefault, Unconfined
type indicates which kind of AppArmor profile will be applied. Valid options
are:
Localhost โ a profile pre-loaded on the node.
RuntimeDefault โ the container runtimeโs default profile.
Unconfined โ no AppArmor enforcement.Possible enum values: - `"Localhost"` indicates that a profile pre-loaded on the node should be used. - `"RuntimeDefault"` indicates that the container runtime's default AppArmor profile should be used. - `"Unconfined"` indicates that no AppArmor profile should be enforced.โ`
2. System Architecture
AppArmor operates in close connection with management tools in user space and the LSM (Linux Security Module) framework within the Linux kernel.
3. Sequence Diagram
This is a runtime flow in which the AppArmor kernel module checks and processes when a container or general process attempts to access a file.
4. System binary
AppArmor provides a variety of userspace tools and binaries for interacting with the kernel and managing profiles.
As it is a kernel security tool, it must be run separately on each node.
Core Management Binary
Binaries other than apparmor_parser and aa-status are confirmed to be outside the scope of the CKS exam.
apparmor_parser: The core binary of AppArmor. The human-readable text profile is parsed, compiled into a binary format that the kernel can understand, and then loaded into the kernel.
# -r ํ๋๊ทธ์ ํจ๊ป ์ฌ์ฉํ๋ฉด create/update ๋ชจ๋ ๋์๊ฐ๋ฅ
sudo apparmor_parser -r /etc/apparmor.d/$profile
# ํ๋กํ์ผ ์ ์ฉ
sudo apparmor_parser $profile
aa-status(orapparmor_status): Checks the AppArmor status of the current system. Shows the number of loaded profiles, the mode (Enforce/Complain) for each profile, and a list of processes being quarantined by the profile being applied.
# ์คํ๋ ๋
ธ๋์ ๋ก๋๋ ํ๋กํ ๋ชฉ๋ก ์กฐํ
sudo aa-status
# ํ๋กํ์ผ ํ์ฑํ์ฌ๋ถ ์กฐํ
sudo aa-status | grep $profile
System diagnosis and verification
aa-enabledThis is a binary that simply answers whether AppArmor is enabled in the current system kernel withYesorNo. Mainly used in script branch statements.
aa-enabled
Direct process isolation execution (outside the scope of the question)
aa-execUsed when executing a program while forcing a specific AppArmor profile.
aa-exec -p <ํ๋กํ์ด๋ฆ> <์คํํ ๋ช
๋ น์ด>
System management and initialization (mainly used during booting/shutdown) (outside the scope of the exam)
aa-teardownRemoves and unloads all AppArmor profiles loaded in the current kernel at once. In other words, it is used to temporarily completely disable all of AppArmor’s defenses. (Must be used with caution.)
sudo aa-teardown
aa-remove-unknownAmong the profiles loaded in the kernel, โUnknownโ profiles that do not exist as actual files in the current/etc/apparmor.d/directory are identified and automatically removed cleanly from the kernel.
sudo aa-remove-unknown
aa-loadThis is an internal script used to reload policy files in/etc/apparmor.d/into the kernel all at once. (Similar to runningapparmor_parser -rover the entire directory we learned earlier.)
sudo aa-load
For developer and internal verification (outside the scope of the exam)
aa-features-abiOutputs the AppArmor feature interface version supported by the current Linux kernel. It is rarely used directly in general operations or testing.
aa-features-abi
5. Utility binary
Profile creation and change management binary (outside the scope of the exam)
aa-genprof: Used when creating a profile for a new application from scratch. It automatically builds a rudimentary profile by running the program and monitoring its behavior.
sudo aa-genprof /usr/bin/custom-app
# ๋ช
๋ น์ด๋ฅผ ์คํํ๋ฉด ๋๊ธฐ ์ํ๊ฐ ๋ฉ๋๋ค.
# ๋ค๋ฅธ ํฐ๋ฏธ๋์์ custom-app์ ์คํํด ์ ์ญ์ ์ธ ์์
์ ์ํํ ๋ค,
# ๋ค์ ๋์์ 'S'๋ฅผ ๋๋ฌ ๋ก๊ทธ๋ฅผ ์ค์บํ๊ณ ํ๋กํ์ ์ ์ฅํฉ๋๋ค.
aa-logprof: Scans system logs (/var/log/audit/audit.logorsyslog) generated by Complain mode, etc., and interactively asks and updates the behavior of newly discovered applications to add to existing profiles.
sudo aa-logprof
# ์์คํ
๋ก๊ทธ๋ฅผ ์ฝ์ด์ ํ์ฉ ์ฌ๋ถ๋ฅผ ๋ฌป๋ ์ธํฐ๋ํฐ๋ธ ์ฐฝ(Y/N/A/D ๋ฑ)์ด ๋น๋๋ค.
aa-autodep: Analyzes the shared libraries and dependencies used by the target binary and automatically creates a very basic skeleton profile.
sudo aa-autodep /usr/bin/custom-app
Mode switching and utility binary (outside the scope of the exam)
aa-enforce: Immediately puts the target profile or binary into Enforce mode.
# ํ๋กํ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ง์ ํ๊ฑฐ๋, ๋ฑ๋ก๋ ๋ฐ์ด๋๋ฆฌ ๊ฒฝ๋ก๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค.
sudo aa-enforce /etc/apparmor.d/usr.sbin.nginx
sudo aa-enforce /usr/sbin/nginx
aa-complain: Immediately switches the target profile or binary to Complain mode.
sudo aa-complain /usr/sbin/nginx
aa-disable: Unloads a specific profile from the kernel and permanently disables it.
sudo aa-disable /usr/sbin/nginx
aa-audit: Force audit log recording for a specific profile.
# 1. ํน์ ๋ฐ์ด๋๋ฆฌ์ ์ ์ฉ๋ ํ๋กํ์ audit ๋ชจ๋ ๊ฐ์ ์ ์ฉ
sudo aa-audit /usr/sbin/nginx
# 2. ํ๋กํ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ง์ ์ง์ ํ์ฌ ์ ์ฉ
sudo aa-audit /etc/apparmor.d/usr.sbin.nginx
# 3. (์์ ๋ณต๊ตฌ) ๊ฐ์ฌ ๋ชจ๋๋ฅผ ํด์ ํ๊ณ ์ผ๋ฐ ๋ชจ๋๋ก ๋ณต๊ท
sudo aa-audit --remove /usr/sbin/nginx
aa-unconfined: Identifies a list of binaries that are not protected (restricted) by the AppArmor profile among processes currently running and opening a network socket.
# 1. ํ์ฌ ๋คํธ์ํฌ ์์ผ์ ์ด๊ณ ์คํ ์ค์ธ ํ๋ก์ธ์ค ์ค ๋ณดํธ๋ฐ์ง ์๋ ๋ชฉ๋ก ์ถ๋ ฅ
sudo aa-unconfined
# ์ถ๋ ฅ ์์:
# 1234 /usr/sbin/sshd not confined
# 5678 /usr/bin/python3 (์ ์ ๋ณดํธ ์ค์ธ ๊ฑด ์์ ์ ๋จ๊ฑฐ๋ ๋ค๋ฅด๊ฒ ํ์๋จ)
# 2. ๋คํธ์ํฌ ์ฌ์ฉ ์ฌ๋ถ์ ์๊ด์์ด, ์์คํ
์์ ์คํ ์ค์ธ ๋ชจ๋ ํ๋ก์ธ์ค๋ฅผ ์
์
์ด ๊ฒ์ฌ
sudo aa-unconfined --paranoid
aa-notify: A utility that sends a notification to the desktop or a designated channel when an AppArmor blocking log (DENIED) occurs.
aa-notify -p -s 5 &
# -p: ๋ฐ์คํฌํฑ ์๋ฆผ(Notification) ์ฐฝ์ผ๋ก ํ์
# -s 5: ์ต๊ทผ 5์ด ์ด๋ด์ ๋ฐ๋ฆฐ ๋ก๊ทธ๋ ์์ฝํด์ ๋ณด์ฌ์ค
Tips for taking and using the Certified Kubernetes Security Specialist (CKS)
AppArmor is one of the frequently asked, high-scoring security topics on the CKS exam. Here are some practical tips for solving problems quickly and without panicking at the test site.
CKS Test Center Practice Code of Conduct
- Check all worker nodes: The AppArmor profile must be loaded into the kernel of the worker node where the container will run directly, not the Kubernetes master. Connect
sshto the node specified in the problem and perform the operation. - Profile validity check: When connecting to a node, type
aa-statusto check whether the profile name requested in the problem is already loaded. - Memorize the new profile load command: If the profile file provided in the problem is specified, it must be loaded into the kernel using a parser. Bash
# ํ๋กํ ์ถ๊ฐ/์๋ก๊ณ ์นจ (-r ์ต์
์ฌ์ฉ)
sudo apparmor_parser -r /etc/apparmor.d/์ ๊ณต๋_ํ๋กํ_ํ์ผ๋ช
- Debugging when container startup fails: If a Pod that has completed AppArmor configuration goes into
CreateContainerConfigErrororCrashLoopBackOffstatus, immediately suspect the following two things.
โ Does the profile name written inlocalhostProfilematch the name that appears inaa-statusof the worker node, including lowercase and lowercase letters?
โ Are there any grammatical errors in the internal structure of the profile file? (Check the node’s/var/log/syslogorjournalctl -u kubelet)
Differences from seccomp (CKS frequent concept)
seccomp, which is required along with AppArmor in the CKS exam, also limits the process, but there is a difference in the โlayerโ that controls it.
| Security tools | Main blocking targets and criteria | Features |
| AppArmor |
Binary paths and resources (concepts) Example: โThis process is prohibited from reading /vmlinuz and prohibited from networkingโ
|
Intuitively controls abstracted resource access such as file paths and networks |
| seccomp |
System call number Example: โThis container is prohibited from using the chmod and chown system calls.โ
|
The kernel function itself is tightly blocked at the low level (syscall).
|
Problem solving tips
- Find and record whether a specific profile is activated on a specific node
### ์๊ฒฉ์ผ๋ก ๊ธฐ๋กํ๊ธฐ
cat <<EOF > /root/profiles.txt
$(ssh node01 bash -c 'aa-status' | grep -E 'docker-default|snap.lxd.lxc|ftpd|tcpdump' | awk '{print $1}')
EOF
### or ์ง์ ์กฐํ ํ ๊ธฐ๋ก
ssh node01
aa-status | grep -E 'docker-default|snap.lxd.lxc|ftpd|tcpdump'
- Rename the prepared profile and activate it on all nodes
### Change in File
vi $profile
```profile
profile <profile_name> flags=(attach_disconnected,mediate_deleted) {
`
### ๋ชจ๋ ๋
ธ๋์ ํ์ผ ์ ์ก
scp $profile node01:
### ๋ชจ๋ ๋
ธ๋์ ์ ์ฉ
apparmor_parser $profile
ssh node01
apparmor_parser $profile
- An error occurred due to an incorrect profile name. Modify deployment to succeed
# ํ๋กํ์ผ๋ช
ํ์ธ
ssh node01 bash -c 'aa-status'
# ์์ ์ ์ฉ
kubectl edit deployment -n $ns $deploy_name
```yaml
# pod.spec or pod.spec.containers
securityContext:
appArmorProfile:
type: Localhost
localhostProfile: <profile_name>
`
-
Specific container (Multi-Container) unit targeting type
1. Check the specified container name and move
pod.spec.securityContexttopod.spec.containers.securityContext




Leave a Reply