Documentation
¶
Index ¶
- Constants
- func IsConflict(err error) bool
- func IsNotFound(err error) bool
- func IsNotModified(err error) bool
- func IsUnauthorized(err error) bool
- type AdminUser
- type AdminUsers
- type Alias
- type Analysis
- type AnalysisComment
- type AnalysisRequest
- type ApiKey
- type BomSubmitRequest
- type Client
- type Component
- type ConfigProperty
- type Finding
- type NewUser
- type Option
- func WithApiKeySource(team string) Option
- func WithAuthSource(authSource auth.Auth) Option
- func WithHttpClient(client *http.Client) Option
- func WithLogger(log *log.Entry) Option
- func WithResponseCallback(callback func(res *http.Response, err error)) Option
- func WithRetry(maxRetries int, retryDelay time.Duration) Option
- type Options
- type Permission
- type Project
- type ProjectMetric
- type Tag
- type TagPrefix
- type Tags
- type Team
- type User
- type Vulnerability
- type VulnzAnalysis
Constants ¶
View Source
const ( AccessManagementPermission = Permission("ACCESS_MANAGEMENT") PolicyManagementPermission = Permission("POLICY_MANAGEMENT") PolicyViolationAnalysisPermission = Permission("POLICY_VIOLATION_ANALYSIS") SystemConfigurationPermission = Permission("SYSTEM_CONFIGURATION") ViewPolicyViolationPermission = Permission("VIEW_POLICY_VIOLATION") ViewPortfolioPermission = Permission("VIEW_PORTFOLIO") ViewVulnerabilityPermission = Permission("VIEW_VULNERABILITY") WorkloadTagPrefix = TagPrefix("workload:") EnvironmentTagPrefix = TagPrefix("env:") TeamTagPrefix = TagPrefix("team:") ProjectTagPrefix = TagPrefix("project:") ImageTagPrefix = TagPrefix("image:") VersionTagPrefix = TagPrefix("version:") RekorTagPrefix = TagPrefix("rekor:") DigestTagPrefix = TagPrefix("digest:") RekorIDTagPrefix = TagPrefix("rekor-id:") RekorBuildTriggerTagPrefix = TagPrefix("build-trigger:") RekorBuildConfigURITagPrefix = TagPrefix("build-config-uri:") RekorGitHubWorkflowNameTagPrefix = TagPrefix("workflow-name:") RekorGitHubWorkflowRefTagPrefix = TagPrefix("workflow-ref:") RekorOIDCIssuerTagPrefix = TagPrefix("oidc-issuer:") RekorRunInvocationURITagPrefix = TagPrefix("run-invocation-uri:") RekorRunnerEnvironmentTagPrefix = TagPrefix("runner-env:") RekorSourceRepositoryOwnerURITagPrefix = TagPrefix("source-repo-owner-uri:") RekorIntegratedTimeTagPrefix = TagPrefix("integrated-time:") RekorGitHubWorkflowSHATagPrefix = TagPrefix("workflow-sha:") )
View Source
const EmailPostfix = "@nais.io"
Variables ¶
This section is empty.
Functions ¶
func IsConflict ¶
func IsNotFound ¶
func IsNotModified ¶
func IsUnauthorized ¶
Types ¶
type AdminUsers ¶
type AdminUsers struct {
Users []AdminUser `json:"users,omitempty" yaml:"users,omitempty"`
}
type Analysis ¶
type Analysis struct {
AnalysisState string `json:"analysisState"`
AnalysisJustification string `json:"analysisJustification"`
AnalysisResponse string `json:"analysisResponse"`
AnalysisDetails string `json:"analysisDetails"`
AnalysisComments []AnalysisComment `json:"analysisComments"`
IsSuppressed bool `json:"isSuppressed"`
}
type AnalysisComment ¶
type AnalysisRequest ¶
type AnalysisRequest struct {
Project string `json:"project"`
Component string `json:"component"`
Vulnerability string `json:"vulnerability"`
AnalysisState string `json:"analysisState"`
AnalysisJustification string `json:"analysisJustification"`
AnalysisResponse string `json:"analysisResponse"`
AnalysisDetails string `json:"analysisDetails"`
Comment string `json:"comment"`
IsSuppressed bool `json:"isSuppressed"`
}
type BomSubmitRequest ¶
type Client ¶
type Client interface {
AddToTeam(ctx context.Context, username, uuid string) error
ChangeAdminPassword(ctx context.Context, oldPassword, newPassword string) error
ConfigPropertyAggregate(ctx context.Context, properties []ConfigProperty) ([]ConfigProperty, error)
CreateAdminUsers(ctx context.Context, users *AdminUsers, teamUuid string) error
CreateChildProject(ctx context.Context, project *Project, name, version, group, classifier string, tags []string) (*Project, error)
CreateManagedUser(ctx context.Context, username, password string) error
CreateOidcUser(ctx context.Context, email string) error
CreateProject(ctx context.Context, name, version, group string, tags []string) (*Project, error)
CreateTeam(ctx context.Context, teamName string, permissions []Permission) (*Team, error)
DeleteManagedUser(ctx context.Context, username string) error
DeleteOidcUser(ctx context.Context, username string) error
DeleteProject(ctx context.Context, uuid string) error
DeleteProjects(ctx context.Context, name string) error
DeleteTeam(ctx context.Context, uuid string) error
DeleteUserMembership(ctx context.Context, uuid, username string) error
GenerateApiKey(ctx context.Context, uuid string) (string, error)
GetAnalysisTrail(ctx context.Context, projectUuid, componentUuid, vulnerabilityUuid string) (*Analysis, error)
GetConfigProperties(ctx context.Context) ([]ConfigProperty, error)
GetCurrentProjectMetric(ctx context.Context, projectUuid string) (*ProjectMetric, error)
GetEcosystems(ctx context.Context) ([]string, error)
GetFindings(ctx context.Context, projectUuid string, suppressed bool) ([]*Finding, error)
GetOidcUsers(ctx context.Context) ([]User, error)
GetProject(ctx context.Context, name, version string) (*Project, error)
GetProjectMetricsByDate(ctx context.Context, projectUuid, date string) ([]*ProjectMetric, error)
GetProjects(ctx context.Context) ([]*Project, error)
GetProjectById(ctx context.Context, uuid string) (*Project, error)
GetProjectsByTag(ctx context.Context, tag string) ([]*Project, error)
GetProjectsByPrefixedTag(ctx context.Context, prefix TagPrefix, tag string) ([]*Project, error)
GetTeam(ctx context.Context, team string) (*Team, error)
GetTeams(ctx context.Context) ([]Team, error)
PortfolioRefresh(ctx context.Context) error
RecordAnalysis(ctx context.Context, analysis *AnalysisRequest) error
RemoveAdminUsers(ctx context.Context, users *AdminUsers) error
TriggerAnalysis(ctx context.Context, projectUuid string) error
UpdateProject(ctx context.Context, uuid, name, version, group string, tags []string) (*Project, error)
UpdateProjectInfo(ctx context.Context, uuid, version, group string, tags []string) error
UploadProject(ctx context.Context, name, version, parentUuid string, autoCreate bool, bom []byte) error
Version(ctx context.Context) (string, error)
auth.Auth
}
type ConfigProperty ¶
type Finding ¶
type Finding struct {
Component Component `json:"component"`
Vulnerability Vulnerability `json:"vulnerability"`
Analysis VulnzAnalysis `json:"analysis"`
}
type NewUser ¶
type NewUser struct {
Username string `json:"username,omitempty"`
Email string `json:"email,omitempty"`
NewPassword string `json:"newPassword,omitempty"`
ConfirmPassword string `json:"confirmPassword,omitempty"`
Fullname string `json:"fullname,omitempty"`
Suspended bool `json:"suspended,omitempty"`
ForcePasswordChange bool `json:"forcePasswordChange,omitempty"`
NonExpiryPassword bool `json:"nonExpiryPassword,omitempty"`
}
type Option ¶
type Option = func(c *Options)
func WithApiKeySource ¶
func WithAuthSource ¶
func WithHttpClient ¶
func WithLogger ¶
func WithResponseCallback ¶
type Permission ¶
type Permission string
type Project ¶
type Project struct {
Active bool `json:"active"`
Author string `json:"author"`
Classifier string `json:"classifier"`
Group string `json:"group"`
Name string `json:"name"`
LastBomImportFormat string `json:"lastBomImportFormat,omitempty"`
LastBomImport int64 `json:"lastBomImport,omitempty"`
LastInheritedRiskScore float64 `json:"lastInheritedRiskScore,omitempty"`
Publisher string `json:"publisher"`
Tags []Tag `json:"tags"`
Uuid string `json:"uuid"`
Version string `json:"version"`
Parent *Project `json:"parent"`
Metrics *ProjectMetric `json:"metrics,omitempty"`
}
type ProjectMetric ¶
type ProjectMetric struct {
Critical int `json:"critical"`
High int `json:"high"`
Medium int `json:"medium"`
Low int `json:"low"`
Unassigned int `json:"unassigned"`
Vulnerabilities int `json:"vulnerabilities"`
VulnerableComponents int `json:"vulnerableComponents"`
Components int `json:"components"`
Suppressed int `json:"suppressed"`
FindingsTotal int `json:"findingsTotal"`
FindingsAudited int `json:"findingsAudited"`
FindingsUnaudited int `json:"findingsUnaudited"`
InheritedRiskScore float64 `json:"inheritedRiskScore"`
FirstOccurrence int64 `json:"firstOccurrence"`
LastOccurrence int64 `json:"lastOccurrence"`
}
type Vulnerability ¶
type VulnzAnalysis ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.