Step 5 of 6 · lab · 20 min
The config changes by itself
The portal settings keep reverting to someone else's, even though they were just fixed. Put an audit rule on the file, find from the events who rewrites it and with what, and stop it without touching anyone else.
Situation
The company portal reads its settings from /etc/portal/portal.conf. This morning it turned out to have
debug = true, open sign-up and the address of someone else's database. You put the working settings back — a
minute later the file was the same as before:
cat /etc/portal/portal.conf
ls -l /etc/portal/portal.conf
The portal group can write the config — the developers and the deployment account. Your crontab -l is empty,
and /etc/cron.d holds only the settings backup.
Task
- Put an audit rule on writes to
/etc/portal/portal.conf. The rule is in effect now and lives in/etc/audit/rules.d— it survives a reboot. - Use the audit events to find who rewrites the config. Write to
~/culprit.txt, on one line, the user name and the full path of the program that writes to the file. - Take that job off the schedule.
- Leave everything else as it was: cron runs, the other users' jobs and the backup are in place, and the
portalgroup keeps write access to the config.
There is no internet on the machine; everything you need is already installed. Run administrative commands with
sudo.
Lab · on your own
No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.
Goals
0 of 4-
An audit rule watches writes to /etc/portal/portal.conf — it is in effect now and lives in /etc/audit/rules.d — not done yet
-
~/culprit.txt names the user and the full path of the program that writes to the config — not done yet
-
The job that changes the config is no longer scheduled — not done yet
-
Everything else is as before — cron runs, the other jobs and the backup are in place, the portal group can write the config — not done yet
The machine is starting
Hints
0 of 3Lab goals
0 of 4-
An audit rule watches writes to /etc/portal/portal.conf — it is in effect now and lives in /etc/audit/rules.d — not done yet
-
~/culprit.txt names the user and the full path of the program that writes to the config — not done yet
-
The job that changes the config is no longer scheduled — not done yet
-
Everything else is as before — cron runs, the other jobs and the backup are in place, the portal group can write the config — not done yet
Goals are checked on the machine after every command.