nixos-config/nix/verify/modules/closedPorts.nix

47 lines
1,015 B
Nix
Raw Normal View History

{ lib, ... }:
with lib;
with types;
{
2024-09-15 01:32:21 +02:00
# todo add remote command option
options.verify.closed = mkOption {
default = { };
example = {
public = {
host = "example.com";
ports = {
arr = [
7878
8989
8686
];
};
};
};
description = ''
Verify that ports the defined ports are closed for a specific interface.
Verification is done by rustscan.
'';
type = attrsOf (submodule {
options = {
host = mkOption {
type = str;
description = ''
The host against which the rustscan will be done.
Needed because we have more than interface on the machine.
'';
};
ports = mkOption {
default = { };
type = attrsOf (listOf int);
description = ''
service -> [port, ... ]
Ports that should be verified as beeing closed.
'';
};
};
});
};
2024-09-15 01:32:21 +02:00
}