analyzers

package
v3.83.6 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	READ       PermissionType = "Read"
	WRITE      PermissionType = "Write"
	READ_WRITE PermissionType = "Read & Write"
	NONE       PermissionType = "None"
	ERROR      PermissionType = "Error"

	FullAccess string = "full_access"
)

Variables

View Source
var DefaultWriter = color.New().SprintFunc()
View Source
var GreenWriter = color.New(color.FgGreen).SprintFunc()
View Source
var RedWriter = color.New(color.FgRed).SprintFunc()
View Source
var YellowWriter = color.New(color.FgYellow).SprintFunc()

Functions

func AvailableAnalyzers added in v3.81.6

func AvailableAnalyzers() []string

GetSortedAnalyzerTypes returns a sorted slice of AnalyzerType strings, skipping "Invalid".

func CreateLogFileName

func CreateLogFileName(baseName string) string

func GetWriterFromStatus

func GetWriterFromStatus(status PermissionType) func(a ...interface{}) string

func NewAnalyzeClient

func NewAnalyzeClient(cfg *config.Config) *http.Client

func StatusContains

func StatusContains(status int, vals []int) bool

Types

type AnalyzeClient

type AnalyzeClient struct {
	http.Client
	LoggingEnabled bool
	LogFile        string
}

type Analyzer

type Analyzer interface {
	Type() AnalyzerType
	Analyze(ctx context.Context, credentialInfo map[string]string) (*AnalyzerResult, error)
}

type AnalyzerResult

type AnalyzerResult struct {
	AnalyzerType       AnalyzerType
	Bindings           []Binding
	UnboundedResources []Resource
	Metadata           map[string]any
}

AnalyzerResult is the output of analysis.

type AnalyzerRoundTripper added in v3.82.3

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

func (AnalyzerRoundTripper) RoundTrip added in v3.82.3

func (r AnalyzerRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type AnalyzerType added in v3.82.12

type AnalyzerType int
const (
	AnalyzerTypeInvalid AnalyzerType = iota
	AnalyzerTypeAirbrake
	AnalyzerTypeAsana
	AnalyzerTypeBitbucket
	AnalyzerTypeGitHub
	AnalyzerTypeGitLab
	AnalyzerTypeHuggingFace
	AnalyzerTypeMailchimp
	AnalyzerTypeMailgun
	AnalyzerTypeMySQL
	AnalyzerTypeOpenAI
	AnalyzerTypeOpsgenie
	AnalyzerTypePostgres
	AnalyzerTypePostman
	AnalyzerTypeSendgrid
	AnalyzerTypeShopify
	AnalyzerTypeSlack
	AnalyzerTypeSourcegraph
	AnalyzerTypeSquare
	AnalyzerTypeStripe
	AnalyzerTypeTwilio
)

func (AnalyzerType) String added in v3.82.12

func (a AnalyzerType) String() string

String method to get the string representation of an AnalyzerType.

type Binding

type Binding struct {
	Resource   Resource
	Permission Permission
}

func BindAllPermissions added in v3.80.3

func BindAllPermissions(r Resource, perms ...Permission) []Binding

BindAllPermissions creates a Binding for each permission to the given resource.

type HttpStatusTest

type HttpStatusTest struct {
	URL     string
	Method  string
	Payload map[string]interface{}
	Params  map[string]string
	Valid   []int
	Invalid []int
	Type    PermissionType
	Status  PermissionStatus
	Risk    string
}

func (*HttpStatusTest) RunTest

func (h *HttpStatusTest) RunTest(headers map[string]string) error

type LoggingRoundTripper

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

func (LoggingRoundTripper) RoundTrip

func (r LoggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type Permission

type Permission struct {
	Value  string
	Parent *Permission
}

type PermissionStatus

type PermissionStatus struct {
	Value   bool
	IsError bool
}

type PermissionType

type PermissionType string

type Resource

type Resource struct {
	Name               string
	FullyQualifiedName string
	Type               string
	Metadata           map[string]any
	Parent             *Resource
}

type Scope

type Scope struct {
	Name  string
	Tests []interface{}
}

Directories

Path Synopsis
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
classic
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
finegrained
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.

Jump to

Keyboard shortcuts

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