public static class DetectNat.UserAgentBased extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<Event>,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<String,Boolean>>>
Currently this transform only operates on normalized Normalized.Type.HTTP_REQUEST
events and is based on the detection of
multiple user agents being identified for requests within the window for the same source IP
address.
The output from the transform is a PCollection
of KV pairs where the key is a source
IP address identified in the window and the value is a boolean set to true if there is a
possibility the source address is a NAT gateway. If it is not suspected the source address is a
NAT gateway, it will not be included in the output set.
Modifier and Type | Method and Description |
---|---|
org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<String,Boolean>> |
expand(org.apache.beam.sdk.values.PCollection<Event> events) |
DetectNat.UserAgentBased |
withKnownGateways(Map<String,Boolean> knownGateways)
Returns a
UserAgentBased PTransform like this one but with a map of ip
addresses that are known already to be gateways. |
DetectNat.UserAgentBased |
withKnownGateways(String path)
Returns a
UserAgentBased PTransform like this one but with a list of known
gateways that are parsed from a file. |
public org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<String,Boolean>> expand(org.apache.beam.sdk.values.PCollection<Event> events)
public DetectNat.UserAgentBased withKnownGateways(String path)
UserAgentBased
PTransform
like this one but with a list of known
gateways that are parsed from a file. The file should contain an ip per line.path
- Path to load inital gateway list fromUserAgentBased
PTransform
public DetectNat.UserAgentBased withKnownGateways(Map<String,Boolean> knownGateways)
UserAgentBased
PTransform
like this one but with a map of ip
addresses that are known already to be gateways.knownGateways
- map containing known gateway ips as keys and True as the valueUserAgentBased
PTransform
Copyright © 2022. All rights reserved.