Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect domain role condition #60

Open
karikarshivani opened this issue Apr 4, 2023 · 0 comments
Open

Incorrect domain role condition #60

karikarshivani opened this issue Apr 4, 2023 · 0 comments

Comments

@karikarshivani
Copy link
Contributor

Some controls may have an incorrect domain role condition. For example, in V-73495, the check text states:

This applies to member servers. For domain controllers and standalone systems, this is NA.

So the code should be:

  domain_role = command('wmic computersystem get domainrole | Findstr /v DomainRole').stdout.strip

  if !(domain_role == '3')
    impact 0.0
    describe 'This control is not applicable as it only applies to member servers.' do
      skip 'This control is not applicable as it only applies to member servers.'
    end
  else
    describe registry_key('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System') do
      it { should have_property 'LocalAccountTokenFilterPolicy' }
      its('LocalAccountTokenFilterPolicy') { should cmp 0 }
    end
  end

Reference for domain role values

Thanks @damif5 for catching this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant