Review privileged group changes
Select exact privileged membership changes and explain why each was selected.
Changes need direction
A group-membership event includes an action as well as a group. Adding someone to a privileged group expands access; removing them is a different observation. A generic search for admin mixes unrelated groups, actors and free-text messages.
Use an explicit allowlist of group identifiers and an exact action value. In this lesson the reviewed privileged groups are Administrators and sudo, with case-sensitive spelling. An ADD to sudo-readers is not the same event. These strings describe fictional exports, not commands to run against the host.
Explanations are part of a finding
Carry the event ID, actor, target account and group into the report. Add a stable reason such as privileged_add instead of a verdict like attacker. An authorised administrator can legitimately make this change; a detection selects work for review.
Keep the data schema explicit and use a constant printf format. An actor name or target value is evidence, never a format string or a shell command. Deterministic sorting helps a reviewer see real changes between reports. If your organisation has different privileged groups, update a reviewed policy rather than broadening a substring search until it appears to work.
awk -F '\t' 'NR>1 {printf "%s performed %s\n",$2,$4}' changes.tsv
Put it into practice.
changes.tsv has validated event_id<TAB>actor<TAB>target<TAB>action<TAB>group records. Select action ADD and group exactly Administrators or sudo (case sensitive). Print event_id<TAB>actor<TAB>target<TAB>group<TAB>reason, with reason privileged_add. Sort by event ID under LC_ALL=C; do not select REMOVE, sudo-readers or lowercase administrators.
See an explained solution
export LC_ALL=C
printf 'event_id\tactor\ttarget\tgroup\treason\n'
awk -F '\t' 'NR>1 && $4=="ADD" && ($5=="Administrators" || $5=="sudo") {printf "%s\t%s\t%s\t%s\tprivileged_add\n",$1,$2,$3,$5}' changes.tsv | sort
The conjunction selects the intended direction of change and exact reviewed groups. Keeping the actor and target separate prevents a report from confusing who initiated a change with who received access.