nixos-config/nix/verify/modules/closedPorts.nix
Ingolf Wagner 614a1d8e37
Some checks failed
Build all NixOS Configurations / nix build (push) Has been cancelled
add local command to verify
2024-09-15 07:04:59 +07:00

47 lines
1,015 B
Nix

{ lib, ... }:
with lib;
with types;
{
# 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.
'';
};
};
});
};
}