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

Use ACLs to allow access to the cf-execd's runagent.socket #4513

Merged
merged 10 commits into from
Mar 1, 2021

Conversation

vpodzime
Copy link
Contributor

@vpodzime vpodzime commented Feb 18, 2021

No description provided.

@vpodzime vpodzime added the WIP Work in Progress label Feb 18, 2021
@vpodzime vpodzime force-pushed the master-cf_execd_socket_perms branch 6 times, most recently from 802cbec to 3ec6293 Compare February 18, 2021 11:33
@cfengine cfengine deleted a comment from lgtm-com bot Feb 18, 2021
@vpodzime vpodzime force-pushed the master-cf_execd_socket_perms branch 2 times, most recently from 7e6c034 to 52bac27 Compare February 18, 2021 11:45
@cfengine cfengine deleted a comment from lgtm-com bot Feb 18, 2021
@vpodzime vpodzime force-pushed the master-cf_execd_socket_perms branch from e04374e to 366f1e1 Compare February 18, 2021 13:55
@cfengine cfengine deleted a comment from lgtm-com bot Feb 18, 2021
@cfengine cfengine deleted a comment from lgtm-com bot Feb 18, 2021
@vpodzime vpodzime force-pushed the master-cf_execd_socket_perms branch from ef7bafc to 9c56396 Compare February 18, 2021 16:12
@cfengine cfengine deleted a comment from lgtm-com bot Feb 18, 2021
@vpodzime vpodzime force-pushed the master-cf_execd_socket_perms branch from 9c56396 to 04f84b0 Compare February 18, 2021 17:56
@cfengine cfengine deleted a comment from lgtm-com bot Feb 18, 2021
@vpodzime vpodzime requested a review from olehermanse February 18, 2021 18:01
@vpodzime vpodzime removed the WIP Work in Progress label Feb 18, 2021
@vpodzime vpodzime force-pushed the master-cf_execd_socket_perms branch from 04f84b0 to 11d96c0 Compare February 18, 2021 18:15
@cfengine cfengine deleted a comment from lgtm-com bot Feb 18, 2021
@vpodzime
Copy link
Contributor Author

@cf-bottom jenkins please

@cf-bottom
Copy link

@cfengine cfengine deleted a comment from lgtm-com bot Feb 19, 2021
@vpodzime vpodzime force-pushed the master-cf_execd_socket_perms branch 2 times, most recently from 419411c to beccb46 Compare February 19, 2021 10:01
@vpodzime
Copy link
Contributor Author

RHEL 8 builds (incl. the SELinux policy): Build Status

@vpodzime vpodzime requested a review from larsewi February 19, 2021 10:24
@vpodzime
Copy link
Contributor Author

Build Status

FR tests retry: Build Status
sequential tests retry: Build Status

cf-execd/cf-execd.c Outdated Show resolved Hide resolved
cf-execd/cf-execd.c Outdated Show resolved Hide resolved
@vpodzime vpodzime force-pushed the master-cf_execd_socket_perms branch from beccb46 to a84519b Compare February 22, 2021 10:15
@cfengine cfengine deleted a comment from lgtm-com bot Feb 22, 2021
larsewi
larsewi previously approved these changes Feb 23, 2021
Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@olehermanse olehermanse left a 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.

@olehermanse olehermanse self-requested a review February 23, 2021 20:45
olehermanse
olehermanse previously approved these changes Feb 24, 2021
Copy link
Member

@olehermanse olehermanse left a 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.

cf-execd/cf-execd.c Outdated Show resolved Hide resolved
cf-execd/cf-execd.c Show resolved Hide resolved
cf-execd/cf-execd.c Outdated Show resolved Hide resolved
cf-execd/cf-execd.c Outdated Show resolved Hide resolved
@vpodzime
Copy link
Contributor Author

Seems like this should be removed if you rebase to upstream/master.

That's exactly what I did and how it got there. 😕

@vpodzime vpodzime dismissed stale reviews from olehermanse and larsewi via 31e726b February 24, 2021 09:34
@vpodzime vpodzime force-pushed the master-cf_execd_socket_perms branch from a84519b to 31e726b Compare February 24, 2021 09:34
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
@lgtm-com
Copy link

lgtm-com bot commented Feb 24, 2021

This pull request fixes 2 alerts when merging 26d70e9 into 040af13 - view on LGTM.com

fixed alerts:

  • 2 for Pointer argument is dereferenced without checking for NULL

Comment on lines +1000 to +1003
/* Check if the old list and the new one differ. */
if (!StringSetIsEqual(old_runagent_allow_users,
(*execd_config)->runagent_allow_users))
{
Copy link
Member

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:

Suggested change
/* 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))
{

Copy link
Contributor Author

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.

@vpodzime vpodzime merged commit 761ecef into cfengine:master Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants