-
Notifications
You must be signed in to change notification settings - Fork 187
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
Use ACLs to allow access to the cf-execd's runagent.socket #4513
Use ACLs to allow access to the cf-execd's runagent.socket #4513
Conversation
802cbec
to
3ec6293
Compare
7e6c034
to
52bac27
Compare
e04374e
to
366f1e1
Compare
ef7bafc
to
9c56396
Compare
9c56396
to
04f84b0
Compare
04f84b0
to
11d96c0
Compare
@cf-bottom jenkins please |
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/6131/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-6131/ |
419411c
to
beccb46
Compare
beccb46
to
a84519b
Compare
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.
👍
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.
Why is the first commit there?
Added changelog entry for unexpected consequence of change in and(), …
Seems like this should be removed if you rebase to upstream/master.
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.
LGTM - just some smaller comments.
That's exactly what I did and how it got there. 😕 |
a84519b
to
31e726b
Compare
Ticket: ENT-6735 Changelog: None
Useful in places where we want to grant users access to some files (or directories) when then are not owners of the files. Ticket: ENT-6735 Changelog: None
A new attribute that tells cf-execd to grant access to the runagent.socket to the specified users. Ticket: ENT-6735 Changelog: Commit
…oy() Better explicitly compare to NULL. Ticket: ENT-6735 Changelog: None
So that the code can be reused when list of users allowed to access the socket changes. Ticket: ENT-6735 Changelog: None
cf-execd creates the runagent.socket when it starts and sets ACLs on it based on the policy. However, when policy changes, cf-execd is not restarted, it just loads the new policy and keeps running. Thus it needs to detect a change in the list of allowed users and make sure the ACLs are updated in case of a change. Ticket: ENT-6735 Changelog: None
It stops listening on the socket so the socket should not be left behind. Ticket: ENT-6735 Changelog: None
…missions The directory and the socket file inside of it should not be group- and world- readable, writable and executable.
So that it can set ACLs. Ticket: ENT-6735 Changelog: None
… sockets So that requests to trigger agent runs on hosts can be passed from the web UI to cf-execd's socket and handled by cf-execd. Ticket: ENT-6735 Changelog: None
31e726b
to
26d70e9
Compare
This pull request fixes 2 alerts when merging 26d70e9 into 040af13 - view on LGTM.com fixed alerts:
|
/* Check if the old list and the new one differ. */ | ||
if (!StringSetIsEqual(old_runagent_allow_users, | ||
(*execd_config)->runagent_allow_users)) | ||
{ |
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.
If I'm being nitpicky: This comment would not help me much. Right now, it says the same as the code. For it to be helpful, I think it needs to mention that the policy changed (not the runagent sockets/dirs/files). For example:
/* Check if the old list and the new one differ. */ | |
if (!StringSetIsEqual(old_runagent_allow_users, | |
(*execd_config)->runagent_allow_users)) | |
{ | |
/* Check if the list of allowed users, from policy, has changed. */ | |
if (!StringSetIsEqual(old_runagent_allow_users, | |
(*execd_config)->runagent_allow_users)) | |
{ |
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 think it's enough to look at where that list is taken from, just a few lines above.
No description provided.