targets

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BzeroTarget

type BzeroTarget struct {
	Target

	AllowedTargetUsers []policies.TargetUser  `json:"allowedTargetUsers"`
	AllowedVerbs       []policies.Verb        `json:"allowedVerbs"`
	ControlChannel     *ControlChannelSummary `json:"controlChannel"`
}

BzeroTarget is a target running the Bzero agent

func (*BzeroTarget) GetTargetType

func (t *BzeroTarget) GetTargetType() targettype.TargetType

type ClusterTarget

type ClusterTarget struct {
	Target

	AllowedClusterUsers  []string               `json:"allowedClusterUsers"`
	AllowedClusterGroups []string               `json:"allowedClusterGroups"`
	ValidClusterUsers    []string               `json:"validClusterUsers"`
	ControlChannel       *ControlChannelSummary `json:"controlChannel"`
}

ClusterTarget is a target running the Bctl agent within a Kubernetes cluster

func (*ClusterTarget) GetTargetType

func (t *ClusterTarget) GetTargetType() targettype.TargetType

type ControlChannelSummary

type ControlChannelSummary struct {
	// ControlChannelID is a unique ID that identifies the control channel
	ControlChannelID string `json:"controlChannelId"`
	// ConnectionNodeID is the ID of the connection node the control channel
	// connected to
	ConnectionNodeID string `json:"connectionNodeId"`
	// StartTime is the time the control channel connection was established
	StartTime types.Timestamp `json:"startTime"`
	// EndTime is the time the control channel connection finished. Null if the
	// connection is still active
	EndTime *types.Timestamp `json:"endTime"`
}

ControlChannelSummary describes a target's currently active control channel

type CreateDatabaseTargetRequest added in v0.2.0

type CreateDatabaseTargetRequest struct {
	TargetName         string `json:"targetName"`
	ProxyTargetID      string `json:"proxyTargetId,omitempty"`
	ProxyEnvironmentID string `json:"proxyEnvironmentId,omitempty"`
	RemoteHost         string `json:"remoteHost"`

	// RemotePort is required for all databases; however, for GCP-hosted databases, the
	// value specified for Port.Value will be ignored when connecting to the database.
	RemotePort Port   `json:"remotePort"`
	LocalPort  *Port  `json:"localPort,omitempty"`
	LocalHost  string `json:"localHost,omitempty"`
	// Deprecated: IsSplitCert exists for historical compatibility and should not be used.
	// Set AuthenticationType in DatabaseAuthenticationConfig appropriately instead.
	IsSplitCert bool `json:"splitCert,omitempty"`
	// Deprecated: DatabaseType exists for historical compatibility and should not be used.
	// Set Database in DatabaseAuthenticationConfig appropriately instead.
	DatabaseType                 string                                     `json:"databaseType,omitempty"`
	EnvironmentID                string                                     `json:"environmentId,omitempty"`
	EnvironmentName              string                                     `json:"environmentName,omitempty"`
	DatabaseAuthenticationConfig *dbauthconfig.DatabaseAuthenticationConfig `json:"databaseAuthenticationConfig,omitempty"`
}

CreateDatabaseTargetRequest is used to create a new Database target One of either ProxyTargetID or ProxyEnvironmentID must be specified

type CreateDatabaseTargetResponse added in v0.2.0

type CreateDatabaseTargetResponse struct {
	TargetId string `json:"targetId"`
}

CreateDatabaseTargetResponse is the response returned if a Database target is successfully created

type CreateDynamicAccessConfigurationRequest

type CreateDynamicAccessConfigurationRequest struct {
	Name          string `json:"name"`
	StartWebhook  string `json:"startWebhook"`
	StopWebhook   string `json:"stopWebhook"`
	HealthWebhook string `json:"healthWebhook"`
	EnvironmentId string `json:"environmentId"`
	SharedSecret  string `json:"sharedSecret,omitempty"`
}

CreateDynamicAccessConfigurationRequest is used to create a new dynamic access configuration

type CreateDynamicAccessResponse

type CreateDynamicAccessResponse struct {
	ID string `json:"id"`
}

CreateDynamicAccessResponse is the response returned if a dynamic access configuration is successfully created

type CreateWebTargetRequest added in v0.3.0

type CreateWebTargetRequest struct {
	TargetName         string `json:"targetName"`
	RemotePort         Port   `json:"remotePort"`
	ProxyTargetID      string `json:"proxyTargetId,omitempty"`
	ProxyEnvironmentID string `json:"proxyEnvironmentId,omitempty"`
	LocalPort          *Port  `json:"localPort,omitempty"`
	LocalHost          string `json:"localHost,omitempty"`
	EnvironmentID      string `json:"environmentId,omitempty"`
	EnvironmentName    string `json:"environmentName,omitempty"`
	// RemoteHost is the URL of the web server. It must start with the scheme
	// (http:// or https://) that the host is expecting.
	RemoteHost string `json:"remoteHost"`
}

CreateWebTargetRequest is used to create a new Web target One of either ProxyTargetID or ProxyEnvironmentID must be specified

type CreateWebTargetResponse added in v0.3.0

type CreateWebTargetResponse struct {
	TargetID string `json:"targetId"`
}

CreateWebTargetResponse is the response returned if a Web target is successfully created

type DatabaseTarget

type DatabaseTarget struct {
	VirtualTarget

	// Deprecated: IsSplitCert exists for historical compatibility and should not be used.
	// Set AuthenticationType in DatabaseAuthenticationConfig appropriately instead.
	IsSplitCert bool `json:"splitCert"`
	// Deprecated: DatabaseType exists for historical compatibility and should not be used.
	// Set Database in DatabaseAuthenticationConfig appropriately instead.
	DatabaseType                 *string                                   `json:"databaseType"`
	AllowedTargetUsers           []policies.TargetUser                     `json:"allowedTargetUsers"`
	DatabaseAuthenticationConfig dbauthconfig.DatabaseAuthenticationConfig `json:"databaseAuthenticationConfig"`
}

DatabaseTarget is a virtual target that provides DB access to a remote database. The connection is proxied by a Bzero or Cluster target. The remote server doesn't necessarily have to be a database as under the hood it is a proxied TCP connection.

func (*DatabaseTarget) GetTargetType

func (t *DatabaseTarget) GetTargetType() targettype.TargetType

type DynamicAccessConfiguration

type DynamicAccessConfiguration struct {
	ID                 string                                     `json:"id"`
	Name               string                                     `json:"name"`
	EnvironmentId      string                                     `json:"environmentId"`
	StartWebhook       string                                     `json:"startWebhook"`
	StopWebhook        string                                     `json:"stopWebhook"`
	HealthWebhook      string                                     `json:"healthWebhook"`
	AllowedTargetUsers []policies.TargetUser                      `json:"allowedTargetUsers"`
	AllowedVerbs       []policies.Verb                            `json:"allowedVerbs"`
	Status             dacstatus.DynamicAccessConfigurationStatus `json:"status"`
}

DynamicAccessConfiguration configures dynamic access targets

type GenerateActivationTokenAndYamlRequest added in v0.3.0

type GenerateActivationTokenAndYamlRequest struct {
	Name          string            `json:"name"`
	EnvironmentID string            `json:"environmentId,omitempty"`
	Labels        map[string]string `json:"labels,omitempty"`
	Namespace     string            `json:"namespace,omitempty"`
}

GenerateActivationTokenAndYamlRequest is used to request a yaml and activation token needed to deploy the Kubernetes agent

type GenerateActivationTokenAndYamlResponse added in v0.3.0

type GenerateActivationTokenAndYamlResponse struct {
	YAML            string `json:"yaml"`
	ActivationToken string `json:"activationToken"`
}

GenerateActivationTokenAndYamlResponse is the response when the activation token and yaml have been generated successfully

type ListDatabaseTargetsOptions added in v0.3.0

type ListDatabaseTargetsOptions struct {
	// TargetNames filters the list of database targets to only those that
	// contain the specified target names.
	TargetNames []string `url:"targetNames,omitempty"`
	// TargetIDs filters the list of database targets to only those that contain the
	// specified target IDs.
	TargetIDs []string `url:"targetIds,omitempty"`
	// EnvironmentName disambiguates conflicting targets that have the same
	// target name when using the TargetNames option by filtering the list of
	// database targets to those that are part of the specified environment (by
	// name).
	EnvironmentName string `url:"envName,omitempty"`
	// EnvironmentID disambiguates conflicting targets that have the same target
	// name when using the TargetNames option by filtering the list of database
	// targets to those that are part of the specified environment (by id).
	EnvironmentID string `url:"envId,omitempty"`
}

ListDatabaseTargetsOptions specifies the optional parameters when querying for a list of database targets

type ListSplitCertDatabaseTypesResponse added in v0.3.0

type ListSplitCertDatabaseTypesResponse struct {
	Databases []string `json:"databases"`
}

ListSplitCertDatabaseTypesResponse is the response returned when querying for a list of databases types that have SplitCert support.

type ModifyBzeroTargetRequest

type ModifyBzeroTargetRequest struct {
	TargetName    *string `json:"targetName,omitempty"`
	EnvironmentID *string `json:"environmentId,omitempty"`
}

ModifyBzeroTargetRequest is used to modify a Bzero target

type ModifyClusterTargetRequest

type ModifyClusterTargetRequest struct {
	TargetName    *string `json:"name,omitempty"`
	EnvironmentID *string `json:"environmentId,omitempty"`
}

ModifyClusterTargetRequest is used to modify a Cluster target

type ModifyClusterTargetResponse

type ModifyClusterTargetResponse struct {
	ID            string `json:"id"`
	TargetName    string `json:"name"`
	EnvironmentID string `json:"environmentId"`
}

ModifyClusterTargetResponse is the response returned if a Cluster target is successfully modified

type ModifyDatabaseTargetRequest

type ModifyDatabaseTargetRequest struct {
	TargetName         *string `json:"targetName,omitempty"`
	ProxyTargetID      *string `json:"proxyTargetId,omitempty"`
	ProxyEnvironmentID *string `json:"proxyEnvironmentId,omitempty"`
	RemoteHost         *string `json:"remoteHost,omitempty"`
	RemotePort         *Port   `json:"remotePort,omitempty"`
	LocalPort          *Port   `json:"localPort,omitempty"`
	LocalHost          *string `json:"localHost,omitempty"`
	// Deprecated: IsSplitCert exists for historical compatibility and should not be used.
	// Set AuthenticationType in DatabaseAuthenticationConfig appropriately instead.
	IsSplitCert *bool `json:"splitCert,omitempty"`
	// Deprecated: DatabaseType exists for historical compatibility and should not be used.
	// Set Database in DatabaseAuthenticationConfig appropriately instead.
	DatabaseType                 *string                                    `json:"databaseType,omitempty"`
	EnvironmentID                *string                                    `json:"environmentId,omitempty"`
	DatabaseAuthenticationConfig *dbauthconfig.DatabaseAuthenticationConfig `json:"databaseAuthenticationConfig,omitempty"`
}

ModifyDatabaseTargetRequest is used to modify a Database target

type ModifyDynamicAccessConfigurationRequest

type ModifyDynamicAccessConfigurationRequest struct {
	Name          *string `json:"name,omitempty"`
	StartWebhook  *string `json:"startWebhook,omitempty"`
	StopWebhook   *string `json:"stopWebhook,omitempty"`
	HealthWebhook *string `json:"healthWebhook,omitempty"`
	SharedSecret  *string `json:"sharedSecret,omitempty"`
}

ModifyDynamicAccessConfigurationRequest is used to modify a dynamic access configuration

type ModifyWebTargetRequest

type ModifyWebTargetRequest struct {
	TargetName         *string `json:"targetName,omitempty"`
	ProxyTargetID      *string `json:"proxyTargetId,omitempty"`
	ProxyEnvironmentID *string `json:"proxyEnvironmentId,omitempty"`
	RemoteHost         *string `json:"remoteHost,omitempty"`
	RemotePort         *Port   `json:"remotePort,omitempty"`
	LocalPort          *Port   `json:"localPort,omitempty"`
	LocalHost          *string `json:"localHost,omitempty"`
	EnvironmentID      *string `json:"environmentId,omitempty"`
}

ModifyWebTargetRequest is used to modify a Web target

type Port

type Port struct {
	Value *int `json:"value,omitempty"`
}

Port describes a port number

type RequestBzeroAgentLogsRequest added in v0.3.0

type RequestBzeroAgentLogsRequest struct {
	TargetID            string `json:"targetId,omitempty"`
	TargetName          string `json:"targetName,omitempty"`
	EnvironmentID       string `json:"envId,omitempty"`
	EnvironmentName     string `json:"envName,omitempty"`
	UploadLogsRequestId string `json:"uploadLogsRequestId"`
}

RequestBzeroAgentLogsRequest is used to request the Bzero agent to post its logs to BastionZero

type RestartBzeroTargetRequest added in v0.3.0

type RestartBzeroTargetRequest struct {
	TargetID        string `json:"targetId,omitempty"`
	TargetName      string `json:"targetName,omitempty"`
	EnvironmentID   string `json:"envId,omitempty"`
	EnvironmentName string `json:"envName,omitempty"`
}

RestartBzeroTargetRequest is used to restart a Bzero target

type Target

type Target struct {
	// ID is the unique ID of the target
	ID string `json:"id"`
	// Name is the name of the target
	Name string `json:"name"`
	// Status is the condition of the target
	Status targetstatus.TargetStatus `json:"status"`
	// EnvironmentID is the ID of the environment the target belongs to
	EnvironmentID string `json:"environmentId"`
	// LastAgentUpdate is the timestamp of the last transition change in the
	// target's Status
	LastAgentUpdate *types.Timestamp `json:"lastAgentUpdate"`
	// AgentVersion is the version of the agent running on the target
	AgentVersion string `json:"agentVersion"`
	// Region is the BastionZero region that this target has connected to
	// (follows same naming convention as AWS regions)
	Region string `json:"region"`
	// AgentPublicKey is the public key this target's agent uses when running
	// the MrTAP protocol
	AgentPublicKey string `json:"agentPublicKey"`
}

Target abstracts common attributes from any kind of BastionZero target (excluding DAC targets)

func (*Target) GetAgentPublicKey

func (t *Target) GetAgentPublicKey() string

func (*Target) GetAgentVersion

func (t *Target) GetAgentVersion() string

func (*Target) GetEnvironmentID

func (t *Target) GetEnvironmentID() string

func (*Target) GetID

func (t *Target) GetID() string

func (*Target) GetLastAgentUpdate

func (t *Target) GetLastAgentUpdate() *types.Timestamp

func (*Target) GetName

func (t *Target) GetName() string

func (*Target) GetRegion

func (t *Target) GetRegion() string

func (*Target) GetStatus

func (t *Target) GetStatus() targetstatus.TargetStatus

type TargetInterface

type TargetInterface interface {
	// GetID returns the target's unique ID.
	GetID() string
	// GetName returns the target's name.
	GetName() string
	// GetStatus returns the target's status.
	GetStatus() targetstatus.TargetStatus
	// GetEnvironmentID returns the target's environment's ID.
	GetEnvironmentID() string
	// GetLastAgentUpdate returns the target's last agent update if set.
	// Otherwise, returns nil.
	GetLastAgentUpdate() *types.Timestamp
	// GetAgentVersion returns the target's agent version.
	GetAgentVersion() string
	// GetRegion returns the target's region.
	GetRegion() string
	// GetAgentPublicKey returns the target's agent public key.
	GetAgentPublicKey() string
	// GetTargetType returns the target's type.
	GetTargetType() targettype.TargetType
}

TargetInterface lets you work with common attributes from any kind of BastionZero target (excluding DAC targets)

type TargetsService

type TargetsService client.Service

TargetsService handles communication with the targets endpoints of the BastionZero API.

BastionZero API docs:

- https://cloud.bastionzero.com/api/#tag--Targets---Bzero-Agent

- https://cloud.bastionzero.com/api/#tag--Targets---Database

- https://cloud.bastionzero.com/api/#tag--Targets---Dynamic

- https://cloud.bastionzero.com/api/#tag--Targets---Kubernetes

- https://cloud.bastionzero.com/api/#tag--Targets---Web

func (*TargetsService) CreateDatabaseTarget added in v0.2.0

CreateDatabaseTarget creates a new Database target.

BastionZero API docs: https://cloud.bastionzero.com/api/#post-/api/v2/targets/database

func (*TargetsService) CreateDynamicAccessConfiguration

CreateDynamicAccessConfiguration creates a new dynamic access configuration.

BastionZero API docs: https://cloud.bastionzero.com/api/#post-/api/v2/targets/dynamic-access

func (*TargetsService) CreateWebTarget added in v0.3.0

CreateWebTarget creates a new Web target.

BastionZero API docs: https://cloud.bastionzero.com/api/#post-/api/v2/targets/web

func (*TargetsService) DeleteBzeroTarget added in v0.3.0

func (s *TargetsService) DeleteBzeroTarget(ctx context.Context, targetID string) (*http.Response, error)

DeleteBzeroTarget deletes the specified Bzero target.

BastionZero API docs: https://cloud.bastionzero.com/api/#delete-/api/v2/targets/bzero/-id-

func (*TargetsService) DeleteClusterTarget added in v0.3.0

func (s *TargetsService) DeleteClusterTarget(ctx context.Context, targetID string) (*http.Response, error)

DeleteClusterTarget deletes the specified Cluster target.

BastionZero API docs: https://cloud.bastionzero.com/api/#delete-/api/v2/targets/kube/-id-

func (*TargetsService) DeleteDatabaseTarget added in v0.2.0

func (s *TargetsService) DeleteDatabaseTarget(ctx context.Context, targetID string) (*http.Response, error)

DeleteDatabaseTarget deletes the specified Database target.

BastionZero API docs: https://cloud.bastionzero.com/api/#delete-/api/v2/targets/database/-id-

func (*TargetsService) DeleteDynamicAccessConfiguration

func (s *TargetsService) DeleteDynamicAccessConfiguration(ctx context.Context, dacID string) (*http.Response, error)

DeleteDynamicAccessConfiguration deletes the specified dynamic access configuration.

BastionZero API docs: https://cloud.bastionzero.com/api/#delete-/api/v2/targets/dynamic-access/-id-

func (*TargetsService) DeleteWebTarget added in v0.3.0

func (s *TargetsService) DeleteWebTarget(ctx context.Context, targetID string) (*http.Response, error)

DeleteWebTarget deletes the specified Web target.

BastionZero API docs: https://cloud.bastionzero.com/api/#delete-/api/v2/targets/web/-id-

func (*TargetsService) GenerateKubeYAML added in v0.3.0

GenerateKubeYAML generates a new activation token for the BastionZero Kubernetes agent and the YAML needed to deploy the agent.

BastionZero API docs: https://cloud.bastionzero.com/api/#post-/api/v2/targets/kube

func (*TargetsService) GetBzeroTarget

func (s *TargetsService) GetBzeroTarget(ctx context.Context, targetID string) (*BzeroTarget, *http.Response, error)

GetBzeroTarget fetches the specified Bzero target.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/bzero/-id-

func (*TargetsService) GetClusterTarget

func (s *TargetsService) GetClusterTarget(ctx context.Context, targetID string) (*ClusterTarget, *http.Response, error)

GetClusterTarget fetches the specified Cluster target.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/kube/-id-

func (*TargetsService) GetDatabaseTarget

func (s *TargetsService) GetDatabaseTarget(ctx context.Context, targetID string) (*DatabaseTarget, *http.Response, error)

GetDatabaseTarget fetches the specified Database target.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/database/-id-

func (*TargetsService) GetDynamicAccessConfiguration

func (s *TargetsService) GetDynamicAccessConfiguration(ctx context.Context, dacID string) (*DynamicAccessConfiguration, *http.Response, error)

GetDynamicAccessConfiguration fetches the specified dynamic access configuration.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/dynamic-access/-id-

func (*TargetsService) GetWebTarget

func (s *TargetsService) GetWebTarget(ctx context.Context, targetID string) (*WebTarget, *http.Response, error)

GetWebTarget fetches the specified Web target.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/web/-id-

func (*TargetsService) ListBzeroTargets

func (s *TargetsService) ListBzeroTargets(ctx context.Context) ([]BzeroTarget, *http.Response, error)

ListBzeroTargets lists all Bzero targets.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/bzero

func (*TargetsService) ListClusterTargets

func (s *TargetsService) ListClusterTargets(ctx context.Context) ([]ClusterTarget, *http.Response, error)

ListClusterTargets lists all Cluster targets.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/kube

func (*TargetsService) ListDatabaseAuthenticationConfigs added in v0.9.0

func (s *TargetsService) ListDatabaseAuthenticationConfigs(ctx context.Context) ([]dbauthconfig.DatabaseAuthenticationConfig, *http.Response, error)

ListDatabaseAuthenticationConfigs lists all database authentication configurations supported by BasionZero.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/database/supported-database-configs

func (*TargetsService) ListDatabaseTargets

func (s *TargetsService) ListDatabaseTargets(ctx context.Context) ([]DatabaseTarget, *http.Response, error)

ListDatabaseTargets lists all Database targets.

Use ListDatabaseTargetsWithFilter() to pass optional filters when querying for the list of targets.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/database

func (*TargetsService) ListDatabaseTargetsWithFilter added in v0.3.0

func (s *TargetsService) ListDatabaseTargetsWithFilter(ctx context.Context, opts *ListDatabaseTargetsOptions) ([]DatabaseTarget, *http.Response, error)

ListDatabaseTargetsWithFilter lists all Database targets. Pass in a non-nil ListDatabaseTargetsOptions struct to filter the list of database targets returned.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/database

func (*TargetsService) ListDynamicAccessConfigurations

func (s *TargetsService) ListDynamicAccessConfigurations(ctx context.Context) ([]DynamicAccessConfiguration, *http.Response, error)

ListDynamicAccessConfigurations lists all dynamic access configurations.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/dynamic-access

func (*TargetsService) ListSplitCertDatabaseTypes deprecated added in v0.3.0

func (s *TargetsService) ListSplitCertDatabaseTypes(ctx context.Context) (*ListSplitCertDatabaseTypesResponse, *http.Response, error)

ListSplitCertDatabaseTypes lists all Database types for which SplitCert access is supported.

Deprecated: Use ListDatabaseAuthenticationConfigs BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/database/supported-databases

func (*TargetsService) ListWebTargets

func (s *TargetsService) ListWebTargets(ctx context.Context) ([]WebTarget, *http.Response, error)

ListWebTargets lists all Web targets.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/targets/web

func (*TargetsService) ModifyBzeroTarget

func (s *TargetsService) ModifyBzeroTarget(ctx context.Context, targetID string, request *ModifyBzeroTargetRequest) (*BzeroTarget, *http.Response, error)

ModifyBzeroTarget updates a Bzero target.

BastionZero API docs: https://cloud.bastionzero.com/api/#patch-/api/v2/targets/bzero/-id-

func (*TargetsService) ModifyClusterTarget

func (s *TargetsService) ModifyClusterTarget(ctx context.Context, targetID string, request *ModifyClusterTargetRequest) (*ModifyClusterTargetResponse, *http.Response, error)

ModifyClusterTarget updates a Cluster target.

BastionZero API docs: https://cloud.bastionzero.com/api/#patch-/api/v2/targets/kube/-id-

func (*TargetsService) ModifyDatabaseTarget

func (s *TargetsService) ModifyDatabaseTarget(ctx context.Context, targetID string, request *ModifyDatabaseTargetRequest) (*DatabaseTarget, *http.Response, error)

ModifyDatabaseTarget updates a Database target.

BastionZero API docs: https://cloud.bastionzero.com/api/#patch-/api/v2/targets/database/-id-

func (*TargetsService) ModifyDynamicAccessConfiguration

func (s *TargetsService) ModifyDynamicAccessConfiguration(ctx context.Context, dacID string, request *ModifyDynamicAccessConfigurationRequest) (*http.Response, error)

ModifyDynamicAccessConfiguration updates a dynamic access configuration.

BastionZero API docs: https://cloud.bastionzero.com/api/#patch-/api/v2/targets/dynamic-access/-id-

func (*TargetsService) ModifyWebTarget

func (s *TargetsService) ModifyWebTarget(ctx context.Context, targetID string, request *ModifyWebTargetRequest) (*WebTarget, *http.Response, error)

ModifyWebTarget updates a Web target.

BastionZero API docs: https://cloud.bastionzero.com/api/#patch-/api/v2/targets/web/-id-

func (*TargetsService) RequestBzeroTargetLogs added in v0.3.0

func (s *TargetsService) RequestBzeroTargetLogs(ctx context.Context, request *RequestBzeroAgentLogsRequest) (*http.Response, error)

RequestBzeroTargetLogs requests that a Bzero target's agent post its logs to BastionZero.

BastionZero API docs: https://cloud.bastionzero.com/api/#post-/api/v2/targets/bzero/retrieve-logs

func (*TargetsService) RestartBzeroTarget added in v0.3.0

func (s *TargetsService) RestartBzeroTarget(ctx context.Context, request *RestartBzeroTargetRequest) (*http.Response, error)

RestartBzeroTarget restarts a Bzero target.

BastionZero API docs: https://cloud.bastionzero.com/api/#post-/api/v2/targets/bzero/restart

func (*TargetsService) UpdateAgentConfig added in v0.8.0

func (s *TargetsService) UpdateAgentConfig(ctx context.Context, request *UpdateAgentConfigRequest) (*http.Response, error)

UpdateAgentConfig requests that the Bzero agent's config is updated.

BastionZero API docs: https://cloud.bastionzero.com/api/#post-/api/v2/targets/bzero/update-config

type UpdateAgentConfigRequest added in v0.8.0

type UpdateAgentConfigRequest struct {
	TargetID        string `json:"targetId,omitempty"`
	TargetName      string `json:"targetName,omitempty"`
	EnvironmentID   string `json:"envId,omitempty"`
	EnvironmentName string `json:"envName,omitempty"`
	Key             string `json:"key"`
	Value           string `json:"value"`
}

UpdateAgentConfigRequest is used to update the Bzero agent config

type VirtualTarget

type VirtualTarget struct {
	Target

	// ProxyTargetID is the ID of the target that proxies connections made to
	// this virtual target
	// One of either ProxyTargetID or ProxyEnvironmentID must be specified when creating a target
	ProxyTargetID string `json:"proxyTargetId"`
	// ProxyEnvironmentID is the ID of the environment that proxies connections made to
	// this virtual target by assigning a base target from within that environment.
	// One of either ProxyTargetID or ProxyEnvironmentID must be specified when creating a target
	ProxyEnvironmentID string `json:"proxyEnvironmentId"`
	// RemoteHost is the IP address of the remote server that is connected to
	// when a connection is made to this virtual target
	RemoteHost string `json:"remoteHost"`
	// RemotePort is the port of the remote server that is connected to when a
	// connection is made to this virtual target
	RemotePort Port `json:"remotePort"`
	// LocalPort is the port of the daemon's localhost server that is spawned on
	// the user's machine on connect. If null, then the zli chooses the port for
	// the user on connect.
	LocalPort Port   `json:"localPort"`
	LocalHost string `json:"localHost"`
}

VirtualTarget abstracts common attributes from any kind of BastionZero virtual target (e.g. DB, Web)

func (*VirtualTarget) GetLocalPort

func (t *VirtualTarget) GetLocalPort() Port

func (*VirtualTarget) GetProxyEnvironmentID added in v0.10.0

func (t *VirtualTarget) GetProxyEnvironmentID() string

func (*VirtualTarget) GetProxyTargetID

func (t *VirtualTarget) GetProxyTargetID() string

func (*VirtualTarget) GetRemoteHost

func (t *VirtualTarget) GetRemoteHost() string

func (*VirtualTarget) GetRemotePort

func (t *VirtualTarget) GetRemotePort() Port

type VirtualTargetInterface

type VirtualTargetInterface interface {
	TargetInterface

	// GetProxyTargetID returns the virtual target's proxy target's ID.
	GetProxyTargetID() string
	// GetProxyEnvironmentID returns the virtual target's proxy environment's ID.
	GetProxyEnvironmentID() string
	// GetRemoteHost returns the virtual target's remote host.
	GetRemoteHost() string
	// GetRemotePort returns the virtual target's remote port.
	GetRemotePort() Port
	// GetLocalPort returns the virtual target's local port.
	GetLocalPort() Port
}

VirtualTargetInterface lets you work with common attributes from any kind of BastionZero virtual target (e.g. Db, Web)

type WebTarget

type WebTarget struct {
	VirtualTarget
}

WebTarget is a virtual target that provides HTTP(S) access to a remote web server. The connection is proxied by a Bzero or Cluster target.

func (*WebTarget) GetTargetType

func (t *WebTarget) GetTargetType() targettype.TargetType

Directories

Path Synopsis
Code generated by "string-enumer -t DynamicAccessConfigurationStatus -o ./generated.go ."; DO NOT EDIT.
Code generated by "string-enumer -t DynamicAccessConfigurationStatus -o ./generated.go ."; DO NOT EDIT.
Code generated by "string-enumer -t TargetStatus -o ./generated.go ."; DO NOT EDIT.
Code generated by "string-enumer -t TargetStatus -o ./generated.go ."; DO NOT EDIT.

Jump to

Keyboard shortcuts

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