# 19.1.概述

FreeBSD 操作系统包括对安全事件审计的支持。事件审计支持可靠、细粒度和可配置的日志记录，涵盖了各种安全相关的系统事件，包括登录、配置更改以及文件和网络访问。这些日志记录对于实时系统监控、入侵检测和事后分析非常宝贵。FreeBSD 实现了 Sun™ 发布的基本安全模块（BSM）应用程序接口（API）和文件格式，并且与 Solaris™ 和 Mac OS® X 的审计实现具有互操作性。

本章重点介绍事件审计的安装和配置。它解释了审计策略并提供了审计配置示例。

阅读本章后，你将了解：

* 什么是事件审计，它如何工作。
* 如何为 FreeBSD 配置用户和进程的事件审计。
* 如何使用审计缩减和审查工具查看审计记录。

在阅读本章之前，你应该：

* 了解 UNIX® 和 FreeBSD 基础知识 ([FreeBSD Basics](https://docs.freebsd.org/en/books/handbook/basics/#basics))。
* 熟悉内核配置/编译的基础知识 ([Configuring the FreeBSD Kernel](https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig))。
* 对安全性有所了解，并了解其与 FreeBSD 的关系 ([Security](https://docs.freebsd.org/en/books/handbook/security/#security))。

> **警告**
>
> 审计设施存在一些已知的限制，并非所有安全相关的系统事件都可以审计。有些登录机制，如基于 Xorg 的显示管理器和第三方守护进程，未正确配置用户登录会话的审计。
>
> 审计事件设施能够生成非常详细的系统活动日志。在繁忙的系统中，当配置为高详细度时，审计文件数据可能会非常庞大，在某些配置下每周超过几个吉字节。管理员应考虑高容量审计配置所需的磁盘空间。例如，可能希望为 **/var/audit** 专门分配一个文件系统，以防审计文件系统变满时不影响其他文件系统。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.bsdcn.org/hanbook/di-19-zhang-an-quan-shi-jian-shen-ji/19.1.-gai-shu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
