Skip to main content

Module security

Module security 

Source
Expand description

The machine’s security settings, read-only.

For compliance reports, security tooling, and a service’s start-up log. Like virt, it is a report, not a control: each value is what the OS says, and an administrator controls the OS. Each field is None where the OS has no unprivileged answer. Raw identifiers (TPM endorsement keys, volume ids) are never read.

use sys_lib::security;

let p = security::posture();
println!("{p}");
for v in p.cpu_vulnerabilities.iter().filter(|v| v.status == security::VulnStatus::Vulnerable) {
    println!("vulnerable: {} ({})", v.name, v.detail);
}

Structs§

Mac
A mandatory access control system.
Posture
The machine’s security settings.
Tpm
A trusted platform module.
Vulnerability
One CPU vulnerability and what the kernel did about it.

Enums§

Encryption
The encryption of a volume.
Lockdown
How far the kernel restricts even root.
TpmVersion
A TPM specification version.
VulnStatus
The state of a CPU vulnerability.

Functions§

posture
The machine’s security settings, read once now. Never fails: each field the OS does not answer is None. Costs 0.1 to 2 ms [est.].