-
Notifications
You must be signed in to change notification settings - Fork 115
Add community_id, fingerprint, and network_direction processors #3011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a7bb431
Processors.ts - add ip to ConvertType
andrewkroh a24055b
Processors.ts - add community_id
andrewkroh e0cfc17
Processors.ts - add fingerprint
andrewkroh 0ded54f
Processors.ts - add network_direction
andrewkroh 51f7537
update doc links table.csv
andrewkroh 56d8aa3
review - add @server-default, use Field/Fields
andrewkroh 98ff04e
review - add FingerprintDigest enum to represent fingerprint method
andrewkroh f24dc11
Processors.ts - add registered_domain processor
andrewkroh 80f4a95
Processors.ts - add output_format to DateProcessor
andrewkroh 77e5e34
Processors.ts - add ecs_compatibility to GrokProcessor
andrewkroh 6b83892
Processors.ts - update transports listed for community_id
andrewkroh c420d53
network_direction processor - internal_networks needs to be optional
andrewkroh 4982c5f
fix server-default -> server_default
andrewkroh 9439259
remove server_default for empty string
andrewkroh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,13 @@ export class ProcessorContainer { | |
| * @doc_id ingest-circle-processor | ||
| */ | ||
| circle?: CircleProcessor | ||
| /** | ||
| * Computes the Community ID for network flow data as defined in the | ||
| * Community ID Specification. You can use a community ID to correlate network | ||
| * events related to a single flow. | ||
| * @doc_id community-id-processor | ||
| */ | ||
| community_id?: CommunityIDProcessor | ||
| /** | ||
| * Converts a field in the currently ingested document to a different type, such as converting a string to an integer. | ||
| * If the field value is an array, all members will be converted. | ||
|
|
@@ -106,6 +113,12 @@ export class ProcessorContainer { | |
| * @doc_id fail-processor | ||
| */ | ||
| fail?: FailProcessor | ||
| /** | ||
| * Computes a hash of the document’s content. You can use this hash for | ||
| * content fingerprinting. | ||
| * @doc_id fingerprint-processor | ||
| */ | ||
| fingerprint?: FingerprintProcessor | ||
| /** | ||
| * Runs an ingest processor on each element of an array or object. | ||
| * @doc_id foreach-processor | ||
|
|
@@ -169,6 +182,12 @@ export class ProcessorContainer { | |
| * @doc_id lowercase-processor | ||
| */ | ||
| lowercase?: LowercaseProcessor | ||
| /** | ||
| * Calculates the network direction given a source IP address, destination IP | ||
| * address, and a list of internal networks. | ||
| * @doc_id network-direction-processor | ||
| */ | ||
| network_direction?: NetworkDirectionProcessor | ||
| /** | ||
| * Executes another pipeline. | ||
| * @doc_id pipeline-processor | ||
|
|
@@ -181,6 +200,14 @@ export class ProcessorContainer { | |
| * @doc_id redact-processor | ||
| */ | ||
| redact?: RedactProcessor | ||
| /** | ||
| * Extracts the registered domain (also known as the effective top-level | ||
| * domain or eTLD), sub-domain, and top-level domain from a fully qualified | ||
| * domain name (FQDN). Uses the registered domains defined in the Mozilla | ||
| * Public Suffix List. | ||
| * @doc_id registered-domain-processor | ||
| */ | ||
| registered_domain?: RegisteredDomainProcessor | ||
| /** | ||
| * Removes existing fields. | ||
| * If one field doesn’t exist, an exception will be thrown. | ||
|
|
@@ -528,13 +555,77 @@ export class CircleProcessor extends ProcessorBase { | |
| target_field?: Field | ||
| } | ||
|
|
||
| export class CommunityIDProcessor extends ProcessorBase { | ||
| /** | ||
| * Field containing the source IP address. | ||
| * @server-default source.ip | ||
| */ | ||
| source_ip?: Field | ||
| /** | ||
| * Field containing the source port. | ||
| * @server-default source.port | ||
| */ | ||
| source_port?: Field | ||
| /** | ||
| * Field containing the destination IP address. | ||
| * @server-default destination.ip | ||
| */ | ||
| destination_ip?: Field | ||
| /** | ||
| * Field containing the destination port. | ||
| * @server-default destination.port | ||
| */ | ||
| destination_port?: Field | ||
| /** | ||
| * Field containing the IANA number. | ||
| * @server-default network.iana_number | ||
| */ | ||
| iana_number?: Field | ||
| /** | ||
| * Field containing the ICMP type. | ||
| * @server-default icmp.type | ||
| */ | ||
| icmp_type?: Field | ||
| /** | ||
| * Field containing the ICMP code. | ||
| * @server-default icmp.code | ||
| */ | ||
| icmp_code?: Field | ||
| /** | ||
| * Field containing the transport protocol name or number. Used only when the | ||
| * iana_number field is not present. The following protocol names are currently | ||
| * supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp, udp | ||
| * @server-default network.transport | ||
| */ | ||
| transport?: Field | ||
| /** | ||
| * Output field for the community ID. | ||
| * @server-default network.community_id | ||
| */ | ||
| target_field?: Field | ||
| /** | ||
| * Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The | ||
| * seed can prevent hash collisions between network domains, such as a staging | ||
| * and production network that use the same addressing scheme. | ||
| * @server-default 0 | ||
| */ | ||
| seed?: integer | ||
| /** | ||
| * If true and any required fields are missing, the processor quietly exits | ||
| * without modifying the document. | ||
| * @server-default true | ||
| */ | ||
| ignore_missing?: boolean | ||
| } | ||
|
|
||
| export enum ConvertType { | ||
| integer, | ||
| long, | ||
| float, | ||
| double, | ||
| string, | ||
| float, | ||
| boolean, | ||
| ip, | ||
| string, | ||
| auto | ||
| } | ||
|
|
||
|
|
@@ -662,6 +753,12 @@ export class DateProcessor extends ProcessorBase { | |
| * @server_default UTC | ||
| */ | ||
| timezone?: string | ||
| /** | ||
| * The format to use when writing the date to target_field. Must be a valid | ||
| * java time pattern. | ||
| * @server-default yyyy-MM-dd'T'HH:mm:ss.SSSXXX | ||
| */ | ||
| output_format?: string | ||
| } | ||
|
|
||
| export class DissectProcessor extends ProcessorBase { | ||
|
|
@@ -756,6 +853,44 @@ export class FailProcessor extends ProcessorBase { | |
| message: string | ||
| } | ||
|
|
||
| export enum FingerprintDigest { | ||
| md5 = 'MD5', | ||
| sha1 = 'SHA-1', | ||
| sha256 = 'SHA-256', | ||
| sha512 = 'SHA-512', | ||
| murmurHash3 = 'MurmurHash3' | ||
| } | ||
|
|
||
| export class FingerprintProcessor extends ProcessorBase { | ||
| /** | ||
| * Array of fields to include in the fingerprint. For objects, the processor | ||
| * hashes both the field key and value. For other fields, the processor hashes | ||
| * only the field value. | ||
| */ | ||
| fields: Fields | ||
| /** | ||
| * Output field for the fingerprint. | ||
| * @server-default fingerprint | ||
| */ | ||
| target_field?: Field | ||
| /** | ||
| * Salt value for the hash function. | ||
| */ | ||
| salt?: string | ||
| /** | ||
| * The hash method used to compute the fingerprint. Must be one of MD5, SHA-1, | ||
| * SHA-256, SHA-512, or MurmurHash3. | ||
| * @server-default SHA-1 | ||
| */ | ||
| method?: FingerprintDigest | ||
| /** | ||
| * If true, the processor ignores any missing fields. If all fields are | ||
| * missing, the processor silently exits without modifying the document. | ||
| * @server-default false | ||
| */ | ||
| ignore_missing?: boolean | ||
| } | ||
|
|
||
| export class ForeachProcessor extends ProcessorBase { | ||
| /** | ||
| * Field containing array or object values. | ||
|
|
@@ -773,6 +908,12 @@ export class ForeachProcessor extends ProcessorBase { | |
| } | ||
|
|
||
| export class GrokProcessor extends ProcessorBase { | ||
| /** | ||
| * Must be disabled or v1. If v1, the processor uses patterns with Elastic | ||
| * Common Schema (ECS) field names. | ||
| * @server-default disabled | ||
| */ | ||
| ecs_compatibility?: string | ||
| /** | ||
| * The field to use for grok expression parsing. | ||
| */ | ||
|
|
@@ -1046,6 +1187,42 @@ export class LowercaseProcessor extends ProcessorBase { | |
| target_field?: Field | ||
| } | ||
|
|
||
| export class NetworkDirectionProcessor extends ProcessorBase { | ||
| /** | ||
| * Field containing the source IP address. | ||
| * @server-default source.ip | ||
| */ | ||
| source_ip?: Field | ||
| /** | ||
| * Field containing the destination IP address. | ||
| * @server-default destination.ip | ||
| */ | ||
| destination_ip?: Field | ||
| /** | ||
| * Output field for the network direction. | ||
| * @server-default network.direction | ||
| */ | ||
| target_field?: Field | ||
| /** | ||
| * List of internal networks. Supports IPv4 and IPv6 addresses and ranges in | ||
| * CIDR notation. Also supports the named ranges listed below. These may be | ||
| * constructed with template snippets. Must specify only one of | ||
| * internal_networks or internal_networks_field. | ||
| */ | ||
| internal_networks: string[] | ||
| /** | ||
| * A field on the given document to read the internal_networks configuration | ||
| * from. | ||
| */ | ||
| internal_networks_field?: Field | ||
| /** | ||
| * If true and any required fields are missing, the processor quietly exits | ||
| * without modifying the document. | ||
| * @server-default true | ||
| */ | ||
| ignore_missing?: boolean | ||
| } | ||
|
|
||
| export class PipelineProcessor extends ProcessorBase { | ||
| /** | ||
| * The name of the pipeline to execute. | ||
|
|
@@ -1102,6 +1279,25 @@ export class RedactProcessor extends ProcessorBase { | |
| trace_redact?: boolean | ||
| } | ||
|
|
||
| export class RegisteredDomainProcessor extends ProcessorBase { | ||
| /** | ||
| * Field containing the source FQDN. | ||
| */ | ||
| field: Field | ||
| /** | ||
| * Object field containing extracted domain components. If an empty string, | ||
| * the processor adds components to the document’s root. | ||
| * @server-default <empty string> | ||
|
||
| */ | ||
| target_field?: Field | ||
| /** | ||
| * If true and any required fields are missing, the processor quietly exits | ||
| * without modifying the document. | ||
| * @server-default true | ||
| */ | ||
| ignore_missing?: boolean | ||
| } | ||
|
|
||
| export class RemoveProcessor extends ProcessorBase { | ||
| /** | ||
| * Fields to be removed. Supports template snippets. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the one field that is almost an IP address where would could use the
Ip[]type. But that would be inaccurate because the values can be a IP or a CIDR. Should I create a type alias for CIDR somewhere such that the type can be(Ip | CIDR)[]?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refresh my memory. Is
xxx.xxx.xxx.xxxwithout a slash a valid CIDR notation that defaults to/32?In any way, I think it's fine keeping just
string[]in this case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's how the processor is behaving for ipv4. I didn't check it, but for ipv6 I would expect similar behavior just using /128 to indicate that it's matching one address.