Compare commits
3 commits
a65cbaee81
...
ceb94d7cb1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ceb94d7cb1 | ||
|
|
d5d41960f4 | ||
|
|
ff98be13a3 |
3 changed files with 56 additions and 0 deletions
29
kyra/security/audit.nix
Normal file
29
kyra/security/audit.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
_: {
|
||||
security = {
|
||||
audit = {
|
||||
enable = true;
|
||||
failureMode = 2;
|
||||
rules = [
|
||||
"-a always,exit -F arch=b64 -S mount,umount2,swapon,swapoff -k fs_ops"
|
||||
"-a always,exit -F arch=b64 -S init_module,delete_module,finit_module -k kernel_mods"
|
||||
"-a always,exit -F arch=b64 -S bind,connect,accept -F success=0 -k net_violations"
|
||||
"-w /run/secrets -p r -k secret_read"
|
||||
];
|
||||
};
|
||||
|
||||
auditd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
flush = "incremental_async";
|
||||
freq = 50;
|
||||
max_log_file = 10;
|
||||
num_logs = 3;
|
||||
max_log_file_action = "rotate";
|
||||
admin_space_left_action = "suspend";
|
||||
disk_full_action = "suspend";
|
||||
disk_error_action = "suspend";
|
||||
log_format = "ENRICHED";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
13
kyra/security/defaults.nix
Normal file
13
kyra/security/defaults.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
_: {
|
||||
security = {
|
||||
unprivilegedUsernsClone = false;
|
||||
forcePageTableIsolation = true;
|
||||
allowSimultaneousMultithreading = false;
|
||||
protectKernelImage = true;
|
||||
lockKernelModules = true;
|
||||
|
||||
virtualisation = {
|
||||
flushL1DataCache = "always";
|
||||
};
|
||||
};
|
||||
}
|
||||
14
kyra/services/journalctl.nix
Normal file
14
kyra/services/journalctl.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
_: {
|
||||
services = {
|
||||
journald = {
|
||||
audit = true;
|
||||
storage = "volatile";
|
||||
rateLimitBurst = 1000;
|
||||
rateLimitInterval = "30s";
|
||||
extraConfig = ''
|
||||
RuntimeMaxUse=128M
|
||||
MaxRetentionSec=1day
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue