In the OCSF schema, recorded log messages have this syntax:在OCSF模式中,记录的日志消息具有以下语法:
{
"activity_id" : <int>,
"category_uid" : <int>,
"class_uid" : <int>,
"time" : <int>,
"severity_id" : <int>,
"type_uid" : <int>,
"metadata" : <document>
"actor" : {
"user" : {
"type_id" : <int>,
"name" : <string>,
"groups" : <array of documents>
}
},
"src_endpoint" : {
"ip": <string>, // IP address for origin client computer
"port": <int>, // Port for origin client computer
"intermediate_ips": [ {
// IP address and port for mongos or load balancermongos或负载均衡器的IP地址和端口
"ip": <string>,
"port": <int>
}, {
// IP address and port for mongos or load balancermongos或负载均衡器的IP地址和端口
"ip": <string>,
"port": <int>
} ]
},
"dst_endpoint" : {
// IP address and port for local MongoDB server本地MongoDB服务器的IP地址和端口
"ip": <string>,
"port": <int>
}
}
The following table describes the fields in the log message.下表描述了日志消息中的字段。
activity_id | ||
category_uid | ||
class_uid | ||
time | ||
severity_id | ||
type_uid | ||
metadata | ||
actor | ||
src_endpoint |
| |
dst_endpoint |
|
Note
Log messages may contain additional fields depending on the event that was logged.日志消息可能包含其他字段,具体取决于记录的事件。
OCSF Category MappingOCSF类别映射
This table describes the 此表描述了category_uid values:category_uid值:
category_uid | |
|---|---|
1 | |
2 | |
3 | IAM |
4 | |
5 | |
6 |
OCSF Class MappingOCSF类映射
For a complete list of OCSF 有关OCSF class_uids and how they map to different classes, see the OCSF Documentation.class_uid的完整列表以及它们如何映射到不同的类,请参阅OCSF文档。
OCSF Type MappingOCSF类型映射
The type_uid field represents a combination of the audited event's class, activity, and category. The resulting UUID indicates the type of activity that occurred.type_uid字段表示被审核事件的类、活动和类别的组合。生成的UUID指示发生的活动类型。
Specifically, 具体来说,type_uid is ( class_uid * 100 ) + (activity_id), with category_id being the thousands place in a class_id.type_uid是( class_uid * 100 ) + (activity_id),category_id是class_id中的千位。
This table describes how audited actions map to 此表描述了经审核的操作如何映射到type_uid:type_uid:
| Action Type | type_uid | Category | Class | Activity |
|---|---|---|---|---|
addShard | 500101 | Configuration | Log | |
applicationMessage | 100799 | System | Other | |
auditConfigure | 500201 or 500203 | Device Config State |
| |
authzCheck | 600301 - 600304 | Application | API Activity |
|
authenticate | 300201 | IAM | Authentication | Logon |
clientMetadata | 400101 | Network | Network Activity | Open |
createCollection | 300401 | IAM | Entity Management | Create |
createDatabase | 300401 | IAM | Entity Management | Create |
createIndex | 300401 | IAM | Entity Management | Create |
createRole | 300101 | IAM | Account Change | Create |
createUser | 300101 | IAM | Account Change | Create |
directAuthMutation | 300100 | IAM | Account Change | Unknown |
dropAllRolesFromDatabase | 300106 | IAM | Account Change | Delete |
dropAllUsersFromDatabase | 300106 | IAM | Account Change | Delete |
dropCollection | 300404 | IAM | Entity Management | Delete |
dropDatabase | 300404 | IAM | Entity Management | Delete |
dropIndex | 300404 | IAM | Entity Management | Delete |
dropPrivilegesToRole | 300107 | IAM | Account Change | Attach Policy |
dropRole | 300106 | IAM | Account Change | Delete |
dropUser | 300106 | IAM | Account Change | Delete |
enableSharding | 500201 | Configuration | Device Config State | Log |
getClusterParameter | 600302 | Application | API Activity | Read |
grantRolesToRole | 300107 | IAM | Account Change | Attach Policy |
grantRolesToUser | 300107 | IAM | Account Change | Attach Policy |
importCollection | 300401 | IAM | Entity Management | Create |
logout | 300202 | IAM | Authentication | Logoff |
refineCollectionShardKey | 500201 | Configuration | Device Config State | Log |
removeShard | 500201 | Configuration | Device Config State | Log |
renameCollection | 300403 | IAM | Entity Management | Update |
replSetReconfig | 500201 | Configuration | Device Config State | Log |
revokePrivilegesFromRole | 300108 | IAM | Account Change | Detach Policy |
revokeRolesFromRole | 300108 | IAM | Account Change | Detach Policy |
revokeRolesFromUser | 300108 | IAM | Account Change | Detach Policy |
rotateLog | 100799 | System | Process | Other |
setClusterParameter | 500201 | Configuration | Device Config State | Log |
shardCollection | 500201 | Configuration | Device Config State | Log |
shutdown | 100702 | System | Process | Terminate |
startup | 100701 | System | Process | Launch |
updateCachedClusterServerParameter | 500201 | Configuration | Device Config State | Log |
updateRole | 300199 | IAM | Account Change | Other |
updateUser | 300199 | IAM | Account Change | Other |
Examples示例
The following examples show OCSF schema log messages for different action types.以下示例显示了不同操作类型的OCSF模式日志消息。
Authenticate Action身份验证操作
{
"activity_id" : 1,
"category_uid" : 3,
"class_uid" : 3002,
"time" : 1710715316123,
"severity_id" : 1,
"type_uid" : 300201,
"metadata" : {
"correlation_uid" : "20ec4769-984d-445c-aea7-da0429da9122",
"product" : "MongoDB Server",
"version" : "1.0.0"
},
"actor" : {
"user" : {
"type_id" : 1,
"name" : "admin.admin",
"groups" : [ { "name" : "admin.root" } ]
}
},
"src_endpoint" : { "ip" : "127.0.0.1", "port" : 56692 },
"dst_endpoint" : { "ip" : "127.0.0.1", "port" : 20040 },
"user" : { "type_id" : 1, "name" : "admin.admin" },
"auth_protocol" : "SCRAM-SHA-256",
"unmapped" : { "atype" : "authenticate" }
}AuthCheck Action身份验证操作
{
"activity_id" : 0,
"category_uid" : 6,
"class_uid" : 6003,
"time" : 1710715315002,
"severity_id" : 1,
"type_uid" : 600300,
"metadata" : {
"correlation_uid" : "af4510fb-0a9f-49aa-b988-06259a7a861d",
"product" : "MongoDB Server",
"version" : "1.0.0"
},
"actor" : {},
"src_endpoint" : { "ip" : "127.0.0.1", "port" : 45836 },
"dst_endpoint" : { "ip" : "127.0.0.1", "port" : 20040 },
"api" : {
"operation" : "getParameter",
"request" : { "uid" : "admin" },
"response" : { "code" : 13, "error" : "Unauthorized" }
}
}