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

Fixes SeIncreaseQuotaPrivilege #44

Merged
merged 1 commit into from
Jun 30, 2020
Merged

Fixes SeIncreaseQuotaPrivilege #44

merged 1 commit into from
Jun 30, 2020

Conversation

imjoseangel
Copy link
Contributor

@imjoseangel imjoseangel commented Jun 27, 2020

Signed-off-by: imjoseangel [email protected]

Fixes #20 and #22

its('SeIncreaseQuotaPrivilege') { should include 'S-1-5-19' }
its('SeIncreaseQuotaPrivilege') { should include 'S-1-5-20' }
its('SeIncreaseQuotaPrivilege') { should include 'S-1-5-32-544' }
its('SeIncreaseQuotaPrivilege') { should eq ['S-1-5-19', 'S-1-5-20', 'S-1-5-32-544'] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still work, if it is not in this exact order?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rndmh3ro ,

I have tested it and is about how Windows manages the list:

By default you have:

Administrators
LOCAL SERVICE
NETWORK SERVICE

If you remove Administrators group, you get:

  ×  windows-014: Ensure 'Adjust memory quotas for a process' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE'
     ×  Security Policy SeIncreaseQuotaPrivilege is expected to eq ["S-1-5-19", "S-1-5-20", "S-1-5-32-544"]
     
     expected: ["S-1-5-19", "S-1-5-20", "S-1-5-32-544"]
          got: ["S-1-5-19", "S-1-5-20"]
     
     (compared using ==)

When adding back, Windows returns the list in that exact order always:

    windows-014: Ensure 'Adjust memory quotas for a process' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE'
       Security Policy SeIncreaseQuotaPrivilege is expected to eq ["S-1-5-19", "S-1-5-20", "S-1-5-32-544"]

If you add an extra user:

  ×  windows-014: Ensure 'Adjust memory quotas for a process' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE'
     ×  Security Policy SeIncreaseQuotaPrivilege is expected to eq ["S-1-5-19", "S-1-5-20", "S-1-5-32-544"]
     
     expected: ["S-1-5-19", "S-1-5-20", "S-1-5-32-544"]
          got: ["S-1-5-19", "S-1-5-20", "imjoseangel", "S-1-5-32-544"]
     
     (compared using ==)

etc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for investigating this!

@rndmh3ro
Copy link
Member

LGTM!

@chris-rock any remarks?

@chris-rock
Copy link
Member

Thank you @imjoseangel for this improvement!

@chris-rock chris-rock merged commit dd253fc into dev-sec:master Jun 30, 2020
@imjoseangel imjoseangel deleted the fix/SeIncreaseQuotaPrivilege branch July 1, 2020 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The 'should include' does not check for unwanted accounts
3 participants