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

Improvements for desktop #15

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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