pub const ZEEK: &str = "# Zeek logs, as the json-streaming-logs package writes them: one JSON record\n# per line, the log it belongs to in `_path`, and times in ISO 8601, which\n# the package sets. Zeek\'s own JSON writer names no log in its records, so\n# they cannot be told apart once sent; send them through the package.\n#\n# The logs read are conn, dns, http, ssl, x509, smb_files, dce_rpc,\n# kerberos, rdp, and ssh. A record of another log, such as weird or notice,\n# is not accepted, and is reported as a dead letter.\n#\n# Connections and their protocols become the OCSF network classes: Network,\n# DNS, HTTP, SMB, RDP, and SSH Activity; Kerberos requests, Authentication. A\n# certificate of the x509 log becomes a Network Activity of its own, the\n# certificate under `tls`. Every field not mapped below is kept under\n# `unmapped` by its Zeek name, such as `conn_state` and `history`.\n#\n# Zeek names a connection\'s endpoints `id.orig_h`, `id.orig_p`, `id.resp_h`,\n# and `id.resp_p`, with the dots part of the names; they are read as such.\n\nname: zeek\nversion: 1\nframing: lines\ndecoding: json\n\n# The ATT&CK data components its records supply: those ATT&CK names for\n# NSM:Flow, NSM:Connections, and NSM:Content, of the records the kinds below read.\ndata_components:\n - Network Connection Creation\n - Network Traffic Flow\n - Network Traffic Content\n - Network Share Access\n - User Account Authentication\n\ncommon:\n time: { from: ts, as: timestamp }\n severity_id: { value: 1 }\n metadata.version: { value: \"1.5.0\" }\n metadata.product.name: { value: Zeek }\n metadata.product.vendor_name: { value: Zeek }\n metadata.log_name: _path\n metadata.correlation_uid: uid\n src_endpoint.ip: { from: id.orig_h, as: ip }\n src_endpoint.port: id.orig_p\n dst_endpoint.ip: { from: id.resp_h, as: ip }\n dst_endpoint.port: id.resp_p\n\nkinds:\n - name: conn\n when:\n _path: conn\n # Network Activity: Traffic, one record per connection.\n class: { class_uid: 4001, activity_id: 6 }\n fields:\n connection_info.uid: uid\n connection_info.protocol_name: proto\n connection_info.community_uid: community_id\n app_name: service\n traffic.bytes_out: orig_bytes\n traffic.bytes_in: resp_bytes\n traffic.packets_out: orig_pkts\n traffic.packets_in: resp_pkts\n unmapped: [\".\"]\n\n - name: dns\n when:\n _path: dns\n # DNS Activity: Traffic, a query and its response in one record.\n class: { class_uid: 4003, activity_id: 6 }\n fields:\n connection_info.uid: uid\n connection_info.protocol_name: proto\n query.hostname: query\n query.type: qtype_name\n query.class: qclass_name\n query.packet_uid: trans_id\n rcode: rcode_name\n # DNS response codes, as OCSF numbers them.\n rcode_id:\n from: rcode\n map: { \"0\": 0, \"1\": 1, \"2\": 2, \"3\": 3, \"4\": 4, \"5\": 5, \"6\": 6, \"7\": 7, \"8\": 8, \"9\": 9, \"10\": 10 }\n otherwise: 99\n unmapped: [\".\"]\n\n - name: http_get\n when: { _path: http, method: GET }\n # HTTP Activity: Get. `uri` is the path with its query, as sent.\n class: { class_uid: 4002, activity_id: 3 }\n fields: &http\n connection_info.uid: uid\n http_request.http_method: method\n http_request.url.hostname: host\n http_request.url.path: uri\n http_request.referrer: referrer\n http_request.version: version\n http_request.user_agent: user_agent\n http_request.length: request_body_len\n http_response.code: status_code\n http_response.message: status_msg\n http_response.length: response_body_len\n unmapped: [\".\"]\n\n - name: http_post\n when: { _path: http, method: POST }\n # HTTP Activity: Post.\n class: { class_uid: 4002, activity_id: 6 }\n fields: *http\n unmapped: [\".\"]\n\n - name: http_put\n when: { _path: http, method: PUT }\n # HTTP Activity: Put.\n class: { class_uid: 4002, activity_id: 7 }\n fields: *http\n unmapped: [\".\"]\n\n - name: http_head\n when: { _path: http, method: HEAD }\n # HTTP Activity: Head.\n class: { class_uid: 4002, activity_id: 4 }\n fields: *http\n unmapped: [\".\"]\n\n - name: http_delete\n when: { _path: http, method: DELETE }\n # HTTP Activity: Delete.\n class: { class_uid: 4002, activity_id: 2 }\n fields: *http\n unmapped: [\".\"]\n\n - name: http_connect\n when: { _path: http, method: CONNECT }\n # HTTP Activity: Connect.\n class: { class_uid: 4002, activity_id: 1 }\n fields: *http\n unmapped: [\".\"]\n\n - name: http_options\n when: { _path: http, method: OPTIONS }\n # HTTP Activity: Options.\n class: { class_uid: 4002, activity_id: 5 }\n fields: *http\n unmapped: [\".\"]\n\n - name: http_trace\n when: { _path: http, method: TRACE }\n # HTTP Activity: Trace.\n class: { class_uid: 4002, activity_id: 8 }\n fields: *http\n unmapped: [\".\"]\n\n - name: http_other\n when:\n _path: http\n # HTTP Activity: Other, such as WebDAV\'s methods, or a request Zeek saw\n # no method of.\n class: { class_uid: 4002, activity_id: 99 }\n fields: *http\n unmapped: [\".\"]\n\n - name: ssl\n when:\n _path: ssl\n # Network Activity: Traffic, a TLS or SSL session.\n class: { class_uid: 4001, activity_id: 6 }\n fields:\n connection_info.uid: uid\n tls.version: version\n tls.cipher: cipher\n tls.sni: server_name\n unmapped: [\".\"]\n\n - name: x509\n when:\n _path: x509\n # Network Activity: Other, a certificate seen in a session. The log has\n # no connection; its `fingerprint` joins it to `cert_chain_fps` of ssl.\n class: { class_uid: 4001, activity_id: 99 }\n fields:\n tls.certificate.serial_number: certificate.serial\n tls.certificate.subject: certificate.subject\n tls.certificate.issuer: certificate.issuer\n tls.certificate.version: { from: certificate.version, as: string }\n tls.certificate.created_time: { from: certificate.not_valid_before, as: timestamp }\n tls.certificate.expiration_time: { from: certificate.not_valid_after, as: timestamp }\n unmapped: [\".\"]\n\n - name: smb_file_open\n when: { _path: smb_files, action: \"SMB::FILE_OPEN\" }\n # SMB Activity: File Open, `path` being the share and `name` the file\n # in it.\n class: { class_uid: 4006, activity_id: 2 }\n fields: &smb_file\n connection_info.uid: uid\n share: path\n file.name: name\n file.size: size\n unmapped: [\".\"]\n\n - name: smb_file_other\n when:\n _path: smb_files\n # SMB Activity: Other, such as a read, write, or delete, its action kept.\n class: { class_uid: 4006, activity_id: 99 }\n fields: *smb_file\n unmapped: [\".\"]\n\n - name: dce_rpc\n when:\n _path: dce_rpc\n # SMB Activity: Other, a DCE/RPC call; its interface, such as `lsarpc`,\n # is kept as `endpoint`.\n class: { class_uid: 4006, activity_id: 99 }\n fields:\n connection_info.uid: uid\n dce_rpc.command: operation\n unmapped: [\".\"]\n\n # Kerberos requests are told apart by whether they succeeded, rather than\n # translating `success`, so that it is kept as Zeek wrote it, a boolean.\n - name: kerberos_ticket\n when: { _path: kerberos, request_type: AS, success: true }\n # Authentication: Authentication Ticket, for the client principal.\n class: { class_uid: 3002, activity_id: 3 }\n fields: &kerberos_success\n auth_protocol: { value: Kerberos }\n auth_protocol_id: { value: 2 }\n user.name: client\n service.name: service\n status_id: { value: 1 }\n unmapped: [\".\"]\n\n - name: kerberos_ticket_refused\n when: { _path: kerberos, request_type: AS, success: false }\n # Authentication: Authentication Ticket, refused for `error_msg`.\n class: { class_uid: 3002, activity_id: 3 }\n fields: &kerberos_failure\n auth_protocol: { value: Kerberos }\n auth_protocol_id: { value: 2 }\n user.name: client\n service.name: service\n status_id: { value: 2 }\n status_detail: error_msg\n unmapped: [\".\"]\n\n - name: kerberos_ticket_unanswered\n when: { _path: kerberos, request_type: AS }\n # Authentication: Authentication Ticket, with no answer Zeek saw.\n class: { class_uid: 3002, activity_id: 3 }\n fields: &kerberos\n auth_protocol: { value: Kerberos }\n auth_protocol_id: { value: 2 }\n user.name: client\n service.name: service\n unmapped: [\".\"]\n\n - name: kerberos_service_ticket\n when: { _path: kerberos, request_type: TGS, success: true }\n # Authentication: Service Ticket Request.\n class: { class_uid: 3002, activity_id: 4 }\n fields: *kerberos_success\n unmapped: [\".\"]\n\n - name: kerberos_service_ticket_refused\n when: { _path: kerberos, request_type: TGS, success: false }\n # Authentication: Service Ticket Request, refused.\n class: { class_uid: 3002, activity_id: 4 }\n fields: *kerberos_failure\n unmapped: [\".\"]\n\n - name: kerberos_service_ticket_unanswered\n when: { _path: kerberos, request_type: TGS }\n # Authentication: Service Ticket Request, with no answer Zeek saw.\n class: { class_uid: 3002, activity_id: 4 }\n fields: *kerberos\n unmapped: [\".\"]\n\n - name: rdp\n when:\n _path: rdp\n # RDP Activity: Other, a session with what Zeek saw of it; the cookie is\n # the user name the client offered, if any.\n class: { class_uid: 4005, activity_id: 99 }\n fields:\n connection_info.uid: uid\n unmapped: [\".\"]\n\n - name: ssh\n when:\n _path: ssh\n # SSH Activity: Other, a session with its algorithms and whether it\n # authenticated.\n class: { class_uid: 4007, activity_id: 99 }\n fields:\n connection_info.uid: uid\n unmapped: [\".\"]\n";Expand description
The Zeek definition shipped with this crate: connections, DNS, HTTP, TLS, certificates, SMB files, DCE/RPC, Kerberos, RDP, and SSH.