assessments

package
v0.20241104.1140654 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MPL-2.0 Imports: 12 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/security/2020-01-01/assessments Documentation

The assessments SDK allows for interaction with Azure Resource Manager security (API Version 2020-01-01).

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/2020-01-01/assessments"

Client Initialization

client := assessments.NewAssessmentsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AssessmentsClient.CreateOrUpdate

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

payload := assessments.SecurityAssessment{
	// ...
}


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

Example Usage: AssessmentsClient.Delete

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

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

Example Usage: AssessmentsClient.Get

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

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

Example Usage: AssessmentsClient.List

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

// 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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForAssessmentStatusCode

func PossibleValuesForAssessmentStatusCode() []string

func PossibleValuesForAssessmentType

func PossibleValuesForAssessmentType() []string

func PossibleValuesForCategories

func PossibleValuesForCategories() []string

func PossibleValuesForExpandEnum

func PossibleValuesForExpandEnum() []string

func PossibleValuesForImplementationEffort

func PossibleValuesForImplementationEffort() []string

func PossibleValuesForSeverity

func PossibleValuesForSeverity() []string

func PossibleValuesForSource

func PossibleValuesForSource() []string

func PossibleValuesForThreats

func PossibleValuesForThreats() []string

func PossibleValuesForUserImpact

func PossibleValuesForUserImpact() []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

Types

type AssessmentLinks struct {
	AzurePortalUri *string `json:"azurePortalUri,omitempty"`
}

type AssessmentStatus

type AssessmentStatus struct {
	Cause       *string              `json:"cause,omitempty"`
	Code        AssessmentStatusCode `json:"code"`
	Description *string              `json:"description,omitempty"`
}

type AssessmentStatusCode

type AssessmentStatusCode string
const (
	AssessmentStatusCodeHealthy       AssessmentStatusCode = "Healthy"
	AssessmentStatusCodeNotApplicable AssessmentStatusCode = "NotApplicable"
	AssessmentStatusCodeUnhealthy     AssessmentStatusCode = "Unhealthy"
)

func (*AssessmentStatusCode) UnmarshalJSON added in v0.20240228.1142829

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

type AssessmentType

type AssessmentType string
const (
	AssessmentTypeBuiltIn         AssessmentType = "BuiltIn"
	AssessmentTypeCustomPolicy    AssessmentType = "CustomPolicy"
	AssessmentTypeCustomerManaged AssessmentType = "CustomerManaged"
	AssessmentTypeVerifiedPartner AssessmentType = "VerifiedPartner"
)

func (*AssessmentType) UnmarshalJSON added in v0.20240228.1142829

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

type AssessmentsClient

type AssessmentsClient struct {
	Client *resourcemanager.Client
}

func NewAssessmentsClientWithBaseURI

func NewAssessmentsClientWithBaseURI(sdkApi sdkEnv.Api) (*AssessmentsClient, error)

func (AssessmentsClient) CreateOrUpdate

CreateOrUpdate ...

func (AssessmentsClient) Delete

Delete ...

func (AssessmentsClient) Get

Get ...

func (AssessmentsClient) List

List ...

func (AssessmentsClient) ListComplete

ListComplete retrieves all the results into a single object

func (AssessmentsClient) ListCompleteMatchingPredicate

func (c AssessmentsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate SecurityAssessmentOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type AzureResourceDetails added in v0.20241009.1142232

type AzureResourceDetails struct {
	Id *string `json:"id,omitempty"`

	Source Source `json:"source"`
}

func (AzureResourceDetails) MarshalJSON added in v0.20241009.1142232

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

func (AzureResourceDetails) ResourceDetails added in v0.20241009.1142232

func (s AzureResourceDetails) ResourceDetails() BaseResourceDetailsImpl

type BaseResourceDetailsImpl added in v0.20241009.1142232

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

func (BaseResourceDetailsImpl) ResourceDetails added in v0.20241009.1142232

type Categories

type Categories string
const (
	CategoriesCompute           Categories = "Compute"
	CategoriesData              Categories = "Data"
	CategoriesIdentityAndAccess Categories = "IdentityAndAccess"
	CategoriesIoT               Categories = "IoT"
	CategoriesNetworking        Categories = "Networking"
)

func (*Categories) UnmarshalJSON added in v0.20240228.1142829

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

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SecurityAssessment
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type ExpandEnum

type ExpandEnum string
const (
	ExpandEnumLinks    ExpandEnum = "links"
	ExpandEnumMetadata ExpandEnum = "metadata"
)

func (*ExpandEnum) UnmarshalJSON added in v0.20240228.1142829

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

type GetOperationOptions

type GetOperationOptions struct {
	Expand *ExpandEnum
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders added in v0.20240228.1142829

func (o GetOperationOptions) ToHeaders() *client.Headers

func (GetOperationOptions) ToOData added in v0.20240228.1142829

func (o GetOperationOptions) ToOData() *odata.Query

func (GetOperationOptions) ToQuery added in v0.20240228.1142829

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type ImplementationEffort

type ImplementationEffort string
const (
	ImplementationEffortHigh     ImplementationEffort = "High"
	ImplementationEffortLow      ImplementationEffort = "Low"
	ImplementationEffortModerate ImplementationEffort = "Moderate"
)

func (*ImplementationEffort) UnmarshalJSON added in v0.20240228.1142829

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

type ListCompleteResult

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

type ListCustomPager added in v0.20240628.1153531

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationResponse

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

type OnPremiseResourceDetails added in v0.20241009.1142232

type OnPremiseResourceDetails struct {
	MachineName      string `json:"machineName"`
	SourceComputerId string `json:"sourceComputerId"`
	VMuuid           string `json:"vmuuid"`
	WorkspaceId      string `json:"workspaceId"`

	Source Source `json:"source"`
}

func (OnPremiseResourceDetails) MarshalJSON added in v0.20241009.1142232

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

func (OnPremiseResourceDetails) ResourceDetails added in v0.20241009.1142232

type RawResourceDetailsImpl added in v0.20241009.1142232

type RawResourceDetailsImpl struct {
	Type   string
	Values map[string]interface{}
	// contains filtered or unexported fields
}

RawResourceDetailsImpl 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).

func (RawResourceDetailsImpl) ResourceDetails added in v0.20241009.1142232

func (s RawResourceDetailsImpl) ResourceDetails() BaseResourceDetailsImpl

type ResourceDetails

type ResourceDetails interface {
	ResourceDetails() BaseResourceDetailsImpl
}

func UnmarshalResourceDetailsImplementation added in v0.20241009.1142232

func UnmarshalResourceDetailsImplementation(input []byte) (ResourceDetails, error)

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 SecurityAssessment

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

type SecurityAssessmentMetadataPartnerData

type SecurityAssessmentMetadataPartnerData struct {
	PartnerName string  `json:"partnerName"`
	ProductName *string `json:"productName,omitempty"`
	Secret      string  `json:"secret"`
}

type SecurityAssessmentMetadataProperties

type SecurityAssessmentMetadataProperties struct {
	AssessmentType         AssessmentType                         `json:"assessmentType"`
	Categories             *[]Categories                          `json:"categories,omitempty"`
	Description            *string                                `json:"description,omitempty"`
	DisplayName            string                                 `json:"displayName"`
	ImplementationEffort   *ImplementationEffort                  `json:"implementationEffort,omitempty"`
	PartnerData            *SecurityAssessmentMetadataPartnerData `json:"partnerData,omitempty"`
	PolicyDefinitionId     *string                                `json:"policyDefinitionId,omitempty"`
	Preview                *bool                                  `json:"preview,omitempty"`
	RemediationDescription *string                                `json:"remediationDescription,omitempty"`
	Severity               Severity                               `json:"severity"`
	Threats                *[]Threats                             `json:"threats,omitempty"`
	UserImpact             *UserImpact                            `json:"userImpact,omitempty"`
}

type SecurityAssessmentOperationPredicate

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

func (SecurityAssessmentOperationPredicate) Matches

type SecurityAssessmentPartnerData

type SecurityAssessmentPartnerData struct {
	PartnerName string `json:"partnerName"`
	Secret      string `json:"secret"`
}

type SecurityAssessmentProperties

type SecurityAssessmentProperties struct {
	AdditionalData  *map[string]string                    `json:"additionalData,omitempty"`
	DisplayName     *string                               `json:"displayName,omitempty"`
	Links           *AssessmentLinks                      `json:"links,omitempty"`
	Metadata        *SecurityAssessmentMetadataProperties `json:"metadata,omitempty"`
	PartnersData    *SecurityAssessmentPartnerData        `json:"partnersData,omitempty"`
	ResourceDetails ResourceDetails                       `json:"resourceDetails"`
	Status          AssessmentStatus                      `json:"status"`
}

func (*SecurityAssessmentProperties) UnmarshalJSON added in v0.20241009.1142232

func (s *SecurityAssessmentProperties) UnmarshalJSON(bytes []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 Threats

type Threats string
const (
	ThreatsAccountBreach        Threats = "accountBreach"
	ThreatsDataExfiltration     Threats = "dataExfiltration"
	ThreatsDataSpillage         Threats = "dataSpillage"
	ThreatsDenialOfService      Threats = "denialOfService"
	ThreatsElevationOfPrivilege Threats = "elevationOfPrivilege"
	ThreatsMaliciousInsider     Threats = "maliciousInsider"
	ThreatsMissingCoverage      Threats = "missingCoverage"
	ThreatsThreatResistance     Threats = "threatResistance"
)

func (*Threats) UnmarshalJSON added in v0.20240228.1142829

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

type UserImpact

type UserImpact string
const (
	UserImpactHigh     UserImpact = "High"
	UserImpactLow      UserImpact = "Low"
	UserImpactModerate UserImpact = "Moderate"
)

func (*UserImpact) UnmarshalJSON added in v0.20240228.1142829

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

Jump to

Keyboard shortcuts

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