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

Audit update #1199

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Audit update #1199

wants to merge 13 commits into from

Conversation

ikerexxe
Copy link
Collaborator

This is a set of changes that Fedora introduced in a downstream patch. The idea is to converge upstream and downstream versions to reduce the maintenance burden. The patch was created a long time ago and we have been adapting it, but it may not be up to date with current upstream code standards, if so, please inform me so I can update the patch.

@ikerexxe ikerexxe mentioned this pull request Jan 27, 2025
@ikerexxe
Copy link
Collaborator Author

@stevegrubb before I take this out of draft status, are there any other distributions besides Fedora/CentOS/RHEL that might be affected by these changes? I'd like to ping the maintainers of those distributions to review these code changes.

lib/audit_help.c Outdated Show resolved Hide resolved
lib/audit_help.c Outdated Show resolved Hide resolved
return;
}
len = strnlen(grp, sizeof(enc_group)/2);
if (audit_value_needs_encoding(grp, len)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

By default, we don't allow names that would need encoding. This reminds me that we have #1158.

I will add " to the list of strictly disallowed characters, and then we don't need to encode anything here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That makes sense. If it's fine for you we leave it like this for now, and if I see that #1158 mergse before this PR I will update the code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, that's fine. Thanks!

Comment on lines +185 to +190
#ifndef AUDIT_GRP_MGMT
#define AUDIT_GRP_MGMT 1132 /* Group account was modified */
#endif
#ifndef AUDIT_GRP_CHAUTHTOK
#define AUDIT_GRP_CHAUTHTOK 1133 /* Group account password was changed */
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason for those specific values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They come from audit-records.h and probably they weren't available in all distributions when this patch was originally created (that happened years ago). I'm fine with removing this part of the patch as probably they will be available in all distributions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, please try removing them, and if builds everywhere, let's forget about them (and if not, reintroduce them).

Comment on lines +185 to +190
#ifndef AUDIT_GRP_MGMT
#define AUDIT_GRP_MGMT 1132 /* Group account was modified */
#endif
#ifndef AUDIT_GRP_CHAUTHTOK
#define AUDIT_GRP_CHAUTHTOK 1133 /* Group account password was changed */
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, please try removing them, and if builds everywhere, let's forget about them (and if not, reintroduce them).

audit_logger (AUDIT_USER_ACCT, log_get_progname(),
audit_logger (AUDIT_GRP_MGMT, log_get_progname(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Regarding

b2c8eff

You could move the filename in the subject to the prefix:

lib/cleanup_group.c: Update audit messages

Also, could you add some little explanation in the commit message of what this update is about?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Regarding

b2c8eff

You could move the filename in the subject to the prefix:

lib/cleanup_group.c: Update audit messages

Or will you squash the commits? (I think it would make sense to squash them.)

@stevegrubb
Copy link
Contributor

@ikerexxe Most major distributions enable auditing. So, they are all affected. That said, they are all broken except Fedora. This fixes everyone and Fedora can drop it's patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants