subassessments

package
v0.20240529.1155048 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MPL-2.0 Imports: 14 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/security/2019-01-01-preview/subassessments Documentation

The subassessments SDK allows for interaction with the Azure Resource Manager Service security (API Version 2019-01-01-preview).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2019-01-01-preview/subassessments"

Client Initialization

client := subassessments.NewSubAssessmentsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SubAssessmentsClient.Get

ctx := context.TODO()
id := subassessments.NewScopedSubAssessmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assessmentValue", "subAssessmentValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SubAssessmentsClient.List

ctx := context.TODO()
id := subassessments.NewScopedAssessmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assessmentValue")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: SubAssessmentsClient.ListAll

ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination
items, err := client.ListAllComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForAssessedResourceType

func PossibleValuesForAssessedResourceType() []string

func PossibleValuesForSeverity

func PossibleValuesForSeverity() []string

func PossibleValuesForSource

func PossibleValuesForSource() []string

func PossibleValuesForSubAssessmentStatusCode

func PossibleValuesForSubAssessmentStatusCode() []string

func ValidateScopedAssessmentID

func ValidateScopedAssessmentID(input interface{}, key string) (warnings []string, errors []error)

ValidateScopedAssessmentID checks that 'input' can be parsed as a Scoped Assessment ID

func ValidateScopedSubAssessmentID

func ValidateScopedSubAssessmentID(input interface{}, key string) (warnings []string, errors []error)

ValidateScopedSubAssessmentID checks that 'input' can be parsed as a Scoped Sub Assessment ID

Types

type AdditionalData

type AdditionalData interface {
}

type AssessedResourceType

type AssessedResourceType string
const (
	AssessedResourceTypeContainerRegistryVulnerability AssessedResourceType = "ContainerRegistryVulnerability"
	AssessedResourceTypeServerVulnerability            AssessedResourceType = "ServerVulnerability"
	AssessedResourceTypeSqlServerVulnerability         AssessedResourceType = "SqlServerVulnerability"
)

func (*AssessedResourceType) UnmarshalJSON added in v0.20240228.1142829

func (s *AssessedResourceType) UnmarshalJSON(bytes []byte) error

type CVE

type CVE struct {
	Link  *string `json:"link,omitempty"`
	Title *string `json:"title,omitempty"`
}

type CVSS

type CVSS struct {
	Base *float64 `json:"base,omitempty"`
}

type ContainerRegistryVulnerabilityProperties

type ContainerRegistryVulnerabilityProperties struct {
	Cve              *[]CVE             `json:"cve,omitempty"`
	Cvss             *map[string]CVSS   `json:"cvss,omitempty"`
	ImageDigest      *string            `json:"imageDigest,omitempty"`
	Patchable        *bool              `json:"patchable,omitempty"`
	PublishedTime    *string            `json:"publishedTime,omitempty"`
	RepositoryName   *string            `json:"repositoryName,omitempty"`
	Type             *string            `json:"type,omitempty"`
	VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"`
}

func (ContainerRegistryVulnerabilityProperties) MarshalJSON

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SecuritySubAssessment
}

type ListAllCompleteResult

type ListAllCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []SecuritySubAssessment
}

type ListAllOperationResponse

type ListAllOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SecuritySubAssessment
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []SecuritySubAssessment
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SecuritySubAssessment
}

type RawAdditionalDataImpl

type RawAdditionalDataImpl struct {
	Type   string
	Values map[string]interface{}
}

RawAdditionalDataImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type ResourceDetails

type ResourceDetails struct {
	Source Source `json:"source"`
}

type ScopedAssessmentId

type ScopedAssessmentId struct {
	ResourceId     string
	AssessmentName string
}

ScopedAssessmentId is a struct representing the Resource ID for a Scoped Assessment

func NewScopedAssessmentID

func NewScopedAssessmentID(resourceId string, assessmentName string) ScopedAssessmentId

NewScopedAssessmentID returns a new ScopedAssessmentId struct

func ParseScopedAssessmentID

func ParseScopedAssessmentID(input string) (*ScopedAssessmentId, error)

ParseScopedAssessmentID parses 'input' into a ScopedAssessmentId

func ParseScopedAssessmentIDInsensitively

func ParseScopedAssessmentIDInsensitively(input string) (*ScopedAssessmentId, error)

ParseScopedAssessmentIDInsensitively parses 'input' case-insensitively into a ScopedAssessmentId note: this method should only be used for API response data and not user input

func (*ScopedAssessmentId) FromParseResult

func (id *ScopedAssessmentId) FromParseResult(input resourceids.ParseResult) error

func (ScopedAssessmentId) ID

func (id ScopedAssessmentId) ID() string

ID returns the formatted Scoped Assessment ID

func (ScopedAssessmentId) Segments

func (id ScopedAssessmentId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Scoped Assessment ID

func (ScopedAssessmentId) String

func (id ScopedAssessmentId) String() string

String returns a human-readable description of this Scoped Assessment ID

type ScopedSubAssessmentId

type ScopedSubAssessmentId struct {
	Scope             string
	AssessmentName    string
	SubAssessmentName string
}

ScopedSubAssessmentId is a struct representing the Resource ID for a Scoped Sub Assessment

func NewScopedSubAssessmentID

func NewScopedSubAssessmentID(scope string, assessmentName string, subAssessmentName string) ScopedSubAssessmentId

NewScopedSubAssessmentID returns a new ScopedSubAssessmentId struct

func ParseScopedSubAssessmentID

func ParseScopedSubAssessmentID(input string) (*ScopedSubAssessmentId, error)

ParseScopedSubAssessmentID parses 'input' into a ScopedSubAssessmentId

func ParseScopedSubAssessmentIDInsensitively

func ParseScopedSubAssessmentIDInsensitively(input string) (*ScopedSubAssessmentId, error)

ParseScopedSubAssessmentIDInsensitively parses 'input' case-insensitively into a ScopedSubAssessmentId note: this method should only be used for API response data and not user input

func (*ScopedSubAssessmentId) FromParseResult

func (id *ScopedSubAssessmentId) FromParseResult(input resourceids.ParseResult) error

func (ScopedSubAssessmentId) ID

func (id ScopedSubAssessmentId) ID() string

ID returns the formatted Scoped Sub Assessment ID

func (ScopedSubAssessmentId) Segments

func (id ScopedSubAssessmentId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Scoped Sub Assessment ID

func (ScopedSubAssessmentId) String

func (id ScopedSubAssessmentId) String() string

String returns a human-readable description of this Scoped Sub Assessment ID

type SecuritySubAssessment

type SecuritySubAssessment struct {
	Id         *string                          `json:"id,omitempty"`
	Name       *string                          `json:"name,omitempty"`
	Properties *SecuritySubAssessmentProperties `json:"properties,omitempty"`
	Type       *string                          `json:"type,omitempty"`
}

type SecuritySubAssessmentOperationPredicate

type SecuritySubAssessmentOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (SecuritySubAssessmentOperationPredicate) Matches

type SecuritySubAssessmentProperties

type SecuritySubAssessmentProperties struct {
	AdditionalData  AdditionalData       `json:"additionalData"`
	Category        *string              `json:"category,omitempty"`
	Description     *string              `json:"description,omitempty"`
	DisplayName     *string              `json:"displayName,omitempty"`
	Id              *string              `json:"id,omitempty"`
	Impact          *string              `json:"impact,omitempty"`
	Remediation     *string              `json:"remediation,omitempty"`
	ResourceDetails *ResourceDetails     `json:"resourceDetails,omitempty"`
	Status          *SubAssessmentStatus `json:"status,omitempty"`
	TimeGenerated   *string              `json:"timeGenerated,omitempty"`
}

func (*SecuritySubAssessmentProperties) GetTimeGeneratedAsTime

func (o *SecuritySubAssessmentProperties) GetTimeGeneratedAsTime() (*time.Time, error)

func (*SecuritySubAssessmentProperties) SetTimeGeneratedAsTime

func (o *SecuritySubAssessmentProperties) SetTimeGeneratedAsTime(input time.Time)

func (*SecuritySubAssessmentProperties) UnmarshalJSON

func (s *SecuritySubAssessmentProperties) UnmarshalJSON(bytes []byte) error

type ServerVulnerabilityProperties

type ServerVulnerabilityProperties struct {
	Cve              *[]CVE             `json:"cve,omitempty"`
	Cvss             *map[string]CVSS   `json:"cvss,omitempty"`
	Patchable        *bool              `json:"patchable,omitempty"`
	PublishedTime    *string            `json:"publishedTime,omitempty"`
	Threat           *string            `json:"threat,omitempty"`
	Type             *string            `json:"type,omitempty"`
	VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"`
}

func (ServerVulnerabilityProperties) MarshalJSON

func (s ServerVulnerabilityProperties) MarshalJSON() ([]byte, error)

type Severity

type Severity string
const (
	SeverityHigh   Severity = "High"
	SeverityLow    Severity = "Low"
	SeverityMedium Severity = "Medium"
)

func (*Severity) UnmarshalJSON added in v0.20240228.1142829

func (s *Severity) UnmarshalJSON(bytes []byte) error

type Source

type Source string
const (
	SourceAzure        Source = "Azure"
	SourceOnPremise    Source = "OnPremise"
	SourceOnPremiseSql Source = "OnPremiseSql"
)

func (*Source) UnmarshalJSON added in v0.20240228.1142829

func (s *Source) UnmarshalJSON(bytes []byte) error

type SqlServerVulnerabilityProperties

type SqlServerVulnerabilityProperties struct {
	Query *string `json:"query,omitempty"`
	Type  *string `json:"type,omitempty"`
}

func (SqlServerVulnerabilityProperties) MarshalJSON

func (s SqlServerVulnerabilityProperties) MarshalJSON() ([]byte, error)

type SubAssessmentStatus

type SubAssessmentStatus struct {
	Cause       *string                  `json:"cause,omitempty"`
	Code        *SubAssessmentStatusCode `json:"code,omitempty"`
	Description *string                  `json:"description,omitempty"`
	Severity    *Severity                `json:"severity,omitempty"`
}

type SubAssessmentStatusCode

type SubAssessmentStatusCode string
const (
	SubAssessmentStatusCodeHealthy       SubAssessmentStatusCode = "Healthy"
	SubAssessmentStatusCodeNotApplicable SubAssessmentStatusCode = "NotApplicable"
	SubAssessmentStatusCodeUnhealthy     SubAssessmentStatusCode = "Unhealthy"
)

func (*SubAssessmentStatusCode) UnmarshalJSON added in v0.20240228.1142829

func (s *SubAssessmentStatusCode) UnmarshalJSON(bytes []byte) error

type SubAssessmentsClient

type SubAssessmentsClient struct {
	Client *resourcemanager.Client
}

func NewSubAssessmentsClientWithBaseURI

func NewSubAssessmentsClientWithBaseURI(sdkApi sdkEnv.Api) (*SubAssessmentsClient, error)

func (SubAssessmentsClient) Get

Get ...

func (SubAssessmentsClient) List

List ...

func (SubAssessmentsClient) ListAll

ListAll ...

func (SubAssessmentsClient) ListAllComplete

ListAllComplete retrieves all the results into a single object

func (SubAssessmentsClient) ListAllCompleteMatchingPredicate

func (c SubAssessmentsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate SecuritySubAssessmentOperationPredicate) (result ListAllCompleteResult, err error)

ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SubAssessmentsClient) ListComplete

ListComplete retrieves all the results into a single object

func (SubAssessmentsClient) ListCompleteMatchingPredicate

func (c SubAssessmentsClient) ListCompleteMatchingPredicate(ctx context.Context, id ScopedAssessmentId, predicate SecuritySubAssessmentOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type VendorReference

type VendorReference struct {
	Link  *string `json:"link,omitempty"`
	Title *string `json:"title,omitempty"`
}

Jump to

Keyboard shortcuts

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