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

cato: init at 5.2.1.1 #339533

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

YarekTyshchenko
Copy link
Contributor

@YarekTyshchenko YarekTyshchenko commented Sep 4, 2024

Description of changes

Add Cato VPN client
https://www.catonetworks.com/platform/cato-client/

From their webpage:

The Cato Client is a lightweight agent that provides secure zero-trust access to resources everywhere – on the Internet, SaaS, and Cloud or in your private data center. The Cato Client delivers endpoint protection capabilities for the enterprise with comprehensive malware prevention. With support for Windows, MacOS, Linux, Android, and iOS, the client brings the full capabilities of the Cato SASE Cloud Platform to any user device without compromising on security or network performance.

closes #338964

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.

@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Sep 4, 2024
@YarekTyshchenko
Copy link
Contributor Author

One thing I haven't solved yet is the named pipes created in /var/run/cato-sdp.* are owned by root, they should probably be owned by a new cato group, so users don't need to run cato-sdp with root, or manually chown the pipes.
Suggestions welcome, nay, pleaded for.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Sep 4, 2024
@Frontear
Copy link
Member

Frontear commented Sep 6, 2024

One thing I haven't solved yet is the named pipes created in /var/run/cato-sdp.* are owned by root, they should probably be owned by a new cato group, so users don't need to run cato-sdp with root, or manually chown the pipes. Suggestions welcome, nay, pleaded for.

For this I'd encourage writing a module that can leverage either some kind of systemd unit or systemd.tmpfiles to ensure proper permissions are set.

EDIT: Since I see there is a systemd service, set User=<USER> and write a nixos module to create this user. You can find multiple examples of such behavior in many nixos modules.

Copy link
Member

@Frontear Frontear left a comment

Choose a reason for hiding this comment

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

I believe the commonly accepted decision these days is to have the package in pkgs/by-name.

If you're certain about keeping it here, please link it in pkgs/top-level/all-packages.nix, as currently its inaccessible by the standard pkgs.cato entrypoint

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-linux: 1-10 10.rebuild-linux: 1 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Sep 20, 2024
@YarekTyshchenko
Copy link
Contributor Author

One thing I haven't solved yet is the named pipes created in /var/run/cato-sdp.* are owned by root, they should probably be owned by a new cato group, so users don't need to run cato-sdp with root, or manually chown the pipes. Suggestions welcome, nay, pleaded for.

For this I'd encourage writing a module that can leverage either some kind of systemd unit or systemd.tmpfiles to ensure proper permissions are set.

EDIT: Since I see there is a systemd service, set User=<USER> and write a nixos module to create this user. You can find multiple examples of such behavior in many nixos modules.

I have created a module. Tried to start the service with User=cato-client, but it needs permissions for /var/log/cato-client.log as well as to create the socket files in /var/run/. I don't have a way of overriding that, the service doesn't seem to have any options. I'd be cool if I could just run the whole think inside a fake /, but I'm not fussed having it running as root for now.

Are the paths correct now that it's a module? I notice that If I include it like this in my /etc/nixos/configuration.nix it doesn't install the other binary that I need, cato-sdp to enable the tunnel, and login with an account:

{ config, lib, pkgs, ... }:

{
  imports = [ /home/yarek/Play/nixpkgs/pkgs/by-name/ca/cato-client/package.nix ];

  services.cato-client.enable = true;
  # ...
}

Should I have a line that installs it into systemPackages somewhere inside the cfg.enable bit?

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Sep 20, 2024
@YarekTyshchenko
Copy link
Contributor Author

Now this looks better:

{ config, lib, pkgs, ... }:

{
  imports = [/home/yarek/Play/nixpkgs/nixos/modules/services/networking/cato-client.nix ];

  services.cato-client = {
    enable = true;
    package = (pkgs.callPackage /home/yarek/Play/nixpkgs/pkgs/by-name/ca/cato-client/package.nix {});
  };

@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: cato
4 participants