#NEWLINE# def testRootPATHDirCheck( self ) : #NEWLINE# #INDENT# 'Ensure root $PATH directory entries are editable only by root.' #NEWLINE# data = [ self . CreateStat ( '/usr/local/bin' , 0 , 60 , 16893 ) , self . CreateStat ( '/bin' , 70 , 0 , 33200 ) , self . CreateStat ( '/usr/local/sbin' , 1 , 0 , 41471 ) , self . CreateStat ( '/sbin' , 1 , 0 , 33024 ) , self . CreateStat ( '/usr' , 0 , 0 , 16822 ) , self . CreateStat ( '/usr/local' , 0 , 0 , 16877 ) , self . CreateStat ( '/usr/bin' , 0 , 0 , 41471 ) , self . CreateStat ( '/usr/sbin' , 0 , 0 , 33277 ) ] #NEWLINE# results = self . GenResults ( [ 'RootEnvPathDirs' ] , [ data ] ) #NEWLINE# check_id = 'CIS-ROOT-PATH-HAS-FOLDERS-WRITABLE-BY-NON-ROOT' #NEWLINE# sym = 'Found: Folders that comprise the default $PATH of root can be modified by non-privileged users.' #NEWLINE# found = [ '/usr/local/bin user: 0, group: 60, mode: drwxrwxr-x' , '/bin user: 70, group: 0, mode: -rw-rw----' , '/usr/local/sbin user: 1, group: 0, mode: lrwxrwxrwx' , '/sbin user: 1, group: 0, mode: -r--------' , '/usr user: 0, group: 0, mode: drw-rw-rw-' ] #NEWLINE# self . assertCheckDetectedAnom ( check_id , results , sym , data )