IDS日志分析

简介: General Approach通用方法1. Identify which log sources and automated tools you can use during the analysis.确认哪些日志源和自动化工具在分析过程中可以使用。
General Approach
通用方法
1. Identify which log sources and automated tools you can use during the analysis.
确认哪些日志源和自动化工具在分析过程中可以使用。
2. Copy log records to a single location where you will be able to review them.
将日志记录拷贝到你可以进行复查的地方。
3. Minimize “noise” by removing routine, repetitive log entries from view after confirming that they are benign.
在确认日志不处于严重级别之后,通过移除常规、重复的日志记录来降噪。
4. Determine whether you can rely on logs' time stamps; consider time zone differences.
考虑到时区的不同,决定是否信赖日志的时间戳。
5. Focus on recent changes, failures, errors, status changes, access and administration events, and other events unusual for your environment.
关注你环境中最近的变更、失败、错误、状态变化、访问和管理事件,以及其他的异常事件。
6. Go backwards in time from now to reconstruct actions after and before the incident.
从现在开始回溯来重现事件发生前后的动作。
7. Correlate activities across different logs to get a comprehensive picture.
通过不同的日志来关联动作从而得到一幅综合的画面。
8. Develop theories about what occurred; explore logs to confirm or disprove them.
根据理论知识来判断发生了什么,并通过研究日志来确认或否定它们。
Potential Security Log Sources
可能的安全日志源
Server and workstation operating system logs
服务器或工作站操作系统日志
Application logs (e.g., web server, database server)
应用日志(如WEB服务器、数据库服务器)
Security tool logs (e.g., anti-virus, change detection, intrusion detection/prevention system)
安全工具日志(如反病毒、变更探测、IDS/IPS等)
Outbound proxy logs and end-user application logs
边界代理日志和终端应用日志
Remember to consider other, non-log sources for security events.
记住考虑其他,与安全事件有关的非日志源
Typical Log Locations
典型日志位置
Linux OS and core applications: /var/log
Linux操作系统和关键应用:/var/log
Windows OS and core applications: Windows Event Log (Security, System, Application)
Windows操作系统和关键应用:Windows Event Log (Security, System, Application)
Network devices: usually logged via Syslog; some use proprietary locations and formats
网络设备:通常通过syslog方式记录:某些使用私有位置和格式。
What to Look for on Linux
Linux下查看什么
Successful user login
用户登陆成功 “Accepted password”,
“Accepted publickey”,
"session opened”
Failed user login
用户登录失败 “authentication failure”,
“failed password”
User log-off(用户登出) “session closed”
User account change or deletion
用户账户变更或删除 “password changed”,
“new user”,
“delete user”
Sudo actions
SUDO动作 “sudo: … COMMAND=…”
“FAILED su”
Service failure(服务失败) “failed” or “failure”

What to Look for on Windows
Windows下查看什么
Event IDs are listed below for Windows 2000/XP. For Vista/7 security event ID, add 4096 to the event ID.
Windows 2000/XP/2003的事件ID如下所示, Vista/7 /2008的事件ID需要加上4096.
Most of the events below are in the Security log; many are only logged on the domain controller.
以下是安全日志中的绝大部分事件,部分仅仅是域控制器的记录。
User logon/logoff events
用户登入/登出事件 Successful logon 528, 540; failed logon 529-537, 539; logoff 538, 551, etc
User account changes
用户账户变更 Created 624; enabled 626; changed 642; disabled 629; deleted 630
Password changes
密码变更 To self: 628; to others: 627
Service started or stopped
服务启动或停止 7035, 7036, etc.
Object access denied (if auditing enabled)
访问对象拒绝 560, 567, etc
What to Look for on Network Devices
网络设备下查看什么
Look at both inbound and outbound activities.
寻找同时包含进站和出站的活动
Examples below show log excerpts from Cisco ASA logs; other devices have similar functionality.(以思科设备为例)
Traffic allowed on firewall
FW允许通过 “Built … connection”,
“access-list … permitted”
Traffic blocked on firewall
FW拒绝通过 “access-list … denied”,
“deny inbound”,
“Deny … by”
Bytes transferred (large files?)
字节转移 “Teardown TCP connection … duration … bytes …”
Bandwidth and protocol usage
带宽和协议使用 “limit … exceeded”,
“CPU utilization”
Detected attack activity
监测到攻击活动 “attack from”
User account changes
用户账户变更 “user added”,
“user deleted”,
“User priv level changed”
Administrator access
管理员访问 “AAA user …”,
“User … locked out”,
“login failed”
What to Look for on Web Servers
WEB服务器下查看什么
Excessive access attempts to non-existent files
频繁尝试访问不存在的文件
Code (SQL, HTML) seen as part of the URL
URL里边存在(SQL/HTML)代码
Access to extensions you have not implemented
访问你没有使之生效的扩展服务
Web service stopped/started/failed messages
WEB服务停止/启动/出错的消息
Access to “risky” pages that accept user input
访问到允许用户输入的威胁页面
Look at logs on all servers in the load balancer pool
查看负载均衡集群中的所有机器的日志
Error code 200 on files that are not yours
文件中存在不属于自己的错误代码200
Failed user authentication
失败用户认证 Error code 401, 403
Invalid request
非法请求 Error code 400
Internal server error
内部服务器错误 Error code 500
这个是安全事件关键日志复查核查表,有兴趣的可以看一下。
通用方法
1. 确认哪些日志源和自动化工具在分析过程中可以使用。
2. 将日志记录拷贝到你可以进行复查的地方。
3. 在确认日志不处于严重级别之后,通过移除常规、重复的日志记录来降噪。
4. 考虑到时区的不同,决定是否信赖日志的时间戳。
5. 关注你环境中最近的变更、失败、错误、状态变化、访问和管理事件,以及其他的异常事件。
6. 从现在开始回溯来重现事件发生前后的动作。
7. 通过不同的日志来关联动作从而得到一幅综合的画面。
8. 根据理论知识来判断发生了什么,并通过研究日志来确认或否定它们。


可能的安全日志源

服务器或工作站操作系统日志

应用日志(如WEB服务器、数据库服务器)

安全工具日志(如反病毒、变更探测、IDS/IPS等)

边界代理日志和终端应用日志

记住考虑其他,与安全事件有关的非日志源

典型日志位置

Linux操作系统和关键应用:/var/log

Windows操作系统和关键应用:Windows Event Log (Security, System, Application)

网络设备:通常通过syslog方式记录:某些使用私有位置和格式。

Linux下查看什么
Successful user login
用户登陆成功 “Accepted password”,
“Accepted publickey”,
"session opened”
Failed user login
用户登录失败 “authentication failure”,
“failed password”
User log-off(用户登出) “session closed”
User account change or deletion
用户账户变更或删除 “password changed”,
“new user”,
“delete user”
Sudo actions
SUDO动作 “sudo: … COMMAND=…”
“FAILED su”
Service failure(服务失败) “failed” or “failure”


Windows下查看什么

Windows 2000/XP/2003的事件ID如下所示, Vista/7 /2008的事件ID需要加上4096.

以下是安全日志中的绝大部分事件,部分仅仅是域控制器的记录。
User logon/logoff events
用户登入/登出事件 Successful logon 528, 540; failed logon 529-537, 539; logoff 538, 551, etc
User account changes
用户账户变更 Created 624; enabled 626; changed 642; disabled 629; deleted 630
Password changes
密码变更 To self: 628; to others: 627
Service started or stopped
服务启动或停止 7035, 7036, etc.
Object access denied (if auditing enabled)
访问对象拒绝 560, 567, etc

网络设备下查看什么

寻找同时包含进站和出站的活动
以思科设备为例
Traffic allowed on firewall
FW允许通过 “Built … connection”,
“access-list … permitted”
Traffic blocked on firewall
FW拒绝通过 “access-list … denied”,
“deny inbound”,
“Deny … by”
Bytes transferred (large files?)
字节转移 “Teardown TCP connection … duration … bytes …”
Bandwidth and protocol usage
带宽和协议使用 “limit … exceeded”,
“CPU utilization”
Detected attack activity
监测到攻击活动 “attack from”
User account changes
用户账户变更 “user added”,
“user deleted”,
“User priv level changed”
Administrator access
管理员访问 “AAA user …”,
“User … locked out”,
“login failed”

WEB服务器下查看什么

频繁尝试访问不存在的文件

URL里边存在(SQL/HTML)代码

访问你没有使之生效的扩展服务

WEB服务停止/启动/出错的消息

访问到允许用户输入的威胁页面

查看负载均衡集群中的所有机器的日志

文件中存在不属于自己的错误代码200

失败用户认证 Error code 401, 403

非法请求 Error code 400

内部服务器错误 Error code 500

 

相关实践学习
通过日志服务实现云资源OSS的安全审计
本实验介绍如何通过日志服务实现云资源OSS的安全审计。
目录
相关文章
|
11月前
|
运维 监控 安全
IDS 和 IPS 日志监控的重要性
本文介绍了入侵检测系统(IDS)与入侵防御系统(IPS)在企业网络安全中的重要作用及区别。IDS通过监控网络流量、识别异常活动并生成警报,采用异常检测和签名检测等方法保障安全;而IPS作为自动化设备,主动分析流量并阻止恶意攻击,同时重新配置防火墙以增强防护能力。两者协同工作可实时抵御威胁,并通过日志记录和分析优化安全策略。此外,卓豪EventLog Analyzer能有效监控和分析IDS/IPS日志,助力企业精准识别复杂威胁,提升整体网络安全水平。
252 0
|
Web App开发 监控 关系型数据库
将主机IDS OSSEC日志文件存入MYSQL的方法
OSSEC 作为一个主机IDS 具有ROOTKIT 检查,异常检测,自动响应,文件防篡改等重要功能,而且开源,免费。
1101 0
|
XML 安全 Java
【日志框架整合】Slf4j、Log4j、Log4j2、Logback配置模板
本文介绍了Java日志框架的基本概念和使用方法,重点讨论了SLF4J、Log4j、Logback和Log4j2之间的关系及其性能对比。SLF4J作为一个日志抽象层,允许开发者使用统一的日志接口,而Log4j、Logback和Log4j2则是具体的日志实现框架。Log4j2在性能上优于Logback,推荐在新项目中使用。文章还详细说明了如何在Spring Boot项目中配置Log4j2和Logback,以及如何使用Lombok简化日志记录。最后,提供了一些日志配置的最佳实践,包括滚动日志、统一日志格式和提高日志性能的方法。
4281 31
【日志框架整合】Slf4j、Log4j、Log4j2、Logback配置模板
|
9月前
|
监控 容灾 算法
阿里云 SLS 多云日志接入最佳实践:链路、成本与高可用性优化
本文探讨了如何高效、经济且可靠地将海外应用与基础设施日志统一采集至阿里云日志服务(SLS),解决全球化业务扩展中的关键挑战。重点介绍了高性能日志采集Agent(iLogtail/LoongCollector)在海外场景的应用,推荐使用LoongCollector以获得更优的稳定性和网络容错能力。同时分析了多种网络接入方案,包括公网直连、全球加速优化、阿里云内网及专线/CEN/VPN接入等,并提供了成本优化策略和多目标发送配置指导,帮助企业构建稳定、低成本、高可用的全球日志系统。
947 54
|
监控 安全 Apache
什么是Apache日志?为什么Apache日志分析很重要?
Apache是全球广泛使用的Web服务器软件,支持超过30%的活跃网站。它通过接收和处理HTTP请求,与后端服务器通信,返回响应并记录日志,确保网页请求的快速准确处理。Apache日志分为访问日志和错误日志,对提升用户体验、保障安全及优化性能至关重要。EventLog Analyzer等工具可有效管理和分析这些日志,增强Web服务的安全性和可靠性。
430 9
|
XML JSON Java
Logback 与 log4j2 性能对比:谁才是日志框架的性能王者?
【10月更文挑战第5天】在Java开发中,日志框架是不可或缺的工具,它们帮助我们记录系统运行时的信息、警告和错误,对于开发人员来说至关重要。在众多日志框架中,Logback和log4j2以其卓越的性能和丰富的功能脱颖而出,成为开发者们的首选。本文将深入探讨Logback与log4j2在性能方面的对比,通过详细的分析和实例,帮助大家理解两者之间的性能差异,以便在实际项目中做出更明智的选择。
1418 3
|
12月前
|
存储 SQL 关系型数据库
MySQL日志详解——日志分类、二进制日志bin log、回滚日志undo log、重做日志redo log
MySQL日志详解——日志分类、二进制日志bin log、回滚日志undo log、重做日志redo log、原理、写入过程;binlog与redolog区别、update语句的执行流程、两阶段提交、主从复制、三种日志的使用场景;查询日志、慢查询日志、错误日志等其他几类日志
919 35
MySQL日志详解——日志分类、二进制日志bin log、回滚日志undo log、重做日志redo log
|
12月前
|
存储 缓存 关系型数据库
图解MySQL【日志】——Redo Log
Redo Log(重做日志)是数据库中用于记录数据页修改的物理日志,确保事务的持久性和一致性。其主要作用包括崩溃恢复、提高性能和保证事务一致性。Redo Log 通过先写日志的方式,在内存中缓存修改操作,并在适当时候刷入磁盘,减少随机写入带来的性能损耗。WAL(Write-Ahead Logging)技术的核心思想是先将修改操作记录到日志文件中,再择机写入磁盘,从而实现高效且安全的数据持久化。Redo Log 的持久化过程涉及 Redo Log Buffer 和不同刷盘时机的控制参数(如 `innodb_flush_log_at_trx_commit`),以平衡性能与数据安全性。
651 5
图解MySQL【日志】——Redo Log
|
11月前
|
监控 Java 应用服务中间件
Tomcat log日志解析
理解和解析Tomcat日志文件对于诊断和解决Web应用中的问题至关重要。通过分析 `catalina.out`、`localhost.log`、`localhost_access_log.*.txt`、`manager.log`和 `host-manager.log`等日志文件,可以快速定位和解决问题,确保Tomcat服务器的稳定运行。掌握这些日志解析技巧,可以显著提高运维和开发效率。
1240 13