Browse Source

concierge-permaudit: report unix accounts with empty password

guillaume 6 years ago
parent
commit
85e53e9eb9
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/concierge-permaudit

+ 6 - 0
src/concierge-permaudit

@@ -4,6 +4,7 @@
 import argparse
 import argparse
 import os
 import os
 import pwd
 import pwd
+import spwd
 import re
 import re
 import shutil
 import shutil
 import subprocess
 import subprocess
@@ -424,4 +425,9 @@ for pw in pwd.getpwall():
 if len(contentExceptions) > 0:
 if len(contentExceptions) > 0:
   logExceptions('These files contains sensible information', contentExceptions)
   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()
 printExceptions()