Parcourir la source

concierge-permaudit: report unix accounts with empty password

guillaume il y a 6 ans
Parent
commit
85e53e9eb9
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      src/concierge-permaudit

+ 6 - 0
src/concierge-permaudit

@@ -4,6 +4,7 @@
 import argparse
 import os
 import pwd
+import spwd
 import re
 import shutil
 import subprocess
@@ -424,4 +425,9 @@ for pw in pwd.getpwall():
 if len(contentExceptions) > 0:
   logExceptions('These files contains sensible information', contentExceptions)
 
+credExceptions = []
+for sp in spwd.getspall():
+  if len(sp.sp_pwdp) == 0:
+    logExceptions('Password for unix user %s is empty' % (sp.sp_namp))
+
 printExceptions()