loggers

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2021 Juan Pablo Tosso

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLog

type AuditLog struct {
	// Transaction information
	Transaction *AuditTransaction `json:"transaction"`

	// Triggered rules information
	Messages []*AuditMessage `json:"messages"`
}

Main struct for audit log data

func (*AuditLog) JSON

func (al *AuditLog) JSON() ([]byte, error)

type AuditMessage

type AuditMessage struct {
	Actionset string            `json:"actionset"`
	Message   string            `json:"message"`
	Data      *AuditMessageData `json:"data"`
}

type AuditMessageData

type AuditMessageData struct {
	File     string   `json:"file"`
	Line     int      `json:"line"`
	Id       int      `json:"id"`
	Rev      string   `json:"rev"`
	Msg      string   `json:"msg"`
	Data     string   `json:"data"`
	Severity int      `json:"severity"`
	Ver      string   `json:"ver"`
	Maturity int      `json:"maturity"`
	Accuracy int      `json:"accuracy"`
	Tags     []string `json:"tags"`
}

type AuditTransaction

type AuditTransaction struct {
	// Timestamp "02/Jan/2006:15:04:20 -0700" format
	Timestamp     string `json:"timestamp"`
	UnixTimestamp int64  `json:"unix_timestamp"`

	// Unique ID
	Id string `json:"id"`

	// Client IP Address string representation
	ClientIp string `json:"client_ip"`

	ClientPort int                       `json:"client_port"`
	HostIp     string                    `json:"host_ip"`
	HostPort   int                       `json:"host_port"`
	ServerId   string                    `json:"server_id"`
	Request    *AuditTransactionRequest  `json:"request"`
	Response   *AuditTransactionResponse `json:"response"`
	Producer   *AuditTransactionProducer `json:"producer"`
}

Transaction information

type AuditTransactionProducer

type AuditTransactionProducer struct {
	Connector  string   `json:"connector"`
	Version    string   `json:"version"`
	Server     string   `json:"server"`
	RuleEngine string   `json:"rule_engine"`
	Stopwatch  string   `json:"stopwatch"`
	Rulesets   []string `json:"rulesets"`
}

type AuditTransactionRequest

type AuditTransactionRequest struct {
	Method      string                          `json:"method"`
	Protocol    string                          `json:"protocol"`
	Uri         string                          `json:"uri"`
	HttpVersion string                          `json:"http_version"`
	Headers     map[string][]string             `json:"headers"`
	Body        string                          `json:"body"`
	Files       []*AuditTransactionRequestFiles `json:"files"`
}

type AuditTransactionRequestFiles

type AuditTransactionRequestFiles struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
	Mime string `json:"mime"`
}

type AuditTransactionResponse

type AuditTransactionResponse struct {
	Status  int                 `json:"status"`
	Headers map[string][]string `json:"headers"`
	Body    string              `json:"body"`
}

type ConcurrentLogger

type ConcurrentLogger struct {
	// contains filtered or unexported fields
}

func (*ConcurrentLogger) Close

func (cl *ConcurrentLogger) Close() error

func (*ConcurrentLogger) New

func (l *ConcurrentLogger) New(args map[string]string) error

func (*ConcurrentLogger) Write

func (l *ConcurrentLogger) Write(al *AuditLog) error

type Logger

type Logger interface {
	New(map[string]string) error
	Write(*AuditLog) error
	Close() error
}

type SerialLogger

type SerialLogger struct {
	// contains filtered or unexported fields
}

SerialLogger is used to store logs compatible with go-FTW

func (*SerialLogger) Close

func (sl *SerialLogger) Close() error

func (*SerialLogger) New

func (sl *SerialLogger) New(args map[string]string) error

func (*SerialLogger) Write

func (sl *SerialLogger) Write(al *AuditLog) error

type SyslogLogger

type SyslogLogger struct {
	// contains filtered or unexported fields
}

func (*SyslogLogger) Close

func (sl *SyslogLogger) Close() error

func (*SyslogLogger) New

func (sl *SyslogLogger) New(args map[string]string) error

func (*SyslogLogger) Write

func (sl *SyslogLogger) Write(al *AuditLog) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL