{"id":30071029,"url":"https://github.com/JeremiahSecrist/regula-nix","last_synced_at":"2025-08-08T12:08:22.242Z","repository":{"id":191268662,"uuid":"684292588","full_name":"JeremiahSecrist/regula-nix","owner":"JeremiahSecrist","description":"This project aims to help implement and enforce various security standards in NixOS. Regula meaning standards in latin.","archived":false,"fork":false,"pushed_at":"2025-03-10T03:45:22.000Z","size":973,"stargazers_count":33,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T03:46:56.276Z","etag":null,"topics":["cis-benchmark","flakes","nixos","security-automation"],"latest_commit_sha":null,"homepage":"https://jeremiahsecrist.github.io/regula-nix/","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JeremiahSecrist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-28T20:58:29.000Z","updated_at":"2025-03-10T03:45:26.000Z","dependencies_parsed_at":"2023-08-29T05:12:52.800Z","dependency_job_id":"cfa0160d-2159-452f-b9d7-cd5ee0146caa","html_url":"https://github.com/JeremiahSecrist/regula-nix","commit_stats":null,"previous_names":["jeremiahsecrist/regula-nix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JeremiahSecrist/regula-nix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeremiahSecrist%2Fregula-nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeremiahSecrist%2Fregula-nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeremiahSecrist%2Fregula-nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeremiahSecrist%2Fregula-nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JeremiahSecrist","download_url":"https://codeload.github.com/JeremiahSecrist/regula-nix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeremiahSecrist%2Fregula-nix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269417542,"owners_count":24413384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cis-benchmark","flakes","nixos","security-automation"],"created_at":"2025-08-08T12:08:00.122Z","updated_at":"2025-08-08T12:08:22.232Z","avatar_url":"https://github.com/JeremiahSecrist.png","language":"Nix","funding_links":[],"categories":["Security"],"sub_categories":[],"readme":"# Regula-nix\n\n![Under Construction](https://img.shields.io/badge/Under_Construction-%E2%9A%A0%EF%B8%8F-%23E65100?style=for-the-badge\u0026logo=warning\u0026logoColor=%23BF360C\u0026labelColor=%23E65100) [![Check flake](https://github.com/JeremiahSecrist/regula-nix/actions/workflows/checks.yml/badge.svg)](https://github.com/JeremiahSecrist/regula-nix/actions/workflows/checks.yml)\n\nA NixOS module aimed at making provable security compliance accessible and maintainable.\nPushing compliance checking to the left.\n\n## Core concepts\n\nRegula-nix offers a key NixOS module that when incorporated makes defining tests and restrictions about ones own config possible.\n\n\n## Examples\n```nix\n{\nregula.rules = {\n    sshdMustBeEnabled = {\n        enable = true;\n        eval.assertion.is = config.services.openssh.enable;\n        build = {\n            toplevel = {testData, failureContext}:{}; #a script that must return true when run against nixos output\n            perPackage = {testData, failureContext }:{}; # derivation that must build successfully.\n        };\n        vm = {\n            # This uses pytest with intergrations to the boot lifecycle of the system.\n            testScript = ''\n                with subtest(\"sshd must be enabled\"):\n                    machine.wait_for_unit(\"sshd.service\")\n                    machine.succeed(\"systemctl is-active -q sshd.service\")\n            '';\n        };\n        # extra info and data about this test that is available when relevant.\n        meta = {\n            # failureContext becomes a multiline string that is useful\n            failureContext = {\n                name = \"openssh is not enabled\";\n            };\n            # testData is available un alterd for use in relevant functions.\n            testData = {\n                example = \"foo\";\n            };\n        };\n    };\n};\n}\n```\n\n## Star History\n\n\u003ca href=\"https://star-history.com/#JeremiahSecrist/regula-nix\u0026Date\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=JeremiahSecrist/regula-nix\u0026type=Date\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=JeremiahSecrist/regula-nix\u0026type=Date\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=JeremiahSecrist/regula-nix\u0026type=Date\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJeremiahSecrist%2Fregula-nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJeremiahSecrist%2Fregula-nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJeremiahSecrist%2Fregula-nix/lists"}