aa-unconfined
Report unconfined AppArmor processes
TLDR
List unconfined processes using the ss command (default)
Use netstat instead of ss to detect open network sockets
Show all processes from /proc with TCP/UDP ports and no AppArmor profiles (more detailed)
Display help
SYNOPSIS
aa-unconfined [options]
PARAMETERS
-d, --debug
Enables debugging output, providing more verbose information about the command's execution and internal operations. Useful for troubleshooting.
-h, --help
Displays a brief help message that summarizes the command's usage and available options, then exits.
-v, --verbose
Increases the verbosity of the output. This may include more details about each listed process or the scanning process itself.
-s, --skip-kernel-threads
Excludes kernel threads from the list of unconfined processes. Kernel threads are generally not managed by user-space AppArmor profiles and can clutter the output.
DESCRIPTION
The aa-unconfined command is a utility provided by the AppArmor security framework. Its primary purpose is to identify and list all currently running processes that are not confined by an AppArmor security profile. In a system where AppArmor is enabled, processes are ideally constrained by profiles that define what resources they can access and what actions they can perform. When a process is listed by aa-unconfined, it means it is running without such restrictions, either because no profile exists for its executable, or it has explicitly transitioned to an unconfined state.
This tool is invaluable for security auditing and ensuring that critical applications are running under appropriate AppArmor policies. It helps administrators identify potential gaps in their security posture, allowing them to create or refine profiles for unconfined applications, thereby reducing the system's attack surface. While an unconfined process isn't necessarily malicious, it represents a potential vector if compromised, as it has full system access.
CAVEATS
The aa-unconfined command requires the AppArmor kernel module to be loaded and active for it to function correctly. Its output only indicates processes not confined by AppArmor profiles; it does not imply that these processes are inherently malicious or vulnerable. They simply lack the mandatory access control restrictions that AppArmor provides. On systems with many processes, the output can be extensive, requiring piping to other tools like grep or less for easier analysis.
UNDERSTANDING UNCONFINED PROCESSES
A process can be listed as unconfined for several reasons:
1. No Profile Exists: The most common reason is that there is no AppArmor profile loaded for the executable being run by the process.
2. Explicit Unconfined Transition: An existing profile might contain a rule that explicitly allows a process to transition to an unconfined state, for example, if a specific helper application is not meant to be restricted by AppArmor.
3. Kernel Threads: By default (without -s), kernel threads might be listed as unconfined, as they operate outside the scope of user-space AppArmor policies.
HISTORY
AppArmor, originally developed by Immunix, was later acquired by Novell and subsequently open-sourced. It emerged as an alternative to SELinux, aiming for a simpler, path-based security policy model. AppArmor was integrated into SUSE Linux Enterprise and gained significant adoption with its inclusion in Ubuntu. The aa-unconfined utility, along with other aa-* tools, was developed as part of the AppArmor suite to provide administrators with the necessary tools for monitoring, managing, and auditing their AppArmor policies and system security posture effectively.
SEE ALSO
aa-status(8), apparmor(7), apparmor_parser(8), aa-enforce(8), aa-complain(8), aa-logprof(8)