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

Add domain check V-63319 #18

Open
njohnson11 opened this issue Apr 1, 2021 · 0 comments · May be fixed by #20
Open

Add domain check V-63319 #18

njohnson11 opened this issue Apr 1, 2021 · 0 comments · May be fixed by #20
Labels
bug Something isn't working

Comments

@njohnson11
Copy link

njohnson11 commented Apr 1, 2021

Control V-63319 mentions that the control is only applicable to domain-joined systems, however the test does not check for the system domain.

The fix could be implemented like this:

    domain = command('wmic computersystem get domain | FINDSTR /V Domain').stdout.strip
    if domain == 'WORKGROUP'
      impact 0.0
      describe 'This system is not joined to a domain, therefore this control is Not Applicable' do
        skip 'This system is not joined to a domain, therefore this control is Not Applicable'
      end
    else
      describe os.arch do
        it { should eq 'x86_64' }
      end
      describe os.name do
        it { should eq 'windows_10_enterprise' }
      end
    end

Or like this:

    is_domain = command("(gwmi win32_computersystem).partofdomain").stdout.strip == "True"
    if is_domain
      describe os.arch do
        it { should eq 'x86_64' }
      end
      describe os.name do
        it { should eq 'windows_10_enterprise' }
      end
    else
      impact 0.0
        describe 'This system is not joined to a domain, therefore this control is Not Applicable' do
          skip 'This system is not joined to a domain, therefore this control is Not Applicable'
        end
      else
    end
@njohnson11 njohnson11 linked a pull request Apr 1, 2021 that will close this issue
3 tasks
@njohnson11 njohnson11 linked a pull request Apr 2, 2021 that will close this issue
3 tasks
@Amndeep7 Amndeep7 added the bug Something isn't working label Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants