cado(1) allows the system administrator to delegate capabilities to users. Users can grant a subset of
these ambient capabilities to trusted programs. Each user can define their own list of trusted programs
and which capabilities to grant, using a scado file. cado-S or cado--scado run those trusted programs
without any further authentication. In this way it is also possible to run programs requiring specific
capabilities within a bash script.
Scado is the command a user can run to create, edit, check or delete their own scado file.
Each line of a scado file file has the following syntax:
path_of_the_executable_file:capability_list
or
path_of_the_executable_file:capability_list:sha256_digest_of_the_executable
(See the EXAMPLES section at the end of the man page for more info. All the trailing part of a line
following a # sign is a comment.).
The path_of_the_executable_file must be absolute.
The capability_list is a comma separated list of capability names or capability masks. For brevity, the
cap_ prefix of capabilities names can be omitted (e.g. net_admin and cap_net_admin have the same
meaning).
The sha256_digest_of_the_executable prevents TOCTTOU attacks. When a user wants to run the file at
path_of_the_executable_file granting it some of the capabilities in the capability_list, the permission
is denied if its sha256 digest does not match sha256_digest_of_the_executable.
If there are only two colon (:) separated fields in a line, it means that the user trusts a priori the
integrity of the file whose pathname is path_of_the_executable_file. It can be, for example, a program
in /bin or /usr/bin not modifiable by users.
If there are three fields (i.e. two colon characters), it means that the user wants the cryptographic
digest check on the executable file integrity. When a user edits their scado file, if the field
(sha256_digest_of_the_executable) is empty, scado computes it automatically when the scado file is saved.
Scado asks for user authentication by PAM to confirm any modification of the scado file.
There is also a TOCTTOU protection at running time: cado -S copies the executable file in a safe place,
where the user cannot change it, and runs it only if the integrity check on it succeeds. The user (or a
malicious intruder acting as the user) cannot modify the file after the integrity check has completed and
before the program is loaded.