{"modulePath":"github.com/Method-Security/gitlabctl","version":"v0.0.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package vulnerability\n\nPackage vulnerability holds the data structures and logic necessary to interact with the Application Security portions of the Gitlab API to enumerate vulnerabilities.\n\n## Functions\n\n```go\nfunc ContainsSeverity(severity Severity, severities []Severity) bool\n```\nContainsSeverity checks if a slice of Severities contains a specific Severity, returning true if it does.\n\n```go\nfunc ContainsState(state State, states []State) bool\n```\nContainsState checks if a slice of States contains a specific State, returning true if it does.\n\n```go\nfunc FilterVulnerabilities(vulns []*gitlab.ProjectVulnerability, states []State, severities []Severity) []*gitlab.ProjectVulnerability\n```\nFilterVulnerabilities filters a slice of vulnerabilities by state and severity, returning only the vulnerabilities that match the provided states and severities.\n\n## Types\n\n```go\ntype EnumerateSecurityVulnerabilitiesOptions struct {\n\tProjectID  int        `json:\"project_id\" yaml:\"project_id\"`\n\tStates     []State    `json:\"states\" yaml:\"states\"`\n\tSeverities []Severity `json:\"severities\" yaml:\"severities\"`\n}\n```\nEnumerateSecurityVulnerabilitiesOptions holds the options for enumerating security vulnerabilities. The ProjectID field is used to specify the project ID to enumerate vulnerabilities for. The States field is used to filter vulnerabilities by state, only returning vulnerabilities that match the specified states. The Severities field is used to filter vulnerabilities by severity, only returning vulnerabilities that match the specified severities.\n\n```go\nfunc NewEnumerateSecurityVulnerabilitiesOptions(projectID int, states []string, severities []string) (*EnumerateSecurityVulnerabilitiesOptions, error)\n```\nNewEnumerateSecurityVulnerabilitiesOptions creates a new EnumerateSecurityVulnerabilitiesOptions struct with the provided project ID, states, and severities. If states are not provided, the default state of 'detected' is used. If severities are not provided, the default is that all severities are included.\n\n```go\ntype GitlabResourceReport struct {\n\tBaseURL   string          `json:\"base_url\" yaml:\"base_url\"`\n\tResources GitlabResources `json:\"resources\" yaml:\"resources\"`\n\tErrors    []string        `json:\"errors\" yaml:\"errors\"`\n}\n```\nGitlabResourceReport represents a report of Gitlab resources and non-fatal errors encountered during enumeration.\n\n```go\nfunc EnumerateSecurityVulnerabilities(ctx context.Context, baseURL string, enumerateOpts *EnumerateSecurityVulnerabilitiesOptions, client *gitlab.Client) (*GitlabResourceReport, error)\n```\nEnumerateSecurityVulnerabilities enumerates all of the security vulnerabilities for a project, filtering by the provided options.\n\n```go\ntype GitlabResources struct {\n\tVulnerabilities []*gitlab.ProjectVulnerability `json:\"vulnerabilities\" yaml:\"vulnerabilities\"`\n}\n```\nGitlabResources represents a collection of Gitlab vulnerabilities.\n\n```go\ntype Severity string\n```\nSeverity represents the severity of a vulnerability, as defined by the Gitlab API.\n\n```go\nconst (\n\tSeverityUnknown  Severity = \"unknown\"\n\tSeverityInfo     Severity = \"info\"\n\tSeverityLow      Severity = \"low\"\n\tSeverityMedium   Severity = \"medium\"\n\tSeverityHigh     Severity = \"high\"\n\tSeverityCritical Severity = \"critical\"\n)\n```\n\n```go\nfunc ToSeverities(severities []string) []Severity\n```\nToSeverities converts a slice of strings to a slice of Severities.\n\n```go\nfunc ToSeverity(severity string) Severity\n```\nToSeverity converts a string to a Severity, returning SeverityUnknown if the string is not recognized.\n\n```go\ntype State string\n```\nState represents the state of a vulnerability, as defined by the Gitlab API.\n\n```go\nconst (\n\tStateDetected  State = \"detected\"\n\tStateResolved  State = \"resolved\"\n\tStateDismissed State = \"dismissed\"\n)\n```\n\n```go\nfunc ToState(state string) State\n```\nToState converts a string to a State, returning StateDetected if the string is not recognized.\n\n```go\nfunc ToStates(states []string) []State\n```\nToStates converts a slice of strings to a slice of States.\n\n","path":"github.com/Method-Security/gitlabctl/internal/vulnerability","name":"vulnerability","synopsis":"Package vulnerability holds the data structures and logic necessary to interact with the Application Security portions of the Gitlab API to enumerate vulnerabilities.","isRedistributable":true}
