Commands.page Logo

Can htop display the security label of a process?

This article investigates the capabilities of the htop system monitor on Ubuntu Linux regarding process security labels. It provides a direct answer regarding native support and outlines the specific command-line alternatives required to view security contexts such as AppArmor profiles or SELinux labels.

By default, htop cannot display the security label of a process. The tool is designed primarily for monitoring system resources like CPU usage, memory consumption, and process states. It does not include columns for security contexts, SELinux labels, or AppArmor profiles in its standard configuration or column selection menu.

Ubuntu systems typically use AppArmor for mandatory access control rather than SELinux. To view the security label of a process on Ubuntu, you should use the ps command or query the proc filesystem directly. For AppArmor profiles, run the following command in the terminal:

ps -eZ | grep <process_name>

If you are using SELinux, the same ps -eZ command will display the security context in the first column. Alternatively, you can inspect the specific process attribute file directly using:

cat /proc/<PID>/attr/current

Replace <PID> with the actual process ID number. While htop is excellent for performance monitoring, administrative tasks involving security labels require dedicated command-line utilities designed for security auditing. Use ps or check the /proc directory for accurate security context information.