Novabase

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.

policy.orrChecked, no problems
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)
  };
}
Illustration: one standard rule keeps a service off the network.

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.

  1. 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.

  2. Use the standard library

    Common rules come with the compiler under orrery::. Include one and skip writing it yourself.

  3. 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.

indexer.orrreaches 1 subject
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;
  }
}
Illustration: one resource, one named operation, one service allowed to use it.

What you get

Fewer ways to get it wrong.

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

Get started

Start with a project.

Pick a plan, sign up with your email and deploy your first Blueprint.