* Audit record created by echo "ThisIsATest" >>/tmp/test/file11
@ 2015-10-09 14:43 Boyd Memmott
2015-10-09 15:02 ` Steve Grubb
0 siblings, 1 reply; 2+ messages in thread
From: Boyd Memmott @ 2015-10-09 14:43 UTC (permalink / raw)
To: linux-audit@redhat.com
[-- Attachment #1.1: Type: text/plain, Size: 1026 bytes --]
Hi
I have an audit question concerning echo "ThisIsATest" >>/tmp/test/file11
I have a rule: -w /tmp/test -p war -S all -k thekey
It produces the following audit record.
type=SYSCALL msg=audit(1444398577.247:1581): arch=c000003e syscall=2 success=yes exit=3 a0=1f5bca0 a1=441 a2=1b6 a3=20 items=2 ppid=17766 pid=17808 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts3 ses=1 comm="bash" exe="/bin/bash" key="thekey"
type=CWD msg=audit(1444398577.247:1581): cwd="/tmp/test"
type=PATH msg=audit(1444398577.247:1581): item=0 name="/tmp/test" inode=1436 dev=00:2e mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=PARENT
type=PATH msg=audit(1444398577.247:1581): item=1 name="file11" inode=6797 dev=00:2e mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=CREATE
I understand bash is the executable, because ">" is writing to the file via a file handle.
Is there another switch or rule that would improve the audit record to capture echo as being the initiator of the command??
Thank you
Boyd
[-- Attachment #1.2: Type: text/html, Size: 3443 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Audit record created by echo "ThisIsATest" >>/tmp/test/file11
2015-10-09 14:43 Audit record created by echo "ThisIsATest" >>/tmp/test/file11 Boyd Memmott
@ 2015-10-09 15:02 ` Steve Grubb
0 siblings, 0 replies; 2+ messages in thread
From: Steve Grubb @ 2015-10-09 15:02 UTC (permalink / raw)
To: linux-audit
On Friday, October 09, 2015 02:43:59 PM Boyd Memmott wrote:
> I have an audit question concerning echo "ThisIsATest" >>/tmp/test/file11
>
> I have a rule: -w /tmp/test -p war -S all -k thekey
>
> It produces the following audit record.
> type=SYSCALL msg=audit(1444398577.247:1581): arch=c000003e syscall=2
> success=yes exit=3 a0=1f5bca0 a1=441 a2=1b6 a3=20 items=2 ppid=17766
> pid=17808 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0
> tty=pts3 ses=1 comm="bash" exe="/bin/bash" key="thekey" type=CWD
> msg=audit(1444398577.247:1581): cwd="/tmp/test"
> type=PATH msg=audit(1444398577.247:1581): item=0 name="/tmp/test" inode=1436
> dev=00:2e mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=PARENT type=PATH
> msg=audit(1444398577.247:1581): item=1 name="file11" inode=6797 dev=00:2e
> mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=CREATE
>
> I understand bash is the executable, because ">" is writing to the file via
> a file handle.
>
> Is there another switch or rule that would improve the audit record to
> capture echo as being the initiator of the command??
In this particular example, keystroke logging would. But in general, the
answer is no. The reason being that echo is built-in to the shell while
/bin/echo is an actual program.
For reference, this is what happens when you type a command:
* Bash checks if internal command and handles it
* If its a subshell,
– forks and starts reading lines and performing them
* Else it: forks, sets up pipes, calls execve(filename, argv, envp)
* Kernel has a list of supported formats
–ia_32aout
-Flat
-Aout
-Script
-Em86
-Elf
-elf_fdpic
* It iterates through each handler until one accepts the file
* Otherwise bash reports not an executable
-Steve
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-09 15:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-09 14:43 Audit record created by echo "ThisIsATest" >>/tmp/test/file11 Boyd Memmott
2015-10-09 15:02 ` Steve Grubb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).