Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/opnborg: init module #351630

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paepckehh
Copy link
Contributor

@paepckehh paepckehh commented Oct 27, 2024

Selfhostable OPNSense Appliance Configuration Management & Backup Portal

  • already in nixpkgs as package
  • now declarative usable as hardened systemd service

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@MarchCraft
Copy link
Contributor

MarchCraft commented Oct 27, 2024

Result of nixpkgs-review pr 351630 run on aarch64-linux 1

1 package blacklisted:
  • nixos-install-tools
Hey is this the right way to test this pr?

@patka-123
Copy link
Contributor

Since you are also the upstream developer, you would most likely know best how to properly add a nice test for this module. @paepckehh would mind doing that?

It's by no means a hard requirement to get this merged, but would be cool nonetheless!

@paepckehh
Copy link
Contributor Author

paepckehh commented Oct 27, 2024

Since you are also the upstream developer, you would most likely know best how to properly add a nice test for this module. @paepckehh would mind doing that?

It's by no means a hard requirement to get this merged, but would be cool nonetheles

Yes, big fan of unit tests - will pick up that point for my other packages as well!

In this special case the opnborg orchestrator needs a special (open source) firewall appliance (https://github.com/opnsense/) access (via api-key/secret)
to configure itself.

Without counterpart it will just terminate directly.

@paepckehh
Copy link
Contributor Author

paepckehh commented Oct 27, 2024

Result of nixpkgs-review pr 351630 run on aarch64-linux 1
1 package blacklisted:

Hey is this the right way to test this pr?

Love nixpkgs-review, really a great tool! Thank you!

options.services.opnborg = {
enable = mkEnableOption "opnborg";

user = mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need a fixed user for this service? Or can a systemd DynamicUser be used?

I think the main reason for needing a "real" user is if a local user needs to interact with the data directly, outside of the service. If the data is only accessed via the service than DynamicUser is the easiest solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backup data from the appliances contain sensitive information.

Having a dedicated user as owner might help develop individual firewall / security concepts if needed.

When this is a blocking point, I can remove the user. Its no hard requirement within the application itself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not about having a separate user. I think that makes sense. It's about creating an explicit user versus letting systemd create one implicitly via DynamicUser.

It's explained in more detail when to use what in https://discourse.nixos.org/t/predefined-uids-gids-when-to-use-them-and-when-not-to-use-them/956/3

Copy link
Contributor Author

@paepckehh paepckehh Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may need some guidance how to solve the following conflict:

  • The application clearly needs a fixed reliable deterministic gid/guid to store/backup/restore the appliances config data (/var/lib/) that contain secrets (keys,...)

  • The appliance (open source firewall / infrastructure / cluster) audience is rather small, so reserve a systemuser deterministic uid/gid below 399 via nixos/modules/misc/ids.nix tight address space might be not justified !?

Maybe my updated commit/proposal (fully verified & end-to-end tested) could be a common ground till rfc0052 makes more official headroom?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants