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 = ...
随机推荐
- C++ 星号* 与 引用&
星号 * 1. 声明的时候有*, 表示指针变量 int *p=&a;// '&'的作用就是把a变量在内存中的地址给提取出来 2. * +地址, 表示地址操作符 3. 数字*数字, 表示 ...
- CROI R1
$CROI$ $R1$ 今天参加了一场比赛,什么比赛呢?CROI. CROI是什么呢? $Challestend$ $Rehtorbegnaro$ $OI$.总的来说就是我们机房的一些神仙出的题啦. ...
- ECO开放平台对接文档说明
应用集成: http://open.teewon.net:1000/static/index.html#/docs/flow/integrate统一认证集成文档: http://open.teewon ...
- pytorch例子学习——NEURAL TRANSFER USING PYTORCH神经迁移
参考:https://pytorch.org/tutorials/advanced/neural_style_tutorial.html 具体的理论就不解释了,这里主要是解释代码: ⚠️使用的是pyt ...
- leetcode 557. Reverse Words in a String III 、151. Reverse Words in a String
557. Reverse Words in a String III 最简单的把空白之间的词反转 class Solution { public: string reverseWords(string ...
- node.js之十大Web框架
之前接触过Node.js是因为好奇大前端越来越能干了,连我后台的饭碗都要抢了,太嚣张了,于是我想打压打压它,然后就这样接触它了.再到后来是因为Settings-Sync插件二次开发,我需要用node. ...
- Python分析微信好友性别比例和省份城市分布比例
如需转发请注明:小婷儿的博客:https://www.cnblogs.com/xxtalhr/p/10642241.html 一.安装模块 pip install itchat pip install ...
- [MicroPython]TPYBoard开发板DIY小型家庭气象站
对于喜欢登山的人来说,都会非常关心自己所处的高度跟温度,海拔高度的测量方法,海拔测量一般常用的有两种方式,一是通过GPS全球定位系统,二是通过测出大气压,根据气压值算出海拔高度. BMP180是一直常 ...
- Android测试(二):Android测试基础
原文地址:https://developer.android.com/training/testing/fundamentals.html 用户在不同的级别上与你的应用产生交互.从按下按钮到将信息下载 ...
- Generative Adversarial Nets[content]
0. Introduction 基于纳什平衡,零和游戏,最大最小策略等角度来作为GAN的引言 1. GAN GAN开山之作 图1.1 GAN的判别器和生成器的结构图及loss 2. Condition ...