auditor

package
v0.0.0-...-a323bfd Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReportKeyvaultAccessPolicies   = "KeyvaultAccessPolicy"
	ReportResourceProviders        = "ResourceProvider"
	ReportResourceProviderFeatures = "ResourceProviderFeature"
	ReportResourceGroups           = "ResourceGroup"
	ReportRoleAssignments          = "RoleAssignment"
	ReportResourceGraph            = "ResourceGraph:%v"
	ReportLogAnalytics             = "LogAnalytics:%v"
)
View Source
const (
	OperationInsightsWorkspaceUrlSuffix = "/v1"
)
View Source
const (
	ResourceGraphQueryOptionsTop = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditConfiLogAnalytics

type AuditConfiLogAnalytics struct {
	Enabled bool                                        `yaml:"enabled"`
	Queries map[string]*validator.AuditConfigValidation `yaml:"queries"`
}

func (*AuditConfiLogAnalytics) IsEnabled

func (config *AuditConfiLogAnalytics) IsEnabled() bool

type AuditConfig

type AuditConfig struct {
	RoleAssignments          *validator.AuditConfigValidation `yaml:"roleAssignments"`
	ResourceGroups           *validator.AuditConfigValidation `yaml:"resourceGroups"`
	ResourceProviders        *validator.AuditConfigValidation `yaml:"resourceProviders"`
	ResourceProviderFeatures *validator.AuditConfigValidation `yaml:"resourceProviderFeatures"`
	KeyvaultAccessPolicies   *validator.AuditConfigValidation `yaml:"keyvaultAccessPolicies"`
	ResourceGraph            *AuditConfigResourceGraph        `yaml:"resourceGraph"`
	LogAnalytics             *AuditConfiLogAnalytics          `yaml:"logAnalytics"`
}

type AuditConfigResourceGraph

type AuditConfigResourceGraph struct {
	Enabled bool                                        `yaml:"enabled"`
	Queries map[string]*validator.AuditConfigValidation `yaml:"queries"`
}

func (*AuditConfigResourceGraph) IsEnabled

func (config *AuditConfigResourceGraph) IsEnabled() bool

type AzureAuditor

type AzureAuditor struct {
	UserAgent string
	Opts      config.Opts

	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewAzureAuditor

func NewAzureAuditor() *AzureAuditor

func (*AzureAuditor) GetConfig

func (auditor *AzureAuditor) GetConfig() AuditConfig

func (*AzureAuditor) GetReport

func (auditor *AzureAuditor) GetReport() map[string]*AzureAuditorReport

func (*AzureAuditor) Init

func (auditor *AzureAuditor) Init()

func (*AzureAuditor) MetricsLock

func (auditor *AzureAuditor) MetricsLock() *sync.RWMutex

func (*AzureAuditor) ParseConfig

func (auditor *AzureAuditor) ParseConfig(configPaths ...string)

func (*AzureAuditor) ReportLock

func (auditor *AzureAuditor) ReportLock() *sync.RWMutex

func (*AzureAuditor) Run

func (auditor *AzureAuditor) Run()

type AzureAuditorReport

type AzureAuditorReport struct {
	Summary    *AzureAuditorReportSummary
	Lines      []*AzureAuditorReportLine
	UpdateTime *time.Time
	// contains filtered or unexported fields
}

func NewAzureAuditorReport

func NewAzureAuditorReport() *AzureAuditorReport

func (*AzureAuditorReport) Add

func (report *AzureAuditorReport) Add(resource *validator.AzureObject, ruleID string, status types.RuleStatus)

func (*AzureAuditorReport) Clear

func (report *AzureAuditorReport) Clear()

type AzureAuditorReportLine

type AzureAuditorReportLine struct {
	Resource map[string]interface{} `json:"resource"`
	RuleID   string                 `json:"rule"`
	GroupBy  interface{}            `json:"groupBy"`
	Status   string                 `json:"status"`
	Count    uint64                 `json:"count"`
}

func (*AzureAuditorReportLine) Hash

func (reportLine *AzureAuditorReportLine) Hash() [20]byte

func (*AzureAuditorReportLine) MarshalJSON

func (reportLine *AzureAuditorReportLine) MarshalJSON() ([]byte, error)

type AzureAuditorReportSummary

type AzureAuditorReportSummary struct {
	Ignore int64
	Deny   int64
	Allow  int64
}

type LogAnaltyicsQueryResult

type LogAnaltyicsQueryResult struct {
	Tables *[]struct {
		Name    string `json:"name"`
		Columns *[]struct {
			Name *string `json:"name"`
			Type *string `json:"type"`
		} `json:"columns"`
		Rows *[][]interface{} `json:"rows"`
	} `json:"tables"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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