-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: fail jobs configured to run as worker agent user on Windows #230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this done so quickly!
@@ -708,6 +708,22 @@ def _create_new_sessions( | |||
# Requires some updates to the code below | |||
try: | |||
job_details = job_entities.job_details() | |||
|
|||
# For Windows the WA runs as Administrator so fail jobs that were configured to runAs - WORKER_AGENT_USER as that would provide Admin privileges to the job | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect that we may end up relaxing this to Administrator + Running-as-a-service in future, but this is the agreed upon behavior right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this since it addresses a security concern. We can relax the logic later for edge-cases where the worker doesn't need to run as an admin.
da63815
to
95cf7b5
Compare
Signed-off-by: Sakshi Sakshi <[email protected]>
95cf7b5
to
d9a9cbf
Compare
Signed-off-by: Sakshi Sakshi <[email protected]>
Signed-off-by: Sakshi Sakshi <[email protected]> Signed-off-by: Brian Axelson <[email protected]>
What was the problem/requirement? (What/Why)
We have determined that the Worker Agent needs Administrator privileges in Windows.
This poses risk that any queues configured to run jobs as the agent user would then have administrator privileges.
What was the solution? (How)
If the agent is running as an administrator and receives a job and the
BatchGetJobEntity
API request for the jobDetails returns ajobRunAsUser
→runAs
isWORKER_AGENT_USER
, then we should fail the job with a message explaining that the queue and fleet are setup in an insecure configuration and the job would run with administrator privileges.What is the impact of this change?
Better security
How was this change tested?
Added unit tests
Was this change documented?
N/A
Is this a breaking change?
N/A