Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 4 of 6 · Worked example · 20 min · revision 2

Host Telemetry with auditd and Sysmon

Write auditd rules that record root commands by the person who logged in and changes to cron, systemd units, SSH keys and sudoers, read a sample log offline with ausearch and aureport, triage it against approved changes, and see the same telemetry with Sysmon for Linux.

Contentsand lesson path

What you will learn

  • Configure host telemetry (auditd or Sysmon for Linux) to record security-relevant events such as privilege use and persistence changes.

Prerequisites: Linux CLI

01. The problem

A hardened server can still be misused. A person with sudo rights can run any command they are allowed to, and an attacker who gets in will try to make their access survive a reboot or a password change. That is called persistence. On Linux the usual places are scheduled jobs (cron), service definitions (systemd units) and SSH keys in authorized_keys, plus the sudo rules that decide who gets root. A baseline scan tells you how a host is configured, not who changed it or what they ran.

Host telemetry is the record a host keeps of security-relevant events. Your task: on a fleet of Debian 12 servers, record every command that a person runs as root, and every change to the persistence locations above, with the name of the person who logged in. Then review a day of events and decide which ones need a follow-up.

The Linux audit system does this. The kernel checks each event against a list of audit rules and, on a match, the auditd daemon writes records to /var/log/audit/audit.log. auditctl and augenrules load the rules; ausearch and aureport query a log. Sysmon for Linux, a Microsoft Sysinternals tool, is an alternative that you meet in step 8.

Loading audit rules changes the kernel's audit settings for the whole machine, and containers share the host kernel. So you write the rules for a VM, and read a sample log in a container with ausearch -if, which reads a file and changes nothing. Tested version: auditd 3.0.9, the Debian 12 package.

Lab folder
telemetry-lab/
├── 50-telemetry.rules    audit rules for a VM (step 1)
├── sample-audit.log      a day of events, created in step 3
├── changes.csv           approved changes (step 7)
├── triage.py             flags events that need a person (step 7)
├── timeline.csv          created in step 7
└── sysmon-telemetry.xml  Sysmon for Linux configuration (step 8)

02. Step 1: Write the audit rules

Create telemetry-lab/, work inside it, and save the rules below. There are two kinds of rule.

A watch, -w PATH -p PERMS -k KEY, records access to a file, or to everything under a directory. The permissions are classes of system call, not file modes: r read, w write, x execute, a attribute change, such as chmod or chown. wa records any change and ignores reads. The key is a label of up to 31 bytes that you search by later. A watch takes one exact path, so the rules name each authorized_keys file. Debian 12's auditctl manual calls -w the backwards-compatible form; the same rule in the newer syntax is -a always,exit -F path=/etc/sudoers -F perm=wa -k sudoers.

A syscall rule records calls such as execve, which starts every program. Three fields make it useful:

  • euid=0: the program runs with root's rights;
  • auid>=1000: the audit UID belongs to a person. The auid is set once at login and does not change through sudo or su, so the record names who logged in, not just "root";
  • auid!=unset: services started at boot have no login, and their unset auid prints as 4294967295, which is larger than 1000.

There are two execve rules because 32-bit and 64-bit programs use different system call numbers.

Audit rules · 50-telemetry.rules
## /etc/audit/rules.d/50-telemetry.rules  (auditd 3.0.9 on Debian 12)
## Watches: -w PATH -p PERMS -k KEY. "wa" = writes and attribute changes.

## Persistence: scheduled jobs
-w /etc/crontab -p wa -k cron
-w /etc/cron.d/ -p wa -k cron
-w /etc/cron.daily/ -p wa -k cron
-w /var/spool/cron/crontabs/ -p wa -k cron

## Persistence: services (Debian 12 has merged /usr, so /lib is /usr/lib)
-w /etc/systemd/system/ -p wa -k systemd
-w /usr/lib/systemd/system/ -p wa -k systemd

## Persistence: SSH keys. A watch takes one path, not a glob such as
## /home/*/.ssh, so list every account that may log in.
-w /root/.ssh/authorized_keys -p wa -k ssh-keys
-w /home/alice/.ssh/authorized_keys -p wa -k ssh-keys
-w /home/bob/.ssh/authorized_keys -p wa -k ssh-keys

## Privilege configuration
-w /etc/sudoers -p wa -k sudoers
-w /etc/sudoers.d/ -p wa -k sudoers

## Commands that run as root on behalf of a person who logged in
-a always,exit -F arch=b64 -S execve -F euid=0 -F auid>=1000 -F auid!=unset -k priv-cmd
-a always,exit -F arch=b32 -S execve -F euid=0 -F auid>=1000 -F auid!=unset -k priv-cmd

On a Debian 12 VM you would load the rules as below. This is not run here, because it would change the shared host's kernel. When the rules are final, a last -e 2 line locks them until the next reboot, so that an intruder with root cannot quietly remove them.

Terminal · on a VM only (illustrative, not run here)
sudo apt-get install -y auditd
sudo install -m 0640 50-telemetry.rules /etc/audit/rules.d/
sudo augenrules --load   # merge rules.d/*.rules and load them
sudo auditctl -l         # list the rules the kernel has now

03. Step 2: Start a container to read logs

The container only reads files: it gets the audit tools and two accounts, alice (UID 1001) and bob (UID 1002). The accounts matter, because ausearch -i turns UIDs into names with the local password database. Read a log on a host that has the same accounts, or the names will be wrong.

Terminal
docker run -d --init --name telemetry-lab -v "$PWD":/lab:ro debian:12-slim \
  sleep infinity >/dev/null
docker exec telemetry-lab bash -c 'apt-get update -qq &&
  apt-get install -y -qq --no-install-recommends auditd >/dev/null 2>&1 &&
  useradd -u 1001 alice && useradd -u 1002 bob && ausearch -v'
Expected output
ausearch version 3.0.9

04. Step 3: Create the sample log

This is a constructed sample of one day on a server that has the rules from step 1, written in the raw format auditd uses (it was not captured from a real host). Alice restarts nginx, installs a cron job and installs a systemd unit, all through sudo (the sample keeps only the records that matter); at 02:47 Bob adds a line to his own authorized_keys. Each event is several records that share one msg=audit(TIME:SERIAL) stamp: SYSCALL (who, which call, which key), EXECVE (the arguments), CWD, PATH (the files) and PROCTITLE (the command line in hex). Lines that end in a backslash are joined by the shell.

Terminal
cat > sample-audit.log <<EOF
type=SYSCALL msg=audit(1793846839.003:1966): arch=c000003e syscall=257 success=yes \
exit=3 a0=ffffff9c a1=7ffd5b2e6f10 a2=441 a3=1b6 items=2 ppid=3987 pid=3988 auid=1002 \
uid=1002 gid=1002 euid=1002 suid=1002 fsuid=1002 egid=1002 sgid=1002 fsgid=1002 \
tty=pts0 ses=4 comm="bash" exe="/usr/bin/bash" subj=unconfined key="ssh-keys"
type=CWD msg=audit(1793846839.003:1966): cwd="/home/bob"
type=PATH msg=audit(1793846839.003:1966): item=0 name="/home/bob/.ssh/" inode=1048601 \
dev=08:01 mode=040700 ouid=1002 ogid=1002 rdev=00:00 nametype=PARENT cap_fp=0 \
cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(1793846839.003:1966): item=1 \
name="/home/bob/.ssh/authorized_keys" inode=1048602 dev=08:01 mode=0100600 ouid=1002 \
ogid=1002 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 \
cap_frootid=0
type=PROCTITLE msg=audit(1793846839.003:1966): proctitle=2D62617368
type=SYSCALL msg=audit(1793870042.112:2101): arch=c000003e syscall=59 success=yes \
exit=0 a0=5612a40c1e10 a1=5612a40c2f40 a2=5612a40c3a90 a3=0 items=2 ppid=4300 \
pid=4311 auid=1001 uid=1001 gid=1001 euid=0 suid=0 fsuid=0 egid=1001 sgid=1001 \
fsgid=1001 tty=pts0 ses=7 comm="sudo" exe="/usr/bin/sudo" subj=unconfined \
key="priv-cmd"
type=EXECVE msg=audit(1793870042.112:2101): argc=4 a0="sudo" a1="systemctl" \
a2="restart" a3="nginx"
type=CWD msg=audit(1793870042.112:2101): cwd="/home/alice"
type=PATH msg=audit(1793870042.112:2101): item=0 name="/usr/bin/sudo" inode=1835530 \
dev=08:01 mode=0100755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 \
cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(1793870042.112:2101): item=1 name="/lib64/ld-linux-x86-64.so.2" \
inode=1311290 dev=08:01 mode=0100755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL \
cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PROCTITLE msg=audit(1793870042.112:2101): \
proctitle=7375646F0073797374656D63746C0072657374617274006E67696E78
type=SYSCALL msg=audit(1793870042.131:2104): arch=c000003e syscall=59 success=yes \
exit=0 a0=5612a40c1e10 a1=5612a40c2f40 a2=5612a40c3a90 a3=0 items=2 ppid=4312 \
pid=4313 auid=1001 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 \
ses=7 comm="systemctl" exe="/usr/bin/systemctl" subj=unconfined key="priv-cmd"
type=EXECVE msg=audit(1793870042.131:2104): argc=3 a0="systemctl" a1="restart" \
a2="nginx"
type=CWD msg=audit(1793870042.131:2104): cwd="/home/alice"
type=PATH msg=audit(1793870042.131:2104): item=0 name="/usr/bin/systemctl" \
inode=1835123 dev=08:01 mode=0100755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL \
cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(1793870042.131:2104): item=1 name="/lib64/ld-linux-x86-64.so.2" \
inode=1311290 dev=08:01 mode=0100755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL \
cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PROCTITLE msg=audit(1793870042.131:2104): \
proctitle=73797374656D63746C0072657374617274006E67696E78
type=SYSCALL msg=audit(1793870441.507:2140): arch=c000003e syscall=59 success=yes \
exit=0 a0=5612a40c1e10 a1=5612a40c2f40 a2=5612a40c3a90 a3=0 items=2 ppid=4401 \
pid=4402 auid=1001 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 \
ses=7 comm="cp" exe="/usr/bin/cp" subj=unconfined key="priv-cmd"
type=EXECVE msg=audit(1793870441.507:2140): argc=3 a0="cp" a1="backup.cron" \
a2="/etc/cron.d/backup"
type=CWD msg=audit(1793870441.507:2140): cwd="/home/alice"
type=PATH msg=audit(1793870441.507:2140): item=0 name="/usr/bin/cp" inode=1835077 \
dev=08:01 mode=0100755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 \
cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(1793870441.507:2140): item=1 name="/lib64/ld-linux-x86-64.so.2" \
inode=1311290 dev=08:01 mode=0100755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL \
cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PROCTITLE msg=audit(1793870441.507:2140): \
proctitle=6370006261636B75702E63726F6E002F6574632F63726F6E2E642F6261636B7570
type=SYSCALL msg=audit(1793870441.509:2141): arch=c000003e syscall=257 success=yes \
exit=3 a0=ffffff9c a1=7ffd5b2e6f10 a2=c1 a3=1a4 items=2 ppid=4401 pid=4402 auid=1001 \
uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=7 comm="cp" \
exe="/usr/bin/cp" subj=unconfined key="cron"
type=CWD msg=audit(1793870441.509:2141): cwd="/home/alice"
type=PATH msg=audit(1793870441.509:2141): item=0 name="/etc/cron.d/" inode=393220 \
dev=08:01 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=PARENT cap_fp=0 cap_fi=0 \
cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(1793870441.509:2141): item=1 name="/etc/cron.d/backup" \
inode=393301 dev=08:01 mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=CREATE cap_fp=0 \
cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PROCTITLE msg=audit(1793870441.509:2141): \
proctitle=6370006261636B75702E63726F6E002F6574632F63726F6E2E642F6261636B7570
type=SYSCALL msg=audit(1793871065.220:2177): arch=c000003e syscall=59 success=yes \
exit=0 a0=5612a40c1e10 a1=5612a40c2f40 a2=5612a40c3a90 a3=0 items=2 ppid=4459 \
pid=4460 auid=1001 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 \
ses=7 comm="install" exe="/usr/bin/install" subj=unconfined key="priv-cmd"
type=EXECVE msg=audit(1793871065.220:2177): argc=5 a0="install" a1="-m" a2="0644" \
a3="report.service" a4="/etc/systemd/system/report.service"
type=CWD msg=audit(1793871065.220:2177): cwd="/home/alice"
type=PATH msg=audit(1793871065.220:2177): item=0 name="/usr/bin/install" \
inode=1835102 dev=08:01 mode=0100755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL \
cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(1793871065.220:2177): item=1 name="/lib64/ld-linux-x86-64.so.2" \
inode=1311290 dev=08:01 mode=0100755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL \
cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PROCTITLE msg=audit(1793871065.220:2177): \
proctitle=696E7374616C6C002D6D0030363434007265706F72742E73657276696365002F6574632F7379\
7374656D642F73797374656D2F7265706F72742E73657276696365
type=SYSCALL msg=audit(1793871065.223:2178): arch=c000003e syscall=257 success=yes \
exit=3 a0=ffffff9c a1=7ffd5b2e6f10 a2=241 a3=1a4 items=2 ppid=4459 pid=4460 auid=1001 \
uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=7 comm="install" \
exe="/usr/bin/install" subj=unconfined key="systemd"
type=CWD msg=audit(1793871065.223:2178): cwd="/home/alice"
type=PATH msg=audit(1793871065.223:2178): item=0 name="/etc/systemd/system/" \
inode=393500 dev=08:01 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=PARENT cap_fp=0 \
cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(1793871065.223:2178): item=1 \
name="/etc/systemd/system/report.service" inode=393612 dev=08:01 mode=0100644 ouid=0 \
ogid=0 rdev=00:00 nametype=CREATE cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PROCTITLE msg=audit(1793871065.223:2178): \
proctitle=696E7374616C6C002D6D0030363434007265706F72742E73657276696365002F6574632F7379\
7374656D642F73797374656D2F7265706F72742E73657276696365
EOF
wc -l sample-audit.log
Expected output
39 sample-audit.log

05. Step 4: Count the events by key

Terminal
docker exec telemetry-lab aureport -if /lab/sample-audit.log --key --summary
Expected output
Key Summary Report
===========================
total  key
===========================
4  priv-cmd
1  ssh-keys
1  cron
1  systemd

Keys turn a long log into questions you can ask: four programs started with root's rights, one SSH key change, one cron change and one systemd change. Nothing touched sudoers.

06. Step 5: Who ran what as root

Terminal
docker exec telemetry-lab env TZ=UTC bash -c '
  ausearch -if /lab/sample-audit.log -k priv-cmd -i | grep "^type=SYSCALL" |
  grep -oE " (auid|uid|euid|tty|comm)=[^ ]+" | paste -d "" - - - - -'
Expected output
 auid=alice uid=alice euid=root tty=pts0 comm=sudo
 auid=alice uid=root euid=root tty=pts1 comm=systemctl
 auid=alice uid=root euid=root tty=pts1 comm=cp
 auid=alice uid=root euid=root tty=pts1 comm=install

-i interprets numbers as names. uid is the real user, euid the effective one that decides rights, and auid the person who logged in. The first line is sudo itself: Alice runs it, and its setuid bit gives it root's rights. The next three are the programs sudo started: uid and euid are root, but the auid is still alice. Without the auid filter and field, these would just be "root ran cp". The terminal changes from pts0 to pts1 because Debian's default sudoers sets use_pty, which runs each command in a new pseudo-terminal.

07. Step 6: Look closely at the key change

Terminal
docker exec telemetry-lab env TZ=UTC bash -c '
  ausearch -if /lab/sample-audit.log -k ssh-keys -i | tr " " "\n" |
  grep -E "^(syscall|a2|auid|uid|euid|exe|key|name|nametype)="'
Expected output
name=/home/bob/.ssh/authorized_keys
nametype=NORMAL
name=/home/bob/.ssh/
nametype=PARENT
syscall=openat
a2=O_WRONLY|O_CREAT|O_APPEND
auid=bob
uid=bob
euid=bob
exe=/usr/bin/bash
key=ssh-keys

The call is openat with O_APPEND: Bob's shell added to the end of his own key file. No root was involved, so the priv-cmd rule did not fire; only the watch saw it. A new key is a way back in that survives a password reset, which is why the file is watched for every account that may log in.

08. Step 7: Build a timeline and triage it

A person cannot read every event, so compare them with what was approved. changes.csv lists two approved changes with their time windows. triage.py flags an event outside business hours, and a persistence change that no approved change covers. --format csv turns each event into one row; save both files, then run the step.

CSV · changes.csv
ticket,actor,object,date,start,end
CHG-5120,alice,/etc/cron.d/backup,11/05/26,09:00,10:00
CHG-5121,alice,/etc/systemd/system/report.service,11/05/26,09:00,10:00
Python · triage.py
"""triage.py: flag audit events that need a person to look at them."""
import csv

BUSINESS_HOURS = ("07:00:00", "19:00:00")  # UTC, for this team
PERSISTENCE_KEYS = {"cron", "systemd", "ssh-keys", "sudoers"}

with open("changes.csv", newline="") as f:
    changes = list(csv.DictReader(f))


def ticket_for(event):
    """Return the approved change that covers this event, if any."""
    for change in changes:
        if (change["actor"] == event["SUBJ_PRIME"]
                and change["object"] == event["OBJ_PRIME"]
                and change["date"] == event["DATE"]
                and change["start"] <= event["TIME"][:5] <= change["end"]):
            return change["ticket"]
    return None


with open("timeline.csv", newline="") as f:
    for event in csv.DictReader(f):
        reasons = []
        if not BUSINESS_HOURS[0] <= event["TIME"] <= BUSINESS_HOURS[1]:
            reasons.append("outside hours")
        ticket = ticket_for(event)
        if event["KEY"] in PERSISTENCE_KEYS and ticket is None:
            reasons.append("no change ticket")
        verdict = "FOLLOW-UP" if reasons else "ok"
        print(f"{event['TIME']} {event['SUBJ_PRIME']:<6} {event['KEY']:<9} "
              f"{verdict:<10}{ticket or '-':<9} {', '.join(reasons)}".rstrip())
Terminal
docker exec telemetry-lab env TZ=UTC ausearch -if /lab/sample-audit.log -m SYSCALL \
  --format csv --extra-keys > timeline.csv
cut -d, -f3,4,8,9,11,13,17 timeline.csv
echo
python3 triage.py
Expected output
DATE,TIME,SUBJ_PRIME,SUBJ_SEC,ACTION,OBJ_PRIME,KEY
11/05/26,02:47:19,bob,bob,opened-file,/home/bob/.ssh/authorized_keys,ssh-keys
11/05/26,09:14:02,alice,alice,executed,/usr/bin/sudo,priv-cmd
11/05/26,09:14:02,alice,root,executed,/usr/bin/systemctl,priv-cmd
11/05/26,09:20:41,alice,root,executed,/usr/bin/cp,priv-cmd
11/05/26,09:20:41,alice,root,opened-file,/etc/cron.d/backup,cron
11/05/26,09:31:05,alice,root,executed,/usr/bin/install,priv-cmd
11/05/26,09:31:05,alice,root,opened-file,/etc/systemd/system/report.service,systemd

02:47:19 bob    ssh-keys  FOLLOW-UP -         outside hours, no change ticket
09:14:02 alice  priv-cmd  ok        -
09:14:02 alice  priv-cmd  ok        -
09:20:41 alice  priv-cmd  ok        -
09:20:41 alice  cron      ok        CHG-5120
09:31:05 alice  priv-cmd  ok        -
09:31:05 alice  systemd   ok        CHG-5121

Alice's work matches two tickets. Bob's key is flagged twice: the time and the missing ticket. That does not prove an attack, since Bob may have added a key for a new laptop, but it is the event a person must ask about, and the evidence is ready: user, time, file and the kind of write. In production a SIEM (security information and event management system, which collects and searches logs from many hosts) does this matching and keeps the logs away from the host, because an intruder with root can edit a local log.

09. Step 8: The same telemetry with Sysmon for Linux

Sysmon for Linux uses eBPF, small programs that the kernel verifies and then runs, to log events to syslog in the same XML format and event IDs as Sysmon on Windows. That helps a team whose SIEM already parses Windows Sysmon. Event ID 1 (ProcessCreate) includes the full command line and parent process, and event ID 11 (FileCreate) records new files. The configuration below includes only processes whose parent is sudo, and files created in the persistence locations. Sysmon reports files being created, so for edits to a file that already exists, such as Bob's append, the auditd watch is the more direct record.

XML · sysmon-telemetry.xml
<!-- Sysmon for Linux: persistence and privilege telemetry (fragment) -->
<Sysmon schemaversion="4.81">
  <EventFiltering>
    <RuleGroup name="" groupRelation="or">
      <!-- Event ID 1: every process started through sudo -->
      <ProcessCreate onmatch="include">
        <ParentImage condition="is">/usr/bin/sudo</ParentImage>
      </ProcessCreate>
    </RuleGroup>
    <RuleGroup name="" groupRelation="or">
      <!-- Event ID 11: files created in persistence locations -->
      <FileCreate onmatch="include">
        <TargetFilename condition="begin with">/etc/cron.d/</TargetFilename>
        <TargetFilename condition="is">/etc/crontab</TargetFilename>
        <TargetFilename condition="begin with">/var/spool/cron/</TargetFilename>
        <TargetFilename condition="begin with">/etc/systemd/system/</TargetFilename>
        <TargetFilename condition="end with">/.ssh/authorized_keys</TargetFilename>
        <TargetFilename condition="begin with">/etc/sudoers.d/</TargetFilename>
      </FileCreate>
    </RuleGroup>
  </EventFiltering>
</Sysmon>
Terminal · on a VM only (illustrative, not run here)
sudo sysmon -accepteula -i sysmon-telemetry.xml   # install with this config
sudo apt-get install -y rsyslog   # Debian 12 no longer installs it by default
sudo tail -f /var/log/syslog | sudo /opt/sysmon/sysmonLogView

The package, sysmonforlinux, comes from Microsoft's package repository; version 1.6.0 is the current one for Debian 12. It is not run here, because its eBPF programs would load into the shared host kernel. When you are finished, remove the container.

Terminal
docker rm -f telemetry-lab

10. Common mistakes

11. Check your understanding

Practice check · 3 questions

Reading rules and events

Three questions about the rules and the events in this example.

Q1. Bob runs `crontab -e` and adds a job. On Debian, `crontab` writes the file in `/var/spool/cron/crontabs/` with Bob's user rights. Which rule from step 1 records it?
Q2. Alice runs `sudo -i`, and in the root shell runs `cp x.cron /etc/cron.d/x`. With `ausearch -i`, which identity does the cron event show for the person?
Q3. Alice installs `/etc/cron.d/backup` at 10:20 on 11/05/26. CHG-5120 covers that file from 09:00 to 10:00 that day. What does `triage.py` print for the event?
Practice only: not graded, not saved, not evidence.

12. Apply it

Move toward the skill project:

  • Load 50-telemetry.rules on your Ubuntu Server VM, with one authorized_keys line for each account that can log in, and check them with auditctl -l.
  • Use sudo, add a cron job and install a unit, then find each event with ausearch -k and -i.
  • Run ausearch --format csv on the VM's log, adapt changes.csv to your changes, and include the triage output in your report.

13. Review prompt

Without looking back, explain: the three Linux persistence locations in this example and why each is watched; what -p wa records and what it ignores; why the privileged-command rule filters on euid and auid, and why it needs auid!=unset; why the rules cannot be loaded in a container; how you found who ran each root command; and what Sysmon for Linux adds and where auditd is still the better record.

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check