Self Hosted (part 5) : Session Recording
Intro
Tlog is terminal I/O recording and playback tool. Tlog has three components tlog-rec
, tlog-rec-session
and tlog-play
.
I use it to record entire shell sessions. I have set tlog to starts recording automatically when a user logs in. I can view the sessions with either tlog-rec
or using a plugin for Cockpit called cockpit-session-recording
.
MORE: https://github.com/Scribery/tlog
MORE: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/recording_sessions/index
Install tlog
Install from fedora repository. Setup will ask to verify GPG key.
dnf install tlog
Install cockpit plugin
Install from fedora repository.
dnf install cockpit-session-recording
Enable automatic session recording
Two ways to enable automatic session recording:
Using shell
Edit /etc/sssd/conf.d/sssd-session-recording.conf. This will enable session recording for all users.
[session_recording]
scope = all
After login, the user will get a message that the session is being recorded. To change/remove the notice and other settings, modify /etc/tlog/tlog-rec-session.conf
[root@sun ~]# cat /etc/tlog/tlog-rec-session.conf
{"shell":"/bin/bash","notice":"\nATTENTION! Your session is being recorded!\n\n","latency":10,"payload":2048,"log":{"input":true,"output":true,"window":true},"limit":{"rate":16384,"burst":32768,"action":"pass"},"file":{"path":""},"syslog":{"facility":"authpriv","priority":"info"},"journal":{"priority":"info","augment":true},"writer":"journal"}
Using cockpit plugin
Go to Session Recording (/session-recording) and click the gear icon, or go to config directly with /session-recording#/config.
Set SSSD Config > Scope to All.
Under General Config > Logging, check ‘User’s Input’, ‘User’s Output’, ‘Window Resize’.
Set General Config > Logging > Writer to Journal.
View recorded sessions
From shell
Use tlog-play
. Check links in Intro for information.
From cockpit plugin
Go to Session Recording (/session-recording). This page will show a list of recorded sessions. Click on a session and it will open a sessin player with controls and info about the recording below it.
Thank you for reading. Check out the other parts in the series below.