Use cases · Security policy
Keep security policy in the same source as the system.
NovaOS runs with SELinux enforcing. You write the policy in Orrery, next to the system it protects, and the compiler checks it with everything else.
use orrery::selinux::confinement
Selinux example::service_policy {
typegroup example_all_types = all();
include @Selinux(orrery::no_ip_sockets) with {
subject: Symbol(example_t),
targets: Symbol(example_all_types)
};
}
The problem
Policy lives somewhere else, and drifts.
Security policy is usually written by someone else, in another repository, in a language few people on the team read. The system changes and the policy does not, or the other way round.
When the two are in the same source, a change to one is a change you review with the other.
How Nova handles it
Write it, check it, see what it reaches.
Describe what a service may do
Name the files a service works with and the operations allowed on them, in the same project as the service.
Use the standard library
Common rules come with the compiler under
orrery::. Include one and skip writing it yourself.Let the compiler and editor check it
The compiler checks the policy with the rest of the source. The editor shows how far each permission reaches.
Readable by design
A policy that reads as a list of what is allowed.
Write a service's policy as a DomainPolicy and it can only describe named operations on named resources. Raw allow rules are refused there, so a reviewer reads what the service may do, not how the rules are spelled.
The name of an operation proves nothing. What counts is the permissions it expands to, and the editor and the graph show them.
DomainPolicy example::indexer_policy {
resource state = existing(var_t) {
inspect : [dir {search, getattr}, file {read, open, getattr}];
}
domain indexer_t {
roles: [system_r];
access state.inspect;
}
}
What you get
Fewer ways to get it wrong.
Enforcing by default
NovaOS runs with SELinux enforcing. A system starts strict and is opened deliberately.
Importing grants nothing
Bringing a policy module into a project adds no permissions. Only what you select and include does.
One rule, many services
A policy fragment takes typed parameters, so one reviewed definition serves several services.
Reach, in the editor
Above each definition the editor shows how many subjects it reaches, and in how many places.
Unused rules flagged
A permission definition that nothing reads gets a warning, so dead policy does not pile up.
Unsaved edits marked
Change a definition that is in use and the editor marks it as changed since the last save.
Good to know
The limits, plainly.
Do I have to write SELinux by hand?
No. You write Orrery. The compiler produces the policy and checks it.
Can I still write raw rules?
Yes, in an ordinary Selinux fragment. A DomainPolicy is the stricter form that refuses them.
Does this prove my policy is correct?
No. It checks that the policy is well formed and shows what each rule reaches. Whether that is what you intended is still a review.
Where does it apply?
To systems and jobs that run on NovaOS, managed or on your own hosts.
Keep going