analyzers

package
v3.82.6 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 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 AvailableAnalyzers = []string{
	"Airbrake",
	"Asana",
	"Bitbucket",
	"GitHub",
	"GitLab",
	"HuggingFace",
	"Mailchimp",
	"Mailgun",
	"MySQL",
	"OpenAI",
	"Opsgenie",
	"Postgres",
	"Postman",
	"Sendgrid",
	"Shopify",
	"Slack",
	"Sourcegraph",
	"Square",
	"Stripe",
	"Twilio",
}

Sorted list of all available analyzers. Used for valid sub-commands and TUI selection. TODO: Change slice type to Analyzer interface when all available analyzers implement it.

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 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() analyzerpb.AnalyzerType
	Analyze(ctx context.Context, credentialInfo map[string]string) (*AnalyzerResult, error)
}

type AnalyzerResult

type AnalyzerResult struct {
	AnalyzerType       analyzerpb.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 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.

Jump to

Keyboard shortcuts

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