auditd - 审计服务守护进程
/usr/sbin/auditd
审计服务守护进程 auditd 管理本地(请参见 audit_binfile(7)、audit_syslog(7) 和 audit_remote(7))或远程(请参见下文的“审计远程服务器”)生成的审计数据。启用审计时,auditd 将读取其配置来执行以下操作:
配置审计策略。
配置审计队列控制参数。
配置事件到类映射。
设置缺省审计掩码。
如果启用了本地审计(请参见下文的“本地审计”部分),则会装入一个或多个插件。
Solaris 提供了三个插件。audit_binfile(7),用于将二进制审计数据写入到文件中;audit_remote(7),用于将二进制审计数据发送到具有保密性和完整性保护的验证服务器;audit_syslog(7),用于将审计记录的文本摘要发送到 syslog 守护进程。
从内核中读取审计数据并将这些数据传递到每个活动插件。
执行 audit_warn(8) 脚本以针对各种情况发出警告。
如果启用了远程审计 (ars(7)),则会处理请求并存储远程生成的审计数据。
audit(8) 用于控制审计服务。它可能会导致 auditd 执行以下操作:
关闭与远程审计服务器的连接,从而导致该服务器关闭其相应审计文件。
基于当前属性启动和刷新服务。
关闭审计迹并禁用本地审计和远程审计服务。
auditconfig(8) 用于配置审计服务。它可以配置活动和永久性的以下项:
审计策略
审计队列控制参数
缺省审计掩码
要装入的插件
插件属性
审计远程服务器状态、属性和连接组
在本地系统上生成的审计记录的收集。这些记录可以是在全局区域或非全局区域(或者两者)中生成的。
审计远程服务器 (Audit Remote Server, ARS) 接收并存储来自正被审计且配置有活动的 audit_remote 插件的系统的审计记录。为了区分被审计系统与 ARS,可以将被审计系统称为本地被审计系统。
如果至少一个审计守护进程插件被配置为活动的,则审计服务守护进程会启用本地审计。
如果没有将审计远程服务器配置为非活动的(请参见 auditconfig(8) 中的 –setremote 服务器选项)且至少一个连接组处于活动状态,则会启用审计远程服务器功能。See “Audit Remote Server” section for more information.
可以独立地配置本地审计和审计远程服务器。
The Audit Remote Server, ARS, is an integral part of auditd.它成为了 audit_remote(7) 插件的一个搭档。Data sent by the plugin can be captured, processed, and stored by the server according to its configuration, as described in the ars(7) manual page.
ARS 是作为一个被禁用的 Solaris 审计组件提供的。需要对 ARS 进行配置,然后才能将其用于处理远程审计迹。ARS 配置包括两方面:首先,必须配置用于安全传输审计数据的底层安全机制(请参见 audit_remote(7));其次,必须正确配置审计子系统。
要观察和配置 ARS,请使用 auditconfig(8) –setremote 和 – getremote 选项。该配置分为 server 配置和 group 配置。The server configuration allows for changing common ARS parameters, while the group keyword allows configuration of connection groups, the sets of hosts sharing the same local storage parameters.
Server Configuration Attributes服务器侦听的地址。An empty listen_address attribute defaults to listen on all local addresses.
本地侦听端口;0 缺省为 16162。与 solaris-audit Internet 服务名称相关联的端口。See services(5).
The server disconnects after login grace time (in seconds) if the connection has not been successfully established. 0 defaults to no limit.
并发的、未通过验证的与该服务器连接的次数,达到该次数后,服务器将开始拒绝新的连接。请注意,可以按 begin:rate:full 格式指定该值,以允许随机提前删除模式,例如 10:30:60。如果当前存在 10 个(来自 start 字段)未通过验证的连接,那就意味着 ARS 拒绝连接尝试的几率是 rate/100(在我们的示例中为 30%)。如果未通过验证的连接数量达到 full(在我们的示例中为 60),几率会呈线性增长,并且会拒绝所有连接尝试。
属性遵循在 audit_binfile(7) 中定义的相应 p_* 属性,简要概括如下:
用于存储每个主机的审计数据的目录。
存储的每个审计迹文件的最大大小;0 缺省为没有任何限制。
包含 binfile_dir 的文件系统上允许剩余的最小空闲空间,当小于该值时,audit_binfile(7) 将通过 audit_warn(8) 通知管理员;0 缺省为没有限制。
定义给定的连接组中允许向服务器发送审计数据的主机。请注意,如果有多个主机条目,请使用逗号作为分隔符。如果 hosts 为空,则这样的连接组称为通配符连接组。如果无法将新连接归类到任何其他(非通配符)连接组,但是配置了一个活动的通配符连接组,则新连接将归类到该连接组。只能配置一个活动的通配符连接组。
有关配置示例,请参见“示例”。
For comprehensive configuration description and examples, see the appropriate chapter in the Managing Auditing in Oracle Solaris 11.4 book.
对于要发送到插件的审计数据,排队等候的记录的最大数目由为插件指定的 qsize 参数指定。如果省略,将使用当前的 hiwater 标记。请参见 auditconfig(8) 中的 –getqctrl 选项。达到此最大值时,auditd 将阻塞进程或放弃数据,具体取决于 cnt 审计策略(如 auditconfig(8) 中所述)。
在某些情况下,审计服务守护进程和审计插件将调用 audit_warn(8) 脚本。有关更多信息,请参见 audit_warn(8)。
以下示例描述了对审计远程服务器进行配置以在特定地址上侦听的步骤。将创建一个通配符连接组和一个非通配符连接组。The non-wild card connection group configuration will address remote audit data from tic.cz.example.com and tac.us.example.com.审计迹将存储在 /var/audit/remote 中。
# Print the current audit remote server configuration. # Both server and connection groups (if any) is displayed. auditconfig -getremote # Set address the audit remote server will listen on. auditconfig -setremote server "listen_address=192.168.0.1" # Create two connection groups. Note that by default the # connection group is created with no hosts specified # (wild card connection group). auditconfig -setremote group create clockhouse auditconfig -setremote group create sink # Add hosts to the connection group (convert the wild card # connection group no non-wild card one). Set the storage # directory and activate the connection group. auditconfig -setremote group active clockhouse \ "hosts=tic.cz.example.com,tac.us.example.com,\ binfile_dir=/var/audit/remote" # Activate the wild card connection group. # auditconfig -setremote group active sink # Verify the audit remote server configuration. # auditconfig -getremote # Start or refresh the audit service. # audit -s
etc/security/audit/audit_class
etc/security/audit/audit_event
有关下列属性的说明,请参见 attributes(7):
|
audit_event(5)、audit_class(5)、audit_class(5)、services(5)、ars(7)、attributes(7)、audit_binfile(7)、audit_flags(7)、audit_remote(7)、audit_syslog(7)、smf(7)、audit(8)、audit_warn(8)、auditconfig(8)、praudit(8)
《Managing Auditing in Oracle Solaris 11.4》
auditd 是在引导时装入全局区域的(如果启用了审计)。
If the audit policy perzone is set, auditd runs in each zone, starting automatically when the local zone boots.如果设置 perzone 策略时区域已在运行,必须在本地区域内手动启动审计。It is not necessary to reboot the system or the local zone to start auditing in a local zone. auditd can be started with audit –s and will start automatically with future boots of the zone.
auditd 在本地区域中运行时,将从本地区域的 smf(7) 系统信息库和 /etc/security 目录的文件(audit_class、user_attr 和 audit_event)中获取配置。
配置更改不影响当前正在运行的审计会话,因为这些更改并不修改进程的预选掩码。To change the preselection mask on a running process, use the –setpmask option of the auditconfig(8) command.如果用户注销后重新登录,新配置更改将反映在下一个审计会话中。
审计服务 FMRI 为 svc:/system/auditd:default。
The auditd daemon was added in Solaris 2.3.