Skip to content

Write to utmp/wtmp when an interactive session is opened by Teleport #3987

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

Closed
webvictim opened this issue Jul 7, 2020 · 10 comments · Fixed by #5491
Closed

Write to utmp/wtmp when an interactive session is opened by Teleport #3987

webvictim opened this issue Jul 7, 2020 · 10 comments · Fixed by #5491
Assignees
Labels
c-ju Internal Customer Reference c-q7j Internal Customer Reference feature-request Used for new features in Teleport, improvements to current should be #enhancements sales-onboarding Issues related to prospects
Milestone

Comments

@webvictim
Copy link
Contributor

webvictim commented Jul 7, 2020

Feature Request

Traditional Unix login systems like getty and sshd write entries to the utmp file when an interactive session is opened. This is used to construct the output of commands like w and who which show the users currently logged into the system.

Teleport doesn't write entries to utmp when interactive sessions are opened, meaning that you can't see who's logged into a system using traditional Unix tools. It would be nice for Teleport nodes to update the utmp file in the same way sshd does.

Output of who when logged in via sshd:

gus@hades:~$ who
gus      pts/1        2020-07-07 16:16 (192.168.64.203)
gus@hades:~$

Output of who when logged in via teleport:

gus@hades:~$ who
gus@hades:~$ 

Motivation

Teleport is essentially positioned as an sshd replacement, so it should have a reasonable level of feature parity with sshd. It's also quite confusing that sessions appear in w/who/last etc when you use Teleport to log into nodes running sshd, but not when you use Teleport to log into nodes running teleport.

Who's it for?

OSS User, Pro, Enterprise

┆Issue is synchronized with this Asana task by Unito

@webvictim webvictim added the feature-request Used for new features in Teleport, improvements to current should be #enhancements label Jul 7, 2020
@sskousen
Copy link

+1 This is the biggest request I get from our engineering team. We have a number of tools and scripts that use wtmp and utmp that report if an engineer is currently using a particular system (to prevent stepping on each other), and these have stopped working since our transition to teleport.

@jon-can jon-can added sales-onboarding Issues related to prospects R3 labels Aug 6, 2020
@jon-can
Copy link
Contributor

jon-can commented Aug 10, 2020

Both human users and downstream tooling such as log aggregators/SIEMs rely on utmp/wtmp to analyze and debug resource utilization and performance issues on shared systems, as well as monitor user behavior for security forensics. Although the Audit Log partially mitigates this, Teleport's lack of utmp/wtmp significantly disrupts Unix users' muscle memory for w/who/last and ambient awareness of other users. This would also introduce friction in analyzing attacker behavior during a real-time security incident response. Other solutions such as OpenSSH and Smallstep populate utmp/wtmp as expected.

@jon-can
Copy link
Contributor

jon-can commented Aug 11, 2020

Lacework has confirmed that they use utmp/wtmp to monitor system logins. That means customers using Lacework would be blind to all Teleport-based login activity in Lacework.

@jdconti
Copy link

jdconti commented Oct 14, 2020

+1 this is a big annoyance to our users/engineers

@aelkugia aelkugia added the c-ju Internal Customer Reference label Oct 14, 2020
@aelkugia aelkugia added the c-q7j Internal Customer Reference label Oct 27, 2020
@benarent benarent added this to the Runway Milestone milestone Nov 23, 2020
@benarent
Copy link
Contributor

We plan to address this issue when we work on #3814

@xacrimon
Copy link
Contributor

xacrimon commented Feb 2, 2021

Started investigating and it seems like openssh does this by using this C header which defines the structure of the utmp and wtmp files and manually adds an USER_PROCESS entry once a connection is authenticated. On exit, the daemon marks the entry as DEAD_PROCESS. I'll get working on this.

@xacrimon
Copy link
Contributor

Implemented and merged to master.

@dudeisbrendan03
Copy link

dudeisbrendan03 commented May 20, 2021

Implemented and merged to master.

In 6.0.1 there's still nothing to utmp/wtmp from Teleport for me?

@webvictim
Copy link
Contributor Author

Did you upgrade your Teleport nodes? Just doing auth/proxy won’t work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-ju Internal Customer Reference c-q7j Internal Customer Reference feature-request Used for new features in Teleport, improvements to current should be #enhancements sales-onboarding Issues related to prospects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants