收集 AWS Elastic Load Balancing 日志
支持的平台:
Google SecOps
SIEM
本文档介绍了如何通过设置 Google 安全运营 Feed 来收集 AWS Elastic Load Balancing 日志。解析器会将日志转换为 UDM 格式。它使用 Grok 模式从 CEF 和非 CEF 格式的邮件中提取字段,将其映射到 UDM 字段,并处理各种数据转换,包括针对 HTTP、TLS 和安全相关字段的特定逻辑。它还会根据特定字段的存在或格式执行条件处理,以确保准确地表示 UDM。
准备工作
- 确保您拥有 Google SecOps 实例。
- 确保您拥有对 AWS 的特权访问权限。
配置 AWS Elastic Load Balancing
配置 Amazon S3 存储分区
- 登录 AWS 控制台。
- 按照以下用户指南创建 Amazon S3 存储分区:创建存储分区
- 保存存储分区的名称(例如
elb-logs
)和区域,以备日后使用。 - 按照以下用户指南创建用户:创建 IAM 用户。
- 选择创建的用户。
- 选择安全凭据标签页。
- 点击访问密钥部分中的创建访问密钥。
- 选择第三方服务作为用例。
- 点击下一步。
- 可选:添加说明标记。
- 点击创建访问密钥。
- 点击下载 CSV 文件,保存访问密钥和密钥以供日后使用。
- 点击完成。
- 选择权限标签页。
- 在权限政策部分中,点击添加权限。
- 选择添加权限。
- 选择直接附加政策。
- 搜索并选择 AmazonS3FullAccess 政策。
- 点击下一步。
- 点击添加权限。
配置 AWS Elastic Load Balancer 以启用访问日志
- 登录 AWS 管理控制台。
- 搜索并选择 EC2。
- 在导航菜单中选择负载平衡器。
- 选择要为其启用日志记录的负载平衡器。
- 在说明标签页中,滚动到属性。
- 点击修改属性。
- 选择启用以启用访问日志。
- 选择之前创建的 S3 存储分区(例如
elb-logs
)。 - 可选:设置日志前缀,以便更轻松地识别日志(例如
elb/access-logs/
)。 - 点击保存。
在 Google SecOps 中配置 Feed 以提取 AWS Elastic Load Balancer 日志
- 依次前往 SIEM 设置 > Feed。
- 点击新增。
- 在 Feed 名称字段中,输入 Feed 的名称(例如 AWS Elastic Load Balancer 日志)。
- 选择 Amazon S3 作为来源类型。
- 选择 AWS Elastic Load Balancer 作为日志类型。
- 点击下一步。
为以下输入参数指定值:
- 区域:Amazon S3 存储分区所在的区域。
- S3 URI:存储分区 URI。
s3:/BUCKET_NAME
- 将
BUCKET_NAME
替换为存储分区的实际名称。
- 将
- URI 是:根据日志流配置选择 URI 类型(单个文件 | 目录 | 包含子目录的目录)。
- 来源删除选项:根据您的偏好选择删除选项。
- 访问密钥 ID:有权访问 S3 存储分区的用户访问密钥。
- 私有访问密钥:有权访问 S3 存储分区的用户私有密钥。
- 资源命名空间:资源命名空间。
- 提取标签:要应用于此 Feed 中的事件的标签。
点击下一步。
在最终确定界面中查看新的 Feed 配置,然后点击提交。
UDM 映射表
日志字段 | UDM 映射 | 逻辑 |
---|---|---|
actions_executed |
security_result.action |
如果 actions_executed 为“waf,forward”或“waf,redirect”,请将其设置为“ALLOW”。如果 actions_executed 为“waf”,请将其设置为“BLOCK”。 |
chosen_cert_arn |
principal.user.attribute.labels |
如果 chosen_cert_arn 包含“会话”,请将其值映射到 security_result.description 。否则,请创建一个键为“ARN”且值为 chosen_cert_arn 的标签,并将其添加到 principal.user.attribute.labels 数组。 |
chosen_cert_arn |
security_result.description |
如果 chosen_cert_arn 包含“会话”,请将其值映射到此字段。 |
client_ip |
principal.asset.ip |
直接映射。 |
client_ip |
principal.ip |
直接映射。 |
client_port |
principal.port |
直接映射。 |
classification |
security_result.rule_name |
如果不为空或“-”,则直接映射。 |
classification_reason |
security_result.summary |
如果不为空或“-”,则直接映射。 |
Customer (CEF) |
principal.user.user_display_name |
直接从 CEF 字段映射。 |
data |
多种 | 使用 Grok 模式进行解析,以提取多个字段。如需查看具体映射,请参阅其他行。 |
data.act (CEF) |
security_result.action_details |
直接从 CEF 字段映射。 |
data.app (CEF) |
principal.application |
直接从 CEF 字段映射。 |
data.ccode (CEF) |
principal.location.country |
直接从 CEF 字段映射。 |
data.cicode (CEF) |
principal.location.city |
直接从 CEF 字段映射。 |
data.cn1 (CEF) |
network.http.response_code |
直接从 CEF 字段映射。 |
data.cpt (CEF) |
principal.port |
直接从 CEF 字段映射。 |
data.cs1Label (CEF) |
additional.fields |
创建键值对,键为“Cap Support”,值来自 cs1Label 。 |
data.cs2Label (CEF) |
additional.fields |
创建键值对,键为“Javascript Support”,值来自 cs2Label 。 |
data.cs3Label (CEF) |
additional.fields |
创建键值对,键为“CO Support”,值来自 cs3Label 。 |
data.cs4Label (CEF) |
additional.fields |
创建键值对,键为“VID”,值来自 cs4Label 。 |
data.cs5Label (CEF) |
additional.fields |
创建键值对,键为“clappsig”,值来自 cs5Label 。 |
data.cs6Label (CEF) |
additional.fields |
创建一个键值对,键为“clapp”,值来自 cs6Label 。 |
data.cs7Label (CEF) |
additional.fields |
创建键值对,键为“latitude”,值来自 cs7Label 。 |
data.deviceExternalId (CEF) |
about.asset.asset_id |
用于构成资产 ID:Incapsula.SIEMintegration:deviceExternalId 。 |
data.deviceFacility (CEF) |
principal.location.region |
直接从 CEF 字段映射。 |
data.dproc (CEF) |
target.process.command_line |
直接从 CEF 字段映射。 |
data.dst_ip |
target.asset.ip |
直接映射。 |
data.dst_ip |
target.ip |
直接映射。 |
data.dst_port |
target.port |
直接映射。 |
data.elb |
target.resource.id |
直接映射。 |
data.fileId (CEF) |
security_result.detection_fields |
创建键值对,键为“fileId”,值来自 fileId 。 |
data.in (CEF) |
network.received_bytes |
直接从 CEF 字段映射。 |
data.request (CEF) |
target.url |
直接从 CEF 字段映射。 |
data.requestClientApplication (CEF) |
network.http.user_agent |
直接从 CEF 字段映射。 |
data.requestMethod (CEF) |
network.http.method |
直接从 CEF 字段映射。 |
data.severity (CEF) |
security_result.severity |
如果严重程度为 0,则映射到 LOW。 |
data.sip (CEF) |
principal.asset.ip |
直接从 CEF 字段映射。 |
data.sip (CEF) |
principal.ip |
直接从 CEF 字段映射。 |
data.siteid (CEF) |
security_result.detection_fields |
创建键值对,键为“siteid”,值来自 siteid 。 |
data.sourceServiceName (CEF) |
principal.application |
直接从 CEF 字段映射。 |
data.spt (CEF) |
principal.port |
直接从 CEF 字段映射。 |
data.src (CEF) |
principal.ip |
直接从 CEF 字段映射。 |
data.suid (CEF) |
principal.user.userid |
直接从 CEF 字段映射。 |
data.ver (CEF) |
network.tls.version |
系统会使用 grok 提取版本部分并进行映射。 |
data.ver (CEF) |
network.tls.cipher |
系统使用 grok 提取密码部分并进行映射。 |
data.xff (CEF) |
principal.ip |
直接从 CEF 字段映射。 |
domain_name |
principal.administrative_domain |
直接映射。 |
http_method |
network.http.method |
直接映射。 |
log_type |
metadata.log_type |
直接映射。 |
message |
多种 | 使用 Grok 模式进行解析,以提取多个字段。如需查看具体映射,请参阅其他行。 |
received_bytes |
network.received_bytes |
直接映射。 |
redirect_url |
network.application_protocol |
如果 redirect_url 以“http”开头,系统会提取并映射该协议。 |
redirect_url |
target.asset.hostname |
如果 redirect_url 以“http”开头,系统会提取并映射主机名。 |
redirect_url |
target.hostname |
如果 redirect_url 以“http”开头,系统会提取并映射主机名。 |
redirect_url |
target.port |
如果 redirect_url 以“http”开头,系统会提取并映射端口。 |
request_creation_time |
metadata.collected_timestamp |
在解析日期后直接映射。 |
request_processing_time |
security_result.detection_fields |
使用此字段创建键值对,键为“request_processing_time”,值来自此字段。 |
response_processing_time |
security_result.detection_fields |
使用此字段中的值创建键值对,键为“response_processing_time”。 |
sent_bytes |
network.sent_bytes |
直接映射。 |
ssl_cipher |
network.tls.cipher |
直接映射。 |
ssl_protocol |
network.tls.version |
直接映射。 |
target_group_arn |
target.group.group_display_name |
直接映射。 |
target_processing_time |
security_result.detection_fields |
使用此字段创建键值对,键为“target_processing_time”,值来自此字段。 |
target_status_code |
target.labels |
使用此字段中的值创建键为“target_status_code”的标签,并将其添加到 target.labels 数组。 |
time |
metadata.event_timestamp |
在解析日期后直接映射。 |
trace_id |
metadata.product_log_id |
移除“Root=”后,直接映射。 |
url |
network.http.referral_url |
直接映射。 |
user_agent |
network.http.user_agent |
直接映射。 |
(Parser) | metadata.event_type |
如果存在主机和目标机器 ID,则设置为“NETWORK_HTTP”;如果仅存在主机 ID,则设置为“STATUS_UPDATE”;如果不存在目标 IP、主机名或目的地 IP,则设置为“GENERIC_EVENT”;否则,设置为“NETWORK_HTTP”。 |
(Parser) | metadata.product_name |
设置为“AWS Elastic Load Balancer”。 |
(Parser) | metadata.vendor_name |
设置为“AMAZON”。 |
变化
2024-03-22
- 添加了新的 Grok 模式,以支持新的 JSON 日志模式。
- 添加了对 CEF 模式日志的支持。
- 将“dst_ip”映射到“target.ip”。
- 将“dst_port”映射到“target.port”。
- 将“sip”映射到“principal.ip”。
- 将“request_processing_time”“target_processing_time”“siteid”“fileId”和“response_processing_time”映射到“security_result.detection.fields”。
- 对“principal.ip”和“principal.asset.ip”进行了一致的映射。
- 对“target.ip”和“target.asset.ip”进行了一致的映射。
- “target.hostname”和“target.asset.hostname”的一致映射。
- 将“cipher”映射到“network.tls.cipher”。
- 将“version”映射到“network.tls.version”。
- 将“客户”映射到“principal.user.user_display_name”。
2022-05-27
- 增强功能 - 将 metadata.product_name 中存储的值修改为“AWS Elastic Load Balancer”。
需要更多帮助?向社区成员和 Google SecOps 专业人士寻求解答。