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

Request lowest access privilege required in Windows OpenProcess calls #50

Merged
merged 1 commit into from Oct 13, 2016

Conversation

Projects
None yet
3 participants
@andrewkroh
Copy link
Member

commented Oct 13, 2016

Gosigar requests PROCESS_ALL_ACCESS permission but the operation that it performs, GetProcessMemoryInfo, requires only PROCESS_QUERY_INFORMATION and PROCESS_VM_READ. gosigar should only request the permissions that it requires.

In other parts of gosigar it requests PROCESS_QUERY_INFORMATION, but in Windows Vista and newer there is a more limited privilege we can request called PROCESS_QUERY_LIMITED_INFORMATION. This can be used for GetProcessTimes, GetProcessImageFileName, and GetExitCodeProcess. It cannot be used for OpenProcessToken.

Request lowest access privilege required in Windows OpenProcess calls.
Gosigar requests PROCESS_ALL_ACCESS permission but the operation that it performs, GetProcessMemoryInfo, requires only PROCESS_QUERY_INFORMATION and PROCESS_VM_READ. gosigar should only request the permissions that it requires.

In other parts of gosigar it requests PROCESS_QUERY_INFORMATION, but in Windows Vista and newer there is a more limited privilege we can request called PROCESS_QUERY_LIMITED_INFORMATION. This can be used for GetProcessTimes, GetProcessImageFileName, and GetExitCodeProcess. It cannot be used for OpenProcessToken.
@codecov-io

This comment has been minimized.

Copy link

commented Oct 13, 2016

Current coverage is 70.60% (diff: 69.56%)

Merging #50 into master will decrease coverage by 0.13%

@@             master        #50   diff @@
==========================================
  Files            10         10          
  Lines          1080       1099    +19   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            764        776    +12   
- Misses          257        262     +5   
- Partials         59         61     +2   

Powered by Codecov. Last update c476970...ed008d7

@ruflin

ruflin approved these changes Oct 13, 2016

Copy link

left a comment

LGTM

@@ -0,0 +1,17 @@
# Change Log

This comment has been minimized.

Copy link
@ruflin

ruflin Oct 13, 2016

Thx for adding the changelog

@ruflin ruflin merged commit 15322f7 into elastic:master Oct 13, 2016

3 checks passed

CLA Commit author has signed the CLA
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.