clients

package
v0.0.0-...-f733b5b Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package clients holds client libraries used by security automation Cloud Functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SamplesFromDomain

func SamplesFromDomain(domain string) ([]string, error)

SamplesFromDomain returns a slice of hashes associated with a domain name.

Types

type CloudResourceManager

type CloudResourceManager struct {
	// contains filtered or unexported fields
}

CloudResourceManager client.

func NewCloudResourceManager

func NewCloudResourceManager(ctx context.Context, authFile string) (*CloudResourceManager, error)

NewCloudResourceManager returns and initalizes the Cloud Resource Manager client.

func (*CloudResourceManager) GetAncestry

func (c *CloudResourceManager) GetAncestry(ctx context.Context, projectID string) (*crm.GetAncestryResponse, error)

GetAncestry returns the ancestry for the given project.

func (*CloudResourceManager) GetPolicyProject

func (c *CloudResourceManager) GetPolicyProject(ctx context.Context, projectID string) (*crm.Policy, error)

GetPolicyProject returns the IAM policy for the given project resource.

func (*CloudResourceManager) SetPolicyProject

func (c *CloudResourceManager) SetPolicyProject(ctx context.Context, projectID string, p *crm.Policy) (*crm.Policy, error)

SetPolicyProject sets an IAM policy for the given project resource.

type Compute

type Compute struct {
	// contains filtered or unexported fields
}

Compute client.

func NewCompute

func NewCompute(ctx context.Context, authFile string) (*Compute, error)

NewCompute returns and initializes a Compute client.

func (*Compute) CreateSnapshot

func (c *Compute) CreateSnapshot(ctx context.Context, projectID, zone, disk string, rb *compute.Snapshot) (*compute.Operation, error)

CreateSnapshot creates a snapshot of a specified persistent disk.

func (*Compute) DeleteDiskSnapshot

func (c *Compute) DeleteDiskSnapshot(project, snapshot string) (*compute.Operation, error)

DeleteDiskSnapshot deletes the given snapshot from the project.

func (*Compute) ListDisks

func (c *Compute) ListDisks(ctx context.Context, projectID, zone string) (*compute.DiskList, error)

ListDisks returns a list of disk for a given project.

func (*Compute) ListProjectSnapshots

func (c *Compute) ListProjectSnapshots(ctx context.Context, projectID string) (*compute.SnapshotList, error)

ListProjectSnapshots returns a list of snapshot reousrces for a given project.

func (*Compute) PatchFirewallRule

func (c *Compute) PatchFirewallRule(ctx context.Context, projectID string, rule string, rb *compute.Firewall) (*compute.Operation, error)

PatchFirewallRule updates the firewall rule for the given project.

func (*Compute) SetLabels

func (c *Compute) SetLabels(ctx context.Context, projectID, resource string, rb *compute.GlobalSetLabelsRequest) (*compute.Operation, error)

SetLabels sets labels on a snapshot.

func (*Compute) WaitGlobal

func (c *Compute) WaitGlobal(project string, op *compute.Operation) []error

WaitGlobal will wait for the global operation to complete.

func (*Compute) WaitZone

func (c *Compute) WaitZone(project, zone string, op *compute.Operation) []error

WaitZone will wait for the zonal operation to complete.

type DomainReport

type DomainReport struct {
	Samples []Sample `json:"detected_communicating_samples"`
}

DomainReport holds a subset of fields returned in a domain request.

type Sample

type Sample struct {
	SHA256 string `json:"sha256"`
}

Sample holds a subset of fields returned in a sample request.

type SecurityCommandCenter

type SecurityCommandCenter struct {
	// contains filtered or unexported fields
}

SecurityCommandCenter client.

func NewSecurityCommandCenter

func NewSecurityCommandCenter(ctx context.Context, authFile string) (*SecurityCommandCenter, error)

NewSecurityCommandCenter returns and initializes a SecurityCommandCenter client.

func (*SecurityCommandCenter) UpdateFinding

func (s *SecurityCommandCenter) UpdateFinding(ctx context.Context, request *sccpb.UpdateFindingRequest) (*sccpb.Finding, error)

UpdateFinding updates a findig in SCC.

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage client.

func NewStorage

func NewStorage(ctx context.Context, authFile string) (*Storage, error)

NewStorage returns and initializes the Storage client.

func (*Storage) RemoveBucketUsers

func (s *Storage) RemoveBucketUsers(ctx context.Context, bucketName string, entity storage.ACLEntity) error

RemoveBucketUsers removes the users from the given bucket.

Directories

Path Synopsis
Package stubs provides testable stubs for clients.
Package stubs provides testable stubs for clients.

Jump to

Keyboard shortcuts

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