Linux Labs

Server security / Stage 9 of 10 · step 5 of 6

The config changes by itself

medium ~20 min
Not running Starting usually ~20 s
Report a problem

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

  1. 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.
  2. 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.
  3. Take that job off the schedule.
  4. Leave everything else as it was: cron runs, the other users' jobs and the backup are in place, and the portal group keeps write access to the config.

There is no internet on the machine; everything you need is already installed. Run administrative commands with sudo.

Visible only to you. Saved as you type.

All notes

Lab 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 checked yet
  • ~/culprit.txt names the user and the full path of the program that writes to the config — not checked yet
  • The job that changes the config is no longer scheduled — not checked 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 checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…