Documentation
¶
Index ¶
Constants ¶
View Source
const ( AuthTypeIAM = "IAM" AuthTypeSASL_SCRAM = "SASL_SCRAM" AuthTypeTLS = "TLS" AuthTypeUNAUTHENTICATED = "UNAUTHENTICATED" AuthTypeUNKNOWN = "UNKNOWN" )
Variables ¶
View Source
var ( ErrorUnableToParseKafkaApiLine = errors.New("unable to parse Kafka API line") ErrorUnableToParseTimestamp = errors.New("unable to parse timestamp") ErrorUnsupportedLogLine = errors.New("unsupported log line") )
View Source
var ( TimestampPattern = regexp.MustCompile(`^\[([^\]]+)\]`) ApiKeyPattern = regexp.MustCompile(`apiKey=([^,\)]+)`) ClientIdPattern = regexp.MustCompile(`clientId=([^,\)]+)`) BrokerFetcherPattern = regexp.MustCompile(`broker-(\d+)-fetcher-(\d+)`) ProducerTopicPattern = regexp.MustCompile(`partitionSizes=\[(.+)-\d+=`) ConsumerTopicPattern = regexp.MustCompile(`FetchTopic\(topic='([^']+)'`) // IAM-specific pattern to extract ARN IAMPrincipalArnPattern = regexp.MustCompile(`principal:\[IAM\]:\[(arn:aws:[^\]]+)\]:`) // SASL_SCRAM-specific pattern to extract User:username SASLSCRAMPrincipalPattern = regexp.MustCompile(`principal:(User:[^ ]+)`) // TLS pattern - extract User:CN= and any additional certificate info (requires SSL protocol) TLSPrincipalPattern = regexp.MustCompile(`securityProtocol:SSL,principal:(User:CN=[^(]+?)\s*\(`) // Anonymous pattern - detect unauthenticated requests with User:ANONYMOUS AnonymousPrincipalPattern = regexp.MustCompile(`principal:(User:ANONYMOUS)`) )
View Source
var ( // lines that match this pattern will be parsed by kafka trace line parser KafkaApiTracePattern = regexp.MustCompile(`^\[.*\] TRACE \[KafkaApi-\d+\].*\(kafka\.server\.KafkaApis\)$`) )
Functions ¶
Types ¶
type ClientInventoryScanner ¶
type ClientInventoryScanner struct {
// contains filtered or unexported fields
}
func NewClientInventoryScanner ¶
func NewClientInventoryScanner(s3Service S3Service, opts ClientInventoryScannerOpts) (*ClientInventoryScanner, error)
func (*ClientInventoryScanner) Run ¶
func (cis *ClientInventoryScanner) Run() error
type KafkaApiTraceLineParser ¶
type KafkaApiTraceLineParser struct{}
func (*KafkaApiTraceLineParser) Parse ¶
func (p *KafkaApiTraceLineParser) Parse(line string, lineNumber int, fileName string) (*RequestMetadata, error)
type RequestMetadata ¶
Click to show internal directories.
Click to hide internal directories.