audit

package
v0.0.0-...-a31436a Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBOpen

func DBOpen(c *Config) (*sql.DB, error)

DBOpen opens the db connection

func GetConfig

func GetConfig(c *Config) error

GetConfig pulls config info from audit.yml and command line input

func ParseCLIOverrides

func ParseCLIOverrides(c *Config) error

ParseCLI Overrides parses CLI override flags

func ParseFlags

func ParseFlags(c *Config) error

ParseFlags parses command line flags for configration from command line input

func ParseTableName

func ParseTableName(tableName string) ([]string, error)

func RunAll

func RunAll(db *sql.DB, config *Config) error

RunAll makes a list of all of the db's tables, marks which tables to exclude based on the config, then loops over all the tables and sets up auditting for each table

Types

type Config

type Config struct {
	CfgPath         string
	Host            string   `yaml:"host"`
	Port            string   `yaml:"port"`
	DBName          string   `yaml:"db_name"`
	DBUser          string   `yaml:"username"`
	DBPassword      string   `yaml:"password"`
	SSLMode         string   `yaml:"ssl_mode"`
	ExcludedTables  []string `yaml:"excluded_tables"`
	ExcludedSchemas []string `yaml:"excluded_schemas"`
	IncludedTables  []string `yaml:"included_tables"`
	Security        string   `yaml:"security"`
	LogClientQuery  bool     `yaml:"log_client_query"`
	Owner           string   `yaml:"owner"`
	ViewsOnly       bool     `yaml:"views_only"`
	Grantee         string   `yaml:"grantee"`
	OwnerRole       string   `yaml:"set_role"`
	LockTimeout     string   `yaml:"lock_timeout"`
	JSONType        string
}

Config ...

Jump to

Keyboard shortcuts

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