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

tlog not working when auditd is disabled, and there's no /proc/PID/sessionid #353

Open
haiwu opened this issue Jan 6, 2023 · 3 comments

Comments

@haiwu
Copy link

haiwu commented Jan 6, 2023

tlog not working when auditd is disabled, and there's no /proc/self/sessionid. How to ensure tlog would work when auditd is disabled? There's an existing issue here "#264", where it suggested using 'getsid(0)', and it seems to work in Linux, where calling 'getsid(0)' would get the interactive ssh session's BASH pid (if the logged in user using BASH shell), which would stay the same during the whole interactive session.

What's the concern of just using getsid(0) (instead of using /proc/self/sessionid) in case auditd being already disabled? pid reaching PID_MAX and wraps around?

@haiwu
Copy link
Author

haiwu commented Jan 6, 2023

another way is to use systemd $XDG_SESSION_ID, or call 'sd_pid_get_session(my_pid, &session)', which would grab something from systemd, similar to /proc/self/sesionid, whose value would show up in the same position of 'loginctl session-status' output.

@justin-stephenson
Copy link
Collaborator

Using a systemd login-related session ID as fallback for the session field if /proc/self/sessionID is unavailable seems reasonable to me, the downside being it would not help for systems which are not using systemd.

@haiwu
Copy link
Author

haiwu commented Jan 6, 2023

At least it would help out those folks working with systemd-enabled Linux hosts where auditd is disabled.

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

No branches or pull requests

2 participants