azure

package
v2.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageComponent = "storage"
	ComputeComponent = "compute"
	NetworkComponent = "network"

	DefenderStorageType        = "StorageAccounts"
	DefenderVirtualMachineType = "VirtualMachines"

	DataSourceTypeDisc                 = "Microsoft.Compute/disks"
	DataSourceTypeStorageAccountObject = "Microsoft.Storage/storageAccounts/blobServices"

	Duration30Days = time.Duration(30 * time.Hour * 24)
	Duration7Days  = time.Duration(7 * time.Hour * 24)

	AES256 = "AES256"

	RetentionPeriod90Days = 90 * time.Hour * 24
)

Variables

View Source
var (
	ErrCouldNotAuthenticate     = errors.New("could not authenticate to Azure")
	ErrCouldNotGetSubscriptions = errors.New("could not get azure subscription")
	ErrNoCredentialsConfigured  = errors.New("no credentials were configured")
	ErrGettingNextPage          = errors.New("error getting next page")
	ErrVaultInstanceIsEmpty     = errors.New("vault and/or instance is nil")
)
View Source
var (
	ErrEmptyStorageAccount       = errors.New("storage account is empty")
	ErrBackupStorageNotAvailable = errors.New("backup storages not available")
)
View Source
var (
	ErrEmptyVirtualMachine = errors.New("virtual machine is empty")
)
View Source
var (
	ErrMissingDiskEncryptionSetID = errors.New("no disk encryption set ID was specified")
)

Functions

func NewAuthorizer

func NewAuthorizer() (*azidentity.DefaultAzureCredential, error)

NewAuthorizer returns the Azure credential using one of the following authentication types (in the following order):

EnvironmentCredential
ManagedIdentityCredential
AzureCLICredential

func NewAzureDiscovery

func NewAzureDiscovery(opts ...DiscoveryOption) discovery.Discoverer

Types

type ClientCreateFunc

type ClientCreateFunc[T any] func(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*T, error)

ClientCreateFunc is a type that describes a function to create a new Azure SDK client.

type DiscoveryOption

type DiscoveryOption func(a *azureDiscovery)

func WithAuthorizer

func WithAuthorizer(authorizer azcore.TokenCredential) DiscoveryOption

func WithCloudServiceID

func WithCloudServiceID(csID string) DiscoveryOption

func WithResourceGroup

func WithResourceGroup(rg string) DiscoveryOption

WithResourceGroup is a DiscoveryOption that scopes the discovery to a specific resource group.

func WithSender

func WithSender(sender policy.Transporter) DiscoveryOption

Jump to

Keyboard shortcuts

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