models

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PriorityUrgent     string = "URGENT"
	PriorityImportant  string = "IMPORTANT"
	PriorityMedium     string = "MEDIUM"
	PriorityLow        string = "LOW"
	PriorityNegligible string = "NEGLIGIBLE"
)
View Source
const (
	ScheduledNotificationTopicTypeAll          = "all"
	ScheduledNotificationTopicTypeCode         = "code"
	ScheduledNotificationTopicTypeIaC          = "iac"
	ScheduledNotificationTopicTypeDependencies = "dependencies"
	ScheduledNotificationTopicTypeSecrets      = "secrets"
	ScheduledNotificationTopicTypeDAST         = "dast"
)
View Source
const (
	SeverityCritical = "CRITICAL"
	SeverityHigh     = "HIGH"
	SeverityMedium   = "MEDIUM"
	SeverityLow      = "LOW"
	SeverityUnknown  = "UNKNOWN"
)

Variables

This section is empty.

Functions

func Bool added in v1.31.0

func Bool(b bool) *bool

func Float32 added in v1.31.0

func Float32(f float32) *float32

func Float64 added in v1.31.0

func Float64(f float64) *float64

func Int added in v1.23.0

func Int(i int) *int

func String added in v1.31.0

func String(s string) *string

Types

type Assignee added in v1.28.0

type Assignee struct {
	Name string `yaml:"name,omitempty"`
	ID   string `yaml:"id,omitempty"`
}

type AttackSurface added in v1.36.0

type AttackSurface struct {
	// global only
	EnableDNSTraversal bool     `yaml:"enable_dns_traversal,omitempty"`
	DomainNames        []string `yaml:"domain_names,omitempty"`
	IgnoreDomainNames  []string `yaml:"ignore_domain_names,omitempty"`
}

type AutoFix added in v1.22.0

type AutoFix struct {
	Enabled                    bool                            `yaml:"enabled,omitempty"`
	MaxPullRequestsOpen        *int                            `yaml:"max_pull_requests_open,omitempty"`
	MaxPullRequestCreationRate *AutoFixPullRequestCreationRate `yaml:"max_pull_request_creation_rate,omitempty"`
	Labels                     []string                        `yaml:"labels,omitempty"`
}

type AutoFixPullRequestCreationRate added in v1.22.0

type AutoFixPullRequestCreationRate struct {
	Count int `yaml:"count,omitempty"`
	Days  int `yaml:"days,omitempty"`
}

type Code added in v1.12.0

type Code struct {
	EnableFailBuilds *bool        `yaml:"enable_fail_builds,omitempty"`
	AutoFix          *AutoFix     `yaml:"auto_fix,omitempty"`
	Ignore           []CodeIgnore `yaml:"ignore,omitempty"`
}

type CodeIgnore added in v1.12.0

type CodeIgnore struct {
	Reason string `yaml:"reason,omitempty"`
	Expiry string `yaml:"expiry,omitempty"`

	// matchers
	CWEs    []int    `yaml:"cwes,omitempty"`
	RuleIDs []string `yaml:"rule_ids,omitempty"`
	Dirs    []string `yaml:"dirs,omitempty"`
	Paths   []string `yaml:"paths,omitempty"`

	// global config only
	Repositories []string `yaml:"repositories,omitempty"`
}

type Configuration

type Configuration struct {
	// git platform options
	EnableFailBuilds         *bool `yaml:"enable_fail_builds,omitempty"`
	EnablePullRequestReviews *bool `yaml:"enable_pull_request_reviews,omitempty"`
	EnableIssueDashboards    *bool `yaml:"enable_issue_dashboards,omitempty"`

	SeverityThreshold string `yaml:"severity_threshold,omitempty"`
	PriorityThreshold string `yaml:"priority_threshold,omitempty"`

	IgnoreDirs  []string `yaml:"ignore_dirs,omitempty"`
	IgnorePaths []string `yaml:"ignore_paths,omitempty"`
	AutoFix     *AutoFix `yaml:"auto_fix,omitempty"`

	Notifications          map[string]Notification          `yaml:"notifications,omitempty"`
	ScheduledNotifications map[string]ScheduledNotification `yaml:"scheduled_notifications,omitempty"`
	Integrations           Integrations                     `yaml:"integrations,omitempty"`

	// features
	Code          Code          `yaml:"code,omitempty"`
	Dependencies  Dependencies  `yaml:"dependencies,omitempty"`
	Secrets       Secrets       `yaml:"secrets,omitempty"`
	AttackSurface AttackSurface `yaml:"attack_surface,omitempty"`

	// TODO deprecate
	SecretsWhitelist []string `yaml:"secrets_whitelist,omitempty"`
}

func (*Configuration) GetEnableFailBuilds added in v1.35.0

func (c *Configuration) GetEnableFailBuilds() bool

func (*Configuration) GetEnableIssueDashboards added in v1.35.0

func (c *Configuration) GetEnableIssueDashboards() bool

func (*Configuration) GetEnablePullRequestReviews added in v1.35.0

func (c *Configuration) GetEnablePullRequestReviews() bool

type Dependencies added in v1.10.0

type Dependencies struct {
	EnableFailBuilds *bool                `yaml:"enable_fail_builds,omitempty"`
	AutoFix          *AutoFix             `yaml:"auto_fix,omitempty"`
	Ignore           []DependenciesIgnore `yaml:"ignore,omitempty"`
}

type DependenciesIgnore added in v1.10.0

type DependenciesIgnore struct {
	Reason string `yaml:"reason,omitempty"`
	Expiry string `yaml:"expiry,omitempty"`

	// matchers
	CVEs  []string `yaml:"cves,omitempty"`
	Dirs  []string `yaml:"dirs,omitempty"`
	Paths []string `yaml:"paths,omitempty"`

	// global config only
	Repositories []string `yaml:"repositories,omitempty"`
}

type Integrations added in v1.26.0

type Integrations struct {
	Jira *Jira `yaml:"jira,omitempty"`
}

type Jira added in v1.26.0

type Jira struct {
	Disabled          bool        `yaml:"disabled,omitempty"`
	ProjectKey        string      `yaml:"project_key,omitempty"`
	IssueType         string      `yaml:"issue_type,omitempty"`
	SeverityThreshold string      `yaml:"severity_threshold,omitempty"`
	PriorityThreshold string      `yaml:"priority_threshold,omitempty"`
	OnFixTransition   string      `yaml:"on_fix_transition,omitempty"`
	Priorities        *Priorities `yaml:"priorities,omitempty"`
	Assignee          *Assignee   `yaml:"assignee,omitempty"`
}

type Notification added in v1.9.0

type Notification struct {
	Events  NotificationEvents  `yaml:"events,omitempty"`
	Targets NotificationTargets `yaml:"targets,omitempty"`

	// global config only
	Repositories []string `yaml:"repositories,omitempty"`
}

type NotificationEventAll added in v1.9.0

type NotificationEventAll struct {
	MinimumSeverity string   `yaml:"minimum_severity,omitempty"`
	MinimumPriority int      `yaml:"minimum_priority,omitempty"`
	CWEs            []int    `yaml:"cwes,omitempty"`
	CVEs            []string `yaml:"cves,omitempty"`
	SecretTypes     []string `yaml:"secret_types,omitempty"`
}

type NotificationEventNewAPIFindings added in v1.9.0

type NotificationEventNewAPIFindings struct {
	MinimumSeverity string `yaml:"minimum_severity,omitempty"`
	MinimumPriority int    `yaml:"minimum_priority,omitempty"`
	CWEs            []int  `yaml:"cwes,omitempty"`
}

type NotificationEventNewCodeFindings added in v1.9.0

type NotificationEventNewCodeFindings struct {
	MinimumSeverity string `yaml:"minimum_severity,omitempty"`
	MinimumPriority int    `yaml:"minimum_priority,omitempty"`
	CWEs            []int  `yaml:"cwes,omitempty"`
}

type NotificationEventNewDependencyFindings added in v1.9.0

type NotificationEventNewDependencyFindings struct {
	MinimumSeverity string   `yaml:"minimum_severity,omitempty"`
	MinimumPriority int      `yaml:"minimum_priority,omitempty"`
	CWEs            []int    `yaml:"cwes,omitempty"`
	CVEs            []string `yaml:"cves,omitempty"`
}

type NotificationEventNewSecretFindings added in v1.9.0

type NotificationEventNewSecretFindings struct {
	Types []string `yaml:"types,omitempty"`
}

type NotificationEvents added in v1.9.0

type NotificationEvents struct {
	All                   *NotificationEventAll                   `yaml:"all,omitempty"`
	NewAPIFindings        *NotificationEventNewAPIFindings        `yaml:"new_api_findings,omitempty"`
	NewCodeFindings       *NotificationEventNewCodeFindings       `yaml:"new_code_findings,omitempty"`
	NewDependencyFindings *NotificationEventNewDependencyFindings `yaml:"new_dependency_findings,omitempty"`
	NewSecretFindings     *NotificationEventNewSecretFindings     `yaml:"new_secret_findings,omitempty"`
}

type NotificationTargetEmail added in v1.9.0

type NotificationTargetEmail struct {
	Address   string   `yaml:"address,omitempty"`
	Addresses []string `yaml:"addresses,omitempty"`
}

type NotificationTargetSlack added in v1.9.0

type NotificationTargetSlack struct {
	Channel  string   `yaml:"channel,omitempty"`
	Channels []string `yaml:"channels,omitempty"`
}

type NotificationTargetWebhook added in v1.9.0

type NotificationTargetWebhook struct {
	URLs []string `yaml:"urls,omitempty"`
	URL  string   `yaml:"url,omitempty"`
}

type NotificationTargets added in v1.9.0

type NotificationTargets struct {
	Webhook *NotificationTargetWebhook `yaml:"webhook,omitempty"`
	Email   *NotificationTargetEmail   `yaml:"email,omitempty"`
	Slack   *NotificationTargetSlack   `yaml:"slack,omitempty"`
}

type Priorities added in v1.27.0

type Priorities struct {
	Critical   string `yaml:"critical,omitempty"`
	High       string `yaml:"high,omitempty"`
	Medium     string `yaml:"medium,omitempty"`
	Low        string `yaml:"low,omitempty"`
	Urgent     string `yaml:"urgent,omitempty"`
	Important  string `yaml:"important,omitempty"`
	Negligible string `yaml:"negligible,omitempty"`
}

Mapping of Nullify Finding severities to Jira Priorities. The user can specify the priority of the issue based on the severity.

type ScheduledNotification added in v1.10.0

type ScheduledNotification struct {
	Schedule string                       `yaml:"schedule,omitempty"`
	Timezone string                       `yaml:"timezone,omitempty"`
	Topics   ScheduledNotificationTopics  `yaml:"topics,omitempty"`
	Targets  ScheduledNotificationTargets `yaml:"targets,omitempty"`

	// global config only
	Repositories []string `yaml:"repositories,omitempty"`
}

type ScheduledNotificationTargetEmail added in v1.10.0

type ScheduledNotificationTargetEmail struct {
	Address   string   `yaml:"address,omitempty"`
	Addresses []string `yaml:"addresses,omitempty"`
}

type ScheduledNotificationTargetSlack added in v1.10.0

type ScheduledNotificationTargetSlack struct {
	Channel  string   `yaml:"channel,omitempty"`
	Channels []string `yaml:"channels,omitempty"`
}

type ScheduledNotificationTargets added in v1.10.0

type ScheduledNotificationTargets struct {
	Email *ScheduledNotificationTargetEmail `yaml:"email,omitempty"`
	Slack *ScheduledNotificationTargetSlack `yaml:"slack,omitempty"`
}

type ScheduledNotificationTopics added in v1.10.0

type ScheduledNotificationTopics struct {
	All             bool `yaml:"all,omitempty"`
	AllNewFindings  bool `yaml:"all_new_findings,omitempty"`
	NewAPIFindings  bool `yaml:"new_api_findings,omitempty"`
	NewCodeFindings bool `yaml:"new_code_findings,omitempty"`
	NewCVEs         bool `yaml:"new_cves,omitempty"`
	NewSecrets      bool `yaml:"new_secrets,omitempty"`
}

type Secrets added in v1.11.0

type Secrets struct {
	EnableFailBuilds             *bool                           `yaml:"enable_fail_builds,omitempty"`
	Ignore                       []SecretsIgnore                 `yaml:"ignore,omitempty"`
	CustomPatterns               map[string]SecretsCustomPattern `yaml:"custom_patterns,omitempty"`
	CustomPatternsOverrideGlobal bool                            `yaml:"custom_patterns_override_global,omitempty"`
}

type SecretsCustomPattern added in v1.31.0

type SecretsCustomPattern struct {
	Description      *string  `yaml:"description,omitempty"`
	SecretRegex      string   `yaml:"secret_regex,omitempty"`
	SecretRegexGroup *int     `yaml:"secret_regex_group,omitempty"`
	Entropy          *float32 `yaml:"entropy,omitempty"`
	PathRegex        *string  `yaml:"path_regex,omitempty"`
	Keywords         []string `yaml:"keywords,omitempty"`
}

type SecretsIgnore added in v1.11.0

type SecretsIgnore struct {
	Reason string `yaml:"reason,omitempty"`
	Expiry string `yaml:"expiry,omitempty"`

	// matchers
	Value   string `yaml:"value,omitempty"`
	Pattern string `yaml:"pattern,omitempty"`
	SHA256  string `yaml:"sha256,omitempty"`

	// global config only
	Repositories []string `yaml:"repositories,omitempty"`
}

Jump to

Keyboard shortcuts

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