Linux command
aa-status 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo aa-status
Example
sudo aa-status --json
Example
sudo aa-status --pretty-json
Example
sudo aa-status --profiled
Example
sudo aa-status --enforced
Example
sudo aa-status --complaining
Example
sudo aa-status --kill
说明
aa-status reports the current state of AppArmor confinement on the system. By default, it displays a summary of loaded profiles grouped by enforcement mode (enforce, complain, kill, unconfined), the number of confined processes, and which profiles apply to them. Individual flags can query specific counters for use in scripts. The --json and --pretty-json flags provide machine-parseable output suitable for monitoring and automation pipelines.
参数
- --enabled
- Returns error code if AppArmor is not enabled
- --profiled
- Shows count of loaded AppArmor policies
- --enforced
- Shows count of enforcing policies
- --complaining
- Shows count of non-enforcing (complain mode) policies
- --kill
- Shows count of enforcing policies that terminate tasks on violations
- --prompt
- Shows count of enforcing policies with fallback to userspace mediation
- --special-unconfined
- Shows count of unconfined mode policies
- --process-mixed
- Shows count of processes confined by profile stacks with profiles in different modes
- --verbose
- Displays comprehensive AppArmor policy data (default behavior)
- --json
- Outputs policy data in JSON format for machine processing
- --pretty-json
- Provides human and machine-readable JSON output
- --count
- Shows only counts for selected information
- --show _TYPE_
- Specify what to display: processes, profiles, or all (default: all)
- --filter.mode _REGEX_
- Filter output by profile mode using a POSIX regular expression
- --filter.profiles _REGEX_
- Filter output by confining profile name using a POSIX regular expression
- --filter.pid _REGEX_
- Filter output by process PID using a POSIX regular expression
- --filter.exe _REGEX_
- Filter output by executable name using a POSIX regular expression
- --help
- Displays usage information
FAQ
What is the aa-status command used for?
aa-status reports the current state of AppArmor confinement on the system. By default, it displays a summary of loaded profiles grouped by enforcement mode (enforce, complain, kill, unconfined), the number of confined processes, and which profiles apply to them. Individual flags can query specific counters for use in scripts. The --json and --pretty-json flags provide machine-parseable output suitable for monitoring and automation pipelines.
How do I run a basic aa-status example?
Run `sudo aa-status` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --enabled do in aa-status?
Returns error code if AppArmor is not enabled