Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] logging my activity for audits
Date: Wed, 12 Sep 2018 06:24:41
Message-Id: 512247414.txSG9TWWEi@andromeda
In Reply to: Re: [gentoo-user] logging my activity for audits by Grant Taylor
1 On Tuesday, September 11, 2018 5:24:47 PM CEST Grant Taylor wrote:
2 > On 09/11/2018 06:51 AM, wiicontroller@×××××.com wrote:
3 > > If by “all” activity, the customer means all activity, pam_tty_audit is
4 > > the only solution I have heard of that fits the bill:
5 > >
6 > > https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/h
7 > > tml/security_guide/sec-configuring_pam_for_auditing
8 > I'm not familiar with pam_tty_audit, and I didn't see / find ssh in the
9 > linked page. Does pam_tty_audit capture content from SSH sessions?
10 > What about ssh remote command execution?
11
12 SSH can (it does by default) use PAM for authentication. I would suspect it
13 only logs access and not actions.
14
15 > I can conceptually see how it could if it hooks low enough into the tty
16 > layer.
17
18 Xen logs all output of the VM to a text file if it is started automatically.
19 This is done by attaching it to a screen-session and having screen log it all
20 to a text file.
21 If there is a reliable method to force SSH-sessions into something like this,
22 you can log all input and output.
23
24 > > If by “all” activity, the customer means, “We want want a Serious
25 > > Business Stamp,” I recommend getting creative with your shell's
26 > > $HISTFILE, given that 98% of your activity occurs there.
27 >
28 > I discourage this.
29 >
30 > 1) Depending on how it's done, it can break history across sessions.
31 > 2) The $HISTFILE is inherently user writable. Which means that the
32 > user can modify it.
33 > 3) The $HISTFILE is a convenience.
34 > 4) The $HISTFILE is NOT an audit log.
35 > 5) Depending on how the shell is configured, commands can bypass the
36 > $HISTFILE.
37 > 6) The $HISTFILE does nothing for people putting commands in a script
38 > and then running the script. — I had someone do exactly this at my
39 > last job.
40
41 7) When using multiple sessions to the same account, the last session being
42 closed determines the content of $HISTFILE.
43
44 > I *HIGHLY* recommend running as much as you can through sudo. Sudo
45 > events do end up in syslog on every system I've used.
46
47 Does sudo have a shell-mode?
48
49 --
50 Joost

Replies

Subject Author
Re: [gentoo-user] logging my activity for audits Grant Taylor <gtaylor@×××××××××××××××××××××.net>