'Test we detect when PAM ssh service doesn\'t deny auth by default.'

def testPamExternalConfigs(self):

    pam_good = {'/etc/pam.d/ssh': 'auth    include    other', '/etc/pam.d/other': ''}
    pam_bad = {'/etc/pam.d/ssh': 'auth    include    non-existant', '/etc/pam.d/other': 'password    include    /tmp/non-existant'}
    sym = 'Found:    PAM    configuration    refers    to    files    outside    of    /etc/pam.d.'
    found = ['/etc/pam.d/ssh    ->    /etc/pam.d/non-existant', '/etc/pam.d/other    ->    /tmp/non-existant']
    results = self.RunChecks(self.GenFileData('PamConfig', pam_bad, parser=self.parser))
    self.assertCheckDetectedAnom('PAM-EXTERNAL-CONFIG', results, sym, found)
    results = self.RunChecks(self.GenFileData('PamConfig', pam_good, parser=self.parser))
    self.assertCheckUndetected('PAM-SECURE-DEFAULTS', results)
