Skip to content

Commit

Permalink
Improvements for desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
stusmall committed Nov 30, 2024
1 parent ca04aff commit 0a3a194
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 34 deletions.
11 changes: 3 additions & 8 deletions modules/slack.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
];

services.opensnitch.rules = {
rule-900-slack-1 = {
name = "Allow Slack Rule 1";
rule-900-slack = {
name = "Allow Slack Rule";
enabled = true;
action = "allow";
duration = "always";
Expand All @@ -18,12 +18,7 @@
type = "simple";
operand = "process.path";
sensitive = false;
data = "${lib.getBin pkgs.zoom-us}/bin/avahi-daemon";
}
{
type = "network";
operand = "dest.network";
data = "3.7.35.0/25";
data = "${lib.getBin pkgs.slack}/lib/slack/slack";
}
];
};
Expand Down
53 changes: 28 additions & 25 deletions modules/work.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,44 @@
services.tailscale.enable = lib.mkForce true;



nix.extraOptions = ''
experimental-features = nix-command flakes
'';

services.opensnitch.rules = {
rule-012-cargo = {
name = "Allow cargo";
enable = true;
# Since we have encrypted DNS disabled we should whitelist nsncd. This is unfortunately a very broad whitelist
rule-100-dns = {
name = "Allow DNS from nsncd";
enabled = true;
action = "allow";
duration = "always";
operator = {
type = "list";
operand = "list";
list = [
{
type = "regexp";
type = "simple";
sensitive = false;
operand = "process.path";
# Since we might have multiple rust versions installed we can't work off the exact path
data = ".*cargo$";
data = "${lib.getBin pkgs.nsncd}/bin/nsncd";
}
{
type = "regexp";
operand = "dest.host";
type = "simple";
operand = "protocol";
sensitive = false;
data = "^(([a-z0-9|-]+\.)*crates\.io|github\.com|)$";
data = "udp";
}
{
type = "simple";
operand = "dest.port";
sensitive = false;
data = "53";
}

];
};
};
rule-013-curl = {
# name = "Allow some expected curl desinations from work flake";
enable = true;
# Once again unfortunately pretty broad. We don't have great view into what tailscale will connect to or do.
rule-100-tailscale = {
name = "Allow tailscale";
enabled = true;
action = "allow";
duration = "always";
operator = {
type = "list";
operand = "list";
Expand All @@ -52,16 +55,16 @@
type = "simple";
sensitive = false;
operand = "process.path";
data = "${lib.getBin pkgs.curl}/bin/curl";
}
{
type = "simple";
operand = "dest.host";
sensitive = false;
data = "tarballs.nixos.org";
data = "${lib.getBin pkgs.tailscale}/bin/.tailscaled-wrapper";
}
];
};
};
};



nix.extraOptions = ''
experimental-features = nix-command flakes
'';
}
2 changes: 1 addition & 1 deletion modules/zoom.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
type = "simple";
sensitive = false;
operand = "process.path";
data = "${lib.getBin pkgs.zoom-us}opt/zoom/.zoom";
data = "${lib.getBin pkgs.zoom-us}/opt/zoom/.zoom";
};
};
};
Expand Down

0 comments on commit 0a3a194

Please sign in to comment.