JeremiahSecrist / regula-nix

This project aims to help implement and enforce various security standards in NixOS. Regula meaning standards in latin.
https://jeremiahsecrist.github.io/regula-nix/
MIT License
31 stars 1 forks source link

Meeting 1: Initial Project Design #9

Closed JeremiahSecrist closed 2 months ago

JeremiahSecrist commented 10 months ago

Date written: 04 December 2023 Authors: JeremiahSecrist, AkechiShiro Meeting duration : 1 hour, 30 minutes

Project Goal

This project aims to implement Compliance as code via NixOS language. Which aim to implement and enforce best practices.

NixOS relevant features :

Problem on types assertion vs warning

Handling evaluation checks vs runtime checks

#override feature
rules.mountpoints."/etc must be seperate" = {
   enforceLevel = 0;
    #0 = disable
    #1 = warn
    #2 = enforce
    evaluationCheck = (true or false);
    # TBD
    runtimeCheck = ;
    meta = { 
    errorMessage = type str "mountpoint isn't seperated from /"; # why the rule failed
    ruleNumber.<UID> = type str or type int; 
    };
};

Def of organizations

organizations = {
    UID = { #TODO find a standardised method of this
        # Define ruleset CIS Independent Linux 2.0
        CIS-0 = {
            org = "CIS";
            revision = "2.0";
            flavour = "Independent Linux";
            url = "https://downloads.cis...";
            maintainers = [];
        };
    };
};

UX

nix.security.profile.CIS-0 = {
    enable = true;
    # TODO: a structure to override rules
    enforceLevel = 1 or 2;
};

Solution for runtime checks

stretch feature: report card document

Path outside Nix store or inside Nix store : /etc/nixos/security-report.card

Could make an Excel spreadsheet XLSX