Documentation
¶
Index ¶
- Constants
- func EC2FiltersFromEC2Tags(tags []ec2types.Tag) []ec2types.Filter
- func EC2FiltersFromInstanceState(states ...ec2types.InstanceStateName) []ec2types.Filter
- func EC2FiltersFromTags(tags []models.Tag) []ec2types.Filter
- func EC2TagsFromScanMetadata(meta provider.ScanMetadata) []ec2types.Tag
- func WrapError(err error) error
- type Client
- func (c *Client) DiscoverScopes(ctx context.Context) (*models.Scopes, error)
- func (c *Client) DiscoverTargets(ctx context.Context, scanScope *models.ScanScopeType) ([]models.TargetType, error)
- func (c *Client) GetInstances(ctx context.Context, filters []ec2types.Filter, excludeTags []models.Tag, ...) ([]Instance, error)
- func (c Client) Kind() models.CloudProvider
- func (c *Client) ListAllRegions(ctx context.Context, isRecursive bool) ([]Region, error)
- func (c *Client) RemoveTargetScan(ctx context.Context, config *provider.ScanJobConfig) error
- func (c *Client) RunTargetScan(ctx context.Context, config *provider.ScanJobConfig) error
- type Config
- type FatalError
- type Instance
- type Location
- type Region
- type RetryableError
- type ScanScope
- type Snapshot
- type VPC
- type Volume
- func (v *Volume) CreateSnapshot(ctx context.Context) (*Snapshot, error)
- func (v *Volume) Delete(ctx context.Context) error
- func (v *Volume) IsAttached(ctx context.Context) (bool, error)
- func (v *Volume) IsReady(ctx context.Context) (bool, error)
- func (v *Volume) WaitForReady(ctx context.Context, timeout time.Duration, interval time.Duration) error
Constants ¶
View Source
const ( DefaultEnvPrefix = "VMCLARITY_AWS" DefaultScannerInstanceType = "t2.large" DefaultBlockDeviceName = "xvdh" )
View Source
const ( DefaultRetryAfter = 5 * time.Second RetryServerErrorAfter = time.Minute InstanceReadynessAfter = 5 * time.Minute SnapshotReadynessAfter = 5 * time.Minute VolumeReadynessAfter = 5 * time.Minute VolumeAttachmentReadynessAfter = 2 * time.Minute )
View Source
const ( EC2TagKeyOwner = "Owner" EC2TagKeyName = "Name" EC2TagValueNamePattern = "vmclarity-scanner-%s" EC2TagValueOwner = "VMClarity" EC2TagKeyScanID = "VMClarity.ScanID" EC2TagKeyScanResultID = "VMClarity.ScanResultID" EC2TagKeyTargetID = "VMClarity.TargetID" EC2TagKeyTargetVolumeID = "VMClarity.TargetVolumeID" EC2SnapshotDescription = "Volume snapshot created by VMClarity for scanning" )
View Source
const ( VpcIDFilterName = "vpc-id" SecurityGroupIDFilterName = "instance.group-id" InstanceStateFilterName = "instance-state-name" SnapshotIDFilterName = "snapshot-id" )
View Source
const LocationSeparator = "/"
Variables ¶
This section is empty.
Functions ¶
func EC2FiltersFromEC2Tags ¶ added in v0.5.0
func EC2FiltersFromInstanceState ¶ added in v0.5.0
func EC2FiltersFromInstanceState(states ...ec2types.InstanceStateName) []ec2types.Filter
func EC2FiltersFromTags ¶ added in v0.5.0
func EC2TagsFromScanMetadata ¶ added in v0.5.0
func EC2TagsFromScanMetadata(meta provider.ScanMetadata) []ec2types.Tag
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DiscoverScopes ¶
func (*Client) DiscoverTargets ¶ added in v0.5.0
func (c *Client) DiscoverTargets(ctx context.Context, scanScope *models.ScanScopeType) ([]models.TargetType, error)
nolint:cyclop
func (*Client) GetInstances ¶
func (Client) Kind ¶ added in v0.5.0
func (c Client) Kind() models.CloudProvider
func (*Client) ListAllRegions ¶
func (*Client) RemoveTargetScan ¶ added in v0.5.0
RemoveTargetScan removes all the cloud resources associated with a Scan defined by config parameter. The operation is idempotent, therefore it is safe to call it multiple times. nolint:cyclop,gocognit
func (*Client) RunTargetScan ¶ added in v0.5.0
nolint:cyclop,gocognit,maintidx
type Config ¶ added in v0.5.0
type Config struct { // Region where the Scanner instance needs to be created ScannerRegion string `mapstructure:"scanner_region"` // SubnetID where the Scanner instance needs to be created SubnetID string `mapstructure:"subnet_id"` // SecurityGroupID which needs to be attached to the Scanner instance SecurityGroupID string `mapstructure:"security_group_id"` // KeyPairName is the name of the SSH KeyPair to use for Scanner instance launch KeyPairName string `mapstructure:"keypair_name"` // ScannerImage is the AMI image used for creating Scanner instance ScannerImage string `mapstructure:"scanner_ami_id"` // ScannerInstanceType is the instance type used for Scanner instance ScannerInstanceType string `mapstructure:"scanner_instance_type"` // BlockDeviceName contains the block device name used for attaching Scanner volume to the Scanner instance BlockDeviceName string `mapstructure:"block_device_name"` }
type FatalError ¶ added in v0.5.0
type FatalError = provider.FatalError
type Instance ¶ added in v0.5.0
type Instance struct { ID string Region string VpcID string SecurityGroups []models.SecurityGroup AvailabilityZone string Image string InstanceType string Platform string Tags []models.Tag LaunchTime time.Time RootDeviceName string Volumes []Volume Metadata provider.ScanMetadata // contains filtered or unexported fields }
func (*Instance) AttachVolume ¶ added in v0.5.0
nolint:cyclop
func (*Instance) RootVolume ¶ added in v0.5.0
type Location ¶ added in v0.5.0
func NewLocation ¶ added in v0.5.0
NOTE: pattern <region>/<vpc>.
type RetryableError ¶ added in v0.5.0
type RetryableError = provider.RetryableError
type ScanScope ¶
type ScanScope struct { AllRegions bool Regions []Region ScanStopped bool // Only targets that have these tags will be selected for scanning within the selected scan scope. // Multiple tags will be treated as an AND operator. TagSelector []models.Tag // Targets that have these tags will be excluded from the scan, even if they match the tag selector. // Multiple tags will be treated as an AND operator. ExcludeTags []models.Tag }
type Snapshot ¶ added in v0.5.0
type Snapshot struct { ID string Region string Metadata provider.ScanMetadata VolumeID string // contains filtered or unexported fields }
func (*Snapshot) CreateVolume ¶ added in v0.5.0
type VPC ¶
type VPC struct { ID string SecurityGroups []models.SecurityGroup }
type Volume ¶ added in v0.5.0
type Volume struct { ID string Region string BlockDeviceName string Metadata provider.ScanMetadata // contains filtered or unexported fields }
func (*Volume) CreateSnapshot ¶ added in v0.5.0
func (*Volume) IsAttached ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.