linux audit审计(7-1)--读懂audit日志
auid=0
auid记录Audit user ID,that is the loginuid。当我使用lbh用户登录系统时,再访问audit_test,此时记录的auid为1001,具体日志如下:
type=SYSCALL msg=audit(1523513135.147:4172990525): arch=c000003e syscall=257 success=yes exit=3 a0=ffffffffffffff9c a1=1cb8550 a2=90800 a3=0 items=1 ppid=20655
pid=24299 auid=1001 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 tty=pts3 ses=10868 comm="ls" exe="/usr/bin/ls" key="audit_test"
This ID is assigned to a user upon login and is inherited by every process even when the user's identity changes,
for example, by switching user accounts with the su - john command.
auid为登录用户的ID,如果是root,ID为0。并且解释更换了用户,那么每个进程事件的auid还是那个登录用户的ID。
uid=1001,gid=1001, euid=1001, suid=1001, fsuid=1001, egid=1001, sgid=1001, fsgid=1001
uid为启动这个分析进程的用户的ID,即具体执行进程的用户ID。后面分别对应着,group ID,effective user ID, set user ID, file system user ID, effective group ID, set group ID, file system group ID。
tty=pts0
具体在哪个终端tty执行的操作。如执行ls这个操作是在哪个终端进行的。
ses=10868
session ID,对话ID。
comm=ls
什么命令导致的审计记录,这里是ls,ls访问读取了这个目录,故记录了审计日志。
exe=“/usr/bin/ls”
记录可执行文件的具体路径。
下面,我们来看一下第二条记录。
type=CWD
type值为CWD,即current working directory。记录的是当前进程的位置。目的如下,先不翻译了,直接上英文吧。
The purpose of this record is to record the current process's location in case a relative path winds up being captured in the associated PATH record.
This way the absolute path can be reconstructed.
第三条记录
type=PATH
In the third record, the type field value is PATH. An Audit event contains a PATH-type record for every path that is passed to the system call as an argument. In this Audit event, only one path (/etc/ssh/sshd_config) was used as an argument.我理解应该是参数的路径
item=0
The item field indicates which item, of the total number of items referenced in the SYSCALL type record, the current record is. This number is zero-based; a value of 0means it is the first item.这个路径为命令的第一个参数。
name=.
我反问audit_test目录时,是直接在这个目录下ls的,这个name字段记录系统调用时文件或目录的full path,在目录下直接ls时,name为. 即当前路经,如果我在根目录下,ls /home/audit_test时,记录如下:
type=CWD msg=audit(1523515123.152:4172990785): cwd="/"
type=PATH msg=audit(1523515123.152:4172990785): item=0 name="/home/audit_test" inode=99213313 dev=08:11 mode=040755 ouid=0 ogid=0 rdev=00:00 objtype=NORMAL
inode=99213313
inode表示这个文件或目录的inode number,可以用如下命令来查询当前inode对应的文件。
linux-xdYUnA:~ # find / -inum 99213313 -print
/home/audit_test
可以用stat命令来查询文件或目录的inode number。
linux-xdYUnA:~ # stat /home/audit_test
File: ‘/home/audit_test’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 811h/2065d Inode: 99213313 Links: 2
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2018-04-11 17:09:36.690392929 +0800
Modify: 2018-04-11 17:04:30.360408595 +0800
Change: 2018-04-11 17:09:12.849394149 +0800
Birth: -
dev=08:11
dev字段,指明device的minor和major ID。
mode=040755
mode字段表示文件或路径的权限。
ouid=0
the object owner's user ID。当我把audit_test目录的所有者改为lbh用户时,记录如下:ouid为1001。
type=PATH msg=audit(1523516175.932:4172990921): item=0 name="." inode=99213313 dev=08:11 mode=040755 ouid=1001 ogid=0 rdev=00:00 objtype=NORMAL
ogid=0
the object owner's group ID.
rdev=00:00
The rdev field contains a recorded device identifier for special files only. In this case, it is not used as the recorded file is a regular file.
objtype=NORMAL
objtype field records the intent of each path record's operation in the context of a given syscall.linux audit审计(7-1)--读懂audit日志的更多相关文章
- 一次CMS GC问题排查过程(理解原理+读懂GC日志)
这个是之前处理过的一个线上问题,处理过程断断续续,经历了两周多的时间,中间各种尝试,总结如下.这篇文章分三部分: 1.问题的场景和处理过程:2.GC的一些理论东西:3.看懂GC的日志 先说一下问题吧 ...
- [转]一次CMS GC问题排查过程(理解原理+读懂GC日志)
这个是之前处理过的一个线上问题,处理过程断断续续,经历了两周多的时间,中间各种尝试,总结如下.这篇文章分三部分: 1.问题的场景和处理过程:2.GC的一些理论东西:3.看懂GC的日志 先说一下问题吧 ...
- linux audit审计(7)--读懂audit日志
让我们先来构造一条audit日志.在home目录下新建一个目录,然后配置一条audit规则,对这个目录的wrax,都记录审计日志: auditctl -w /home/audit_test -p wr ...
- linux audit审计(8)--开启audit对系统性能的影响
我们使用测试性能的工具,unixbench,它有一下几项测试项目: Execl Throughput 每秒钟执行 execl 系统调用的次数 Pipe Throughput 一秒钟内一个进程向一个管道 ...
- mysqlbinlog读懂binlog
binlog 报unknown variable 'default-character-set=utf8' 方法1: 在/etc/my.cnf 中将default-character-set=utf8 ...
- linux的审计功能(audit)
为了满足这样的需求:记录文件变化.记录用户对文件的读写,甚至记录系统调用,文件变化通知.什么是auditThe Linux Audit Subsystem is a system to Collect ...
- linux中的audit审计日志
这里首先介绍auditctl的应用,具体使用指南查看man auditctl.auditctl的man 描述说明这个工具主要是用来控制audit系统行为,获取audit系统状态,添加或者删除audit ...
- linux audit审计(5)--audit规则配置
audit可以配置规则,这个规则主要是给内核模块下发的,内核audit模块会按照这个规则获取审计信息,发送给auditd来记录日志. 规则类型可分为: 1.控制规则:控制audit系统的规则: 2.文 ...
- linux audit审计(3)--audit服务配置
audit守护进程可以通过/etc/audit/auditd.conf文件进行配置,默认的auditd配置文件可以满足大多数环境的要求. local_events = yes write_logs = ...
随机推荐
- [TJOI2017]城市
嘟嘟嘟 这题刚开始想复杂了,想什么dp去了,其实没那么难. 考虑断掉一条边,记分离出来的两棵子树为A和B,那么合并后的树的直径可能有三种情况: 1.A的直径. 2.B的直径 3.A的半径+边权+B的半 ...
- [SDOi2012]吊灯
嘟嘟嘟 这题想了半天,搞出了一个\(O(10 * d * n)\)(\(d\)为\(n\)的约数个数)的贪心算法,就是能在子树内匹配就在子树内匹配,否则把没匹配的都交给父亲,看父亲能否匹配.交上去开了 ...
- P1577 切绳子(二分)
思路:先来分析一下数据范围,是1e4个数据,但是,是double类型,结果不超过0.01那么在绳子最大的情况下,单纯的找正确答案暴力的话就是1e7的时间复杂度,再乘上1e4的数据,这样肯定不行.那么很 ...
- PHP设计模式_工厂模式
个人理解工厂类相当于平时用的基类,只需要把类new一次然后付给一个变量,以后直接引入基类调用变量使用类里的方法即可 了解 工厂模式,工厂方法或者类生成对象,而不是在代码中直接new. 使用工厂模式,可 ...
- linux stat 查看文件的详细信息
linux stat查看文件详细信息 [root@oldboy01 tmp]# stat /tmp/1.cc File: `/tmp/1.cc' Size: 4 Blocks: 8 IO Block: ...
- Redis之过期时间
1.命令介绍 expire key seconds 设置key的有效时间,单位为秒expire命令返回1表示设置成功,返回0表示键不存在或设置失败. ttl keyttl命令返回值是键的剩余时间 ...
- conda install 出错
在下载包时出现下面的错误: userdeMBP:pytorch user$ conda install -n deeplearning matplotlib Solving environment: ...
- 初学Python——RabbitMQ的安装
记录踩坑之路,本篇文章主要摘抄自CSDN博客https://blog.csdn.net/weixin_39735923/article/details/79288578 Windows10环境下安装R ...
- P1171 售货员的难题--搜索(剪枝)
题目背景 数据有更改 题目描述 某乡有nn个村庄(1<n \le 201<n≤20),有一个售货员,他要到各个村庄去售货,各村庄之间的路程s(0<s<1000)s(0<s ...
- AI 可视化
可视化 参考链接: http://www.tensorfly.cn/tfdoc/how_tos/summaries_and_tensorboard.html