User Session Recording Tech Talk 2017-12-04
User Session Recording Tech Talk 2017-12-04
Nikolai Kondrashov
Software Engineer
Tech Talk 2017.12.04
INTRODUCTION
2 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
WHY?
THERE IS A DEMAND
4 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
AND A DREAM
5 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
THERE IS A SUPPLY
6 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
BUT NOT GOOD ENOUGH
7 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
WHAT CAN BE BETTER?
8 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
WAIT, WE HAVE IT ALREADY!
9 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
WHAT?
SO, WHAT DO WE NEED?
11 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
SOUNDS FAMILIAR!
12 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
LEAN AND MEAN
13 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
FIRST...
14 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
YES, ELASTICSEARCH AND KIBANA!
15 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
THEN...
16 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
CENTRAL CONTROL?
17 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
LOG INPUT AND OUTPUT?
18 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
MAKE SENSE OF AUDIT LOGS?
19 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
DELIVER TO ELASTICSEARCH?
RSYSLOG*
Or our coming solution:
ViaQ
* Distributed by Red Hat now
20 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
PLAY EVERYTHING BACK?
21 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
ALL TOGETHER NOW!
Auditd Aushape
Fluentd
Tlog
Rsyslog
Logstash
WebUI
Elasticsearch
Kibana
22 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
DEMO!
IN THIS DEMO...
24 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
HOW?
HOW TLOG WORKS?
Console login example
1
Starting a console session:
1
PAM
1. User authenticates to login via PAM
login 2
2. NSS tells login: tlog is the shell
NSS
3. login starts tlog 3
6 6 syslog
4. Env/config tell tlog the actual shell
tlog
5. tlog starts the actual shell in a PTY journal
6. tlog logs everything passing between 56
its terminal and the PTY, via PTY
syslog(3) or sd-journal(3)
shell
26 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
CONTROL TLOG WITH SSSD
Console login example
27 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
CONTROL TLOG WITH FREEIPA
Plan so far
28 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
EXTRA TLOG FEATURES
Also control:
● What to record: input/output/window resizes
● “You are being recorded” notice
● Where to write: sd-journal(3), syslog(3), or file
● Low latency vs. low overhead
Basic playback on the terminal:
● From Elasticsearch
● From Journal
● From file
29 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
TLOG SCHEMA
{
Optimized for streaming and searching: "ver" : "2.2",
"host" : "tlog-client.example.com",
● Chopped into messages for "rec" : "c8aa248c81264f5d98d1..."
streaming, which can be merged "user" : "user1",
"term" : "xterm",
● Input and output stored separately "session" : 23,
● All I/O preserved "id" : 1,
"pos" : 0,
● Invalid UTF-8 stored separately
"timing" : "=56x22+98>23",
● Timing separate, ms precision "in_txt" : "",
● Window resizes preserved "in_bin" : [ ],
"out_txt" : "[user1@tlog-client ~]$ ",
"out_bin" : [ ]
}
30 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
HOW AUSHAPE WORKS?
31 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
AUSHAPE SCHEMAS
Mimicking the audit log, XML and JSON are similar, raw log can be preserved
<log> [
<event serial="number" {
time="timestamp"> "serial": number,
<text> "time": "timestamp",
<line>log message</line> ... "text": [
</text> "log message", ...
<data> ],
<record> "data": {
<field i="value" r="value"/> ... "record": {
</record> ... "field": ["value", "value"], ...
</data> }, ...
</event> ... }
</log> }, ...
]
32 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
AUSHAPE EXAMPLES
A heavily-trimmed event
<event serial="880" {
time="2016-09-28T19:34:44.771+03:00"> "serial":880,
<data> "time":"2016-09-28T19:34:44.771+03:00",
<syscall> "data":{
<syscall i="execve" r="59"/> "syscall":{
<success i="yes"/> "syscall":["execve","59"],
</syscall> "success":["yes"]
<cwd> },
<cwd i="/home/user"/> "cwd":{
</cwd> "cwd":["/home/user"]
<execve> },
<a i="ps"/> "execve":[
</execve> "ps"
</data> ]
</event> }
}
33 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
HOW COCKPIT UI WORKS?
Code in development
34 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
CHALLENGES!
TLOG CHALLENGES
36 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
AUSHAPE CHALLENGES
37 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
WEB UI CHALLENGES
We’re taking them to Cockpit Hackfest!
38 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
TRY IT!
TRY TLOG!
https://github.com/Scribery/tlog
40 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
TRY AUSHAPE!
https://github.com/Scribery/aushape
41 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
TRY COCKPIT UI!
https://github.com/Scribery/cockpit/tree/scribery
42 User Session Recording for the Enterprise - Nikolai Kondrashov, Red Hat
THANK YOU
User Session Recording Project
http://scribery.github.io/
THANK YOU
plus.google.com/+RedHat facebook.com/redhatinc
linkedin.com/company/red-hat twitter.com/RedHatNews
youtube.com/user/RedHatVideos