Compare commits

..

9 Commits

5 changed files with 54 additions and 11 deletions

View File

@@ -13,6 +13,14 @@ in
mkIf cfg.fail2ban { mkIf cfg.fail2ban {
# Gestion de fail2ban # Gestion de fail2ban
# Paquets
environment.systemPackages = with pkgs; [
mailutils
whois
];
# Services # Services
services = { services = {
fail2ban = { fail2ban = {
@@ -30,13 +38,27 @@ mkIf cfg.fail2ban {
maxretry = 3 maxretry = 3
destemail = ${destemail} destemail = ${destemail}
# https://github.com/Baughn/nixpkgs/blob/master/nixos/modules/services/security/fail2ban.nix
findtime = 600
maxretry = 3
backend = systemd
enabled = true
''; '';
ssh-route = '' ssh-route = ''
filter = sshd filter = sshd
action = route[blocktype=blackhole] action = route[blocktype=blackhole]
maxretry = 3
''; '';
# désactivation car souci de PATH avec les commandes mail ou sendmail. Nécessite un path motifiable
# ticket à ouvrir
#ssh-mail = ''
# filter = sshd
# action = sendmail[sendername=Fail2ban @${config.networking.hostName}]
#'';
}; };
}; };
}; };
# https://github.com/NixOS/nixpkgs/issues/8437
services.fail2ban.jails.ssh-iptables = "enabled = true";
} }

View File

@@ -39,15 +39,13 @@ mkIf true {
## Exploitation FS ## Exploitation FS
inotify-tools # être notifié lorsque le contenu d'un répertoire change inotify-tools # être notifié lorsque le contenu d'un répertoire change
rdfind # recherche de fichiers doublons pour remplacement par hard/soft link rdfind # recherche de fichiers doublons pour remplacement par hard/soft link
]; (mkIf profiles.isDesktop
} // mkIf profiles.isDesktop { ## Gestion de FS
gparted # Gestion graphique de partitions
# Paquets )
environment.systemPackages = with pkgs; [ (mkIf profiles.isDesktop
## Gestion de FS unetbootin # création de clefs USB bootables
gparted # Gestion graphique de partitions )
#
#
unetbootin # création de clefs USB bootables
]; ];
} }

View File

@@ -13,6 +13,7 @@ in
./environment.nix ./environment.nix
./localisation.nix ./localisation.nix
#./network-ipv6.nix #./network-ipv6.nix
./sudo.nix
./service-haveged.nix ./service-haveged.nix
./service-monitoring.nix ./service-monitoring.nix
./service-ssh.nix ./service-ssh.nix

View File

@@ -9,6 +9,11 @@ in
mkIf true { mkIf true {
# Paquets
environment.systemPackages = with pkgs; [
mailutils
];
# Services # Services
## Noeud de supervision munin = pas de stockage des données locales ## Noeud de supervision munin = pas de stockage des données locales

17
public/sudo.nix Normal file
View File

@@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
cfg = config.r6d.config-generator;
computers = config.r6d.computers;
profiles = config.r6d.profiles;
in
mkIf true {
# Authorisation de certaines applications par sudo sans mot de passe
security.sudo.extraConfig = ''
%users ALL = NOPASSWD: ${pkgs.mtr}/bin/mtr
'';
}