public class DetectNat extends Object
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 | Class and Description |
---|---|
static class |
DetectNat.UserAgentBased
Provides a basic NAT detection transform
|
Constructor and Description |
---|
DetectNat() |
Modifier and Type | Method and Description |
---|---|
static DetectNat.UserAgentBased |
byUserAgent()
Creates a User Agent Based Nat Detection transform
|
static org.apache.beam.sdk.values.PCollectionView<Map<String,Boolean>> |
getEmptyView(org.apache.beam.sdk.Pipeline p)
Return an empty NAT view, suitable as a placeholder if NAT detection is not desired
|
static org.apache.beam.sdk.values.PCollectionView<Map<String,Boolean>> |
getView(org.apache.beam.sdk.values.PCollection<Event> events,
String knownGatewaysPath)
Execute nat detection transforms returning a
PCollectionView suitable for use as a side
input, currently only User Agent Based |
static Map<String,Boolean> |
loadGatewayList(String path)
Load detect nat manager configuration from a resource file
|
public static org.apache.beam.sdk.values.PCollectionView<Map<String,Boolean>> getEmptyView(org.apache.beam.sdk.Pipeline p)
p
- Pipeline to create view forPCollectionView
public static org.apache.beam.sdk.values.PCollectionView<Map<String,Boolean>> getView(org.apache.beam.sdk.values.PCollection<Event> events, String knownGatewaysPath)
PCollectionView
suitable for use as a side
input, currently only User Agent Basedevents
- Input eventsknownGatewaysPath
- path to file with known gateway ip addressesPCollectionView
representing output of analysispublic static DetectNat.UserAgentBased byUserAgent()
UserAgentBased
PTransform
Copyright © 2022. All rights reserved.