ANSIBLE_AWX

支持的语言:

本文档介绍了如何使用 Bindplane 将 Ansible AWX 日志注入到 Google Security Operations。解析器从 JSON 格式的 Ansible AWX 日志中提取字段。 它使用 JSON 解析来提取日志字段,然后将这些值映射到统一数据模型 (UDM)。它还会为事件源和类型设置默认元数据值。

准备工作

请确保满足以下前提条件:

  • Google SecOps 实例。
  • Windows 2016 或更高版本,或者具有 systemd 的 Linux 主机。
  • 如果通过代理运行,请确保防火墙端口已根据 Bindplane 代理要求打开。
  • 以管理员权限对 Ansible AWX 管理控制台或设备进行特权访问。

获取 Google SecOps 注入身份验证文件

  1. 登录 Google SecOps 控制台。
  2. 依次前往 SIEM 设置 > 收集代理
  3. 下载注入身份验证文件。将文件安全地保存在将要安装 Bindplane 的系统上。

获取 Google SecOps 客户 ID

  1. 登录 Google SecOps 控制台。
  2. 依次前往 SIEM 设置 > 个人资料
  3. 复制并保存组织详细信息部分中的客户 ID

安装 Bindplane 代理

按照以下说明在 Windows 或 Linux 操作系统上安装 Bindplane 代理。

Windows 安装

  1. 以管理员身份打开命令提示符PowerShell
  2. 运行以下命令:

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    

Linux 安装

  1. 打开具有 root 或 sudo 权限的终端。
  2. 运行以下命令:

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    

其他安装资源

如需了解其他安装选项,请参阅安装指南

配置 Bindplane 代理以注入 Syslog 并将其发送到 Google SecOps

  1. 访问配置文件:
    • 找到 config.yaml 文件。通常,它位于 Linux 上的 /opt/observiq-otel-collector/ 目录或 Windows 上的 C:Program FilesobservIQ OpenTelemetry Collector 目录中。
    • 使用文本编辑器(例如 nanovi 或记事本)打开该文件。
  2. 按如下方式修改 config.yaml 文件:

    receivers:
    udplog:
        # Using high port to avoid requiring root privileges
        listen_address: "0.0.0.0:514"
    
    exporters:
    chronicle/awx:
        endpoint: malachiteingestion-pa.googleapis.com
        creds_file_path: '/path/to/ingestion-authentication-file.json'
        customer_id: YOUR_CUSTOMER_ID
        log_type: 'ANSIBLE_AWX'
        raw_log_field: body
    
    service:
    pipelines:
        logs/awx:
        receivers:
            - udplog
        exporters:
            - chronicle/awx
    
    • 根据基础架构的需要替换端口和 IP 地址。
    • YOUR_CUSTOMER_ID 替换为实际的客户 ID。
    • /path/to/ingestion-authentication-file.json 更新为在第 1 步中保存身份验证文件的路径。

重启 Bindplane 代理以应用更改

  • 如需在 Linux 中重启 BindPlane 代理,请运行以下命令:

    sudo systemctl restart observiq-otel-collector
    
  • 如需在 Windows 中重启 Bindplane 代理,您可以使用服务控制台,也可以输入以下命令:

    sc stop observiq-otel-collector && sc start observiq-otel-collector
    

在 Ansible AWX 上配置外部日志记录

  1. 登录 Ansible AWX 管理控制台
  2. 从导航栏中前往设置
  3. 系统选项中选择日志记录设置
  4. 提供以下配置详细信息:
    • 日志汇总器:输入 Bindplane 代理 IP 地址。
    • 日志聚合器端口:输入 Bindplane 代理端口号(例如 514)。
    • 日志记录聚合器类型:从列表中选择其他
    • Logging Aggregator Username:留空(syslog 不需要此字段)。
    • 日志聚合器密码/令牌:留空(syslog 不需要)。
    • 日志记录聚合器协议:选择 UDP(建议用于 syslog)。
    • 日志记录聚合器级别阈值:选择 Info 或您偏好的日志级别。
    • 启用外部日志记录:将切换开关点按为开启
    • 要将数据发送到日志聚合器的记录器:选择相关日志类型:
      • awx:常规服务器日志
      • activity_stream:AWX 对象更改记录
      • job_events:Ansible 回调模块数据
      • system_tracking:系统事实和配置数据
    • 单独记录系统跟踪事实:切换为关闭(默认)。
  5. 点击保存以应用设置。
  6. 可选:点击测试以验证与 Bindplane 代理的连接。

UDM 映射表

日志字段 UDM 映射 逻辑
agent.ephemeral_id observer.labels.value 原始日志中的 agent.ephemeral_id 值。
agent.hostname observer.hostname 原始日志中的 agent.hostname 值。
agent.id observer.asset_id “filebeat:”与原始日志中 agent.id 的值的串联。
agent.name observer.user.userid 原始日志中的 agent.name 值。
agent.type observer.application 原始日志中的 agent.type 值。
agent.version observer.platform_version 原始日志中的 agent.version 值。
cloud.availability_zone principal.resource.attribute.labels.value 原始日志中的 cloud.availability_zone 值。
cloud.instance.id principal.resource.product_object_id 原始日志中的 cloud.instance.id 值。
cloud.instance.name principal.resource.name 原始日志中的 cloud.instance.name 值。
cloud.machine.type principal.resource.attribute.labels.value 原始日志中的 cloud.machine.type 值。
cloud.provider principal.resource.attribute.labels.value 原始日志中的 cloud.provider 值。
event1 metadata.description 原始日志中的 event1 值。如果不存在 event1,则使用 message 的值。
event1_data.host principal.hostname 原始日志中的 event1_data.host 值。
event1_data.remote_addr principal.ip 使用 Grok 模式从 event1_data.remote_addr 中提取的 IP 地址。
event1_data.task security_result.detection_fields.value 原始日志中的 event1_data.task 值。
event1_data.task_path principal.process.file.full_path 原始日志中的 event1_data.task_path 值。
event1_data.task_uuid security_result.detection_fields.value 原始日志中的 event1_data.task_uuid 值。
event1_data.uuid metadata.product_log_id 原始日志中的 event1_data.uuid 值。
event1_display security_result.description 原始日志中的 event1_display 值。
host principal.hostname 原始日志中的 host 值,如果不存在 event1_data.hosthost_name,则使用此值。
host.architecture target.asset.hardware.cpu_platform 原始日志中的 host.architecture 值。
host.fqdn target.administrative_domain 原始日志中的 host.fqdn 值。
host.hostname target.hostname 原始日志中的 host.hostname 值。
host.id target.asset.asset_id “Host Id: ”与原始日志中 host.id 的值的串联。
host.ip target.asset.ip 原始日志中的 host.ip 值。
host.mac target.mac 原始日志中的 host.mac 值。
host.os.codename target.asset.attribute.labels.value 原始日志中的 host.os.codename 值。
host.os.kernel target.platform_patch_level 原始日志中的 host.os.kernel 值。
host.os.name target.asset.attribute.labels.value 原始日志中的 host.os.name 值。
host.os.platform target.platform 如果 host.os.platform 为“debian”,则设置为“LINUX”。
host.os.version target.platform_version 原始日志中的 host.os.version 值。
host_name principal.hostname 原始日志中的 host_name 值,如果不存在 event1_data.host,则使用此值。
input.type network.ip_protocol 如果 input.type 为“tcp”,则设置为“TCP”。
level security_result.severity 根据 level 的值进行映射:“DEBUG”“INFO”“AUDIT”映射到“INFORMATIONAL”;“ERROR”映射到“ERROR”;“WARNING”映射到“MEDIUM”。
level security_result.severity_details 原始日志中的 level 值。
log.source.address principal.ip 使用 Grok 模式从 log.source.address 中提取的 IP 地址。
log.source.address principal.port 使用 grok 模式从 log.source.address 中提取的端口。
logger_name intermediary.application 原始日志中的 logger_name 值。
message metadata.description 原始日志中的 message 值,如果不存在 event1,则用作回退值。
parent_uuid security_result.detection_fields.value 原始日志中的 parent_uuid 值。
timestamp metadata.event_timestamp 原始日志中的 timestamp 值,使用日期过滤条件进行解析。由逻辑确定:如果 JSON 中存在 log.source.addresshost.ip,则为“NETWORK_CONNECTION”;如果存在 principal_hostnameevent1_data.remote_addr,则为“STATUS_UPDATE”;否则为“GENERIC_EVENT”。硬编码为“ANSIBLE_AWX”。硬编码为“ANSIBLE_AWX”。硬编码为“ANSIBLE_AWX”。硬编码为“ephemeral_id”。根据所映射的字段,硬编码为“machine_type”“provider”或“availability_zone”。硬编码为“VIRTUAL_MACHINE”。根据所映射的字段,硬编码为“parent_uuid”“task”或“task_uuid”。根据要映射的字段硬编码为“codename”或“os_name”。

需要更多帮助?从社区成员和 Google SecOps 专业人士那里获得解答。