Hands-on task
Evidence from an erased commit
The server configs live in the git repository /srv/config-repo. The attacker committed the job cron/sync.sh there (commit update sync job) and then covered their tracks: git reset --hard rolled back the main branch, and they made a harmless commit on top. Now the file isn't in the working tree, and the commit isn't in git log either.
Recover the evidence without touching main: create a branch evidence that points to the erased commit — it must contain cron/sync.sh. The history of main must stay as it is (three commits).
- git reflog
- recovering commits
- git branch
- dangling commit
- investigation