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

PVF: consider fetching audit logs with netlink #2080

Closed
mrcnski opened this issue Oct 30, 2023 · 10 comments
Closed

PVF: consider fetching audit logs with netlink #2080

mrcnski opened this issue Oct 30, 2023 · 10 comments
Assignees

Comments

@mrcnski
Copy link
Contributor

mrcnski commented Oct 30, 2023

Instead of parsing audit logs, we might be able to connect to audit via netlink and observe audit events directly. see man 3 audit_open and further links.

See #2009 (comment) by @s0me0ne-unkn0wn.

@mrcnski
Copy link
Contributor Author

mrcnski commented Oct 30, 2023

@s0me0ne-unkn0wn Does this work even if audit logging is disabled? That might be an advantage, along with not having to locate the audit file location (it is different on some systems) etc.

@s0me0ne-unkn0wn
Copy link
Contributor

Well, if audit logging is disabled in the sense that systemd does not write the log to disk, the audit events should still be available. But the audit may be disabled altogether on the kernel level, in that case, no audit events are available, it can be checked with audit_is_enabled

@s0me0ne-unkn0wn s0me0ne-unkn0wn self-assigned this Nov 9, 2023
@s0me0ne-unkn0wn s0me0ne-unkn0wn moved this from Todo to In Progress in PVF Security Hardening Nov 9, 2023
@s0me0ne-unkn0wn
Copy link
Contributor

I'll take this one for myself, as I'm more or less familiar with netlink and kernel audit. However, I've never tried using it as non-root. The first thing that should be checked is whether it's worth implementing at all. If it requires root privilege, it doesn't make sense. The current implementation (the log parsing) fails on every host I tried, as the audit logs are not usually exposed to normal users.

@mrcnski
Copy link
Contributor Author

mrcnski commented Nov 9, 2023

Awesome, thank you! Let me know what you find out.

The current implementation (the log parsing) fails on every host I tried, as the audit logs are not usually exposed to normal users.

Yeah, so we only use them for informative purposes right now. Hopefully, there is at least one validator who is ignoring our recommendation not to run as root, who would notice any warnings that we log and inform us. 🙃

@s0me0ne-unkn0wn
Copy link
Contributor

Nope, no miracle happened. You cannot subscribe to audit events as non-root. Probably, that's not that strict, I mean, running as a user who is a member of the audit group may help, and setcap also allows to give users permissions for audit events, but those requirements are even harder to enforce as the exact behavior may depend on distribution, kernel version, and system configuration.

Considering that, I'm not sure it makes sense to put any effort into implementing this.

@mrcnski
Copy link
Contributor Author

mrcnski commented Nov 26, 2023

Related: #2324

@bkchr
Copy link
Member

bkchr commented Nov 26, 2023

In the light of #2461, do we still need this?

@s0me0ne-unkn0wn
Copy link
Contributor

In the light of #2461, do we still need this?

If we're not going to ever enforce running node as root, I'd say no.
If we're switching to PolkaVM, I'd say no.
Otherwise, that may be somewhat useful :)

@bkchr
Copy link
Member

bkchr commented Dec 11, 2023

So that sounds to me like a "no" and we can close this issue.

@mrcnski
Copy link
Contributor Author

mrcnski commented Dec 11, 2023

Can reopen if we need this in the future.

@mrcnski mrcnski closed this as completed Dec 11, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Completed in parachains team board Dec 11, 2023
bkchr pushed a commit that referenced this issue Apr 10, 2024
* SourceBridgeHubChain/TargetBridgeHubChain replaced with RelayerAccountChain

* Fix

* Removed `relayer_account: &AccountId` from `MessageDispatch`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Status: In Progress
Development

No branches or pull requests

3 participants