Documentation
¶
Index ¶
- Constants
- type AwsBaseDetails
- type AwsEc2InstanceDetails
- type AwsEcsClusterDetails
- type AwsRdsInstanceDetails
- type AwsSsmTargetDetails
- type Discoverer
- type Engine
- type KubernetesContainerDetails
- type KubernetesPodDetails
- type LocalDockerContainerDetails
- type Metadata
- type NetworkBaseDetails
- type NetworkHttpServerDetails
- type NetworkHttpsServerDetails
- type NetworkMysqlServerDetails
- type NetworkPostgresqlServerDetails
- type NetworkSshServerDetails
- type Resource
- type Result
Constants ¶
const ( // ResourceTypeAwsEc2Instance is the resource type for AWS EC2 instances. ResourceTypeAwsEc2Instance = "aws_ec2_instance" // ResourceTypeAwsEcsCluster is the resource type for AWS ECS clusters. ResourceTypeAwsEcsCluster = "aws_ecs_cluster" // ResourceTypeAwsRdsInstnace is the resource type for AWS RDS instances. ResourceTypeAwsRdsInstance = "aws_rds_instance" // ResourceTypeAwsSsmTarget is the resource type for AWS SSM targets. ResourceTypeAwsSsmTarget = "aws_ssm_target" // ResourceTypeKubernetesPod is the resource type for kubernetes pods. ResourceTypeKubernetesPod = "kubernetes_pod" // ResourceTypeLocalDockerContainer is the resource type for containers managed by the local Docker daemon. ResourceTypeLocalDockerContainer = "local_docker_container" // ResourceTypeNetworkHttpServer is the resource type for network-reachable HTTP servers. ResourceTypeNetworkHttpServer = "network_http_server" // ResourceTypeNetworkHttpsServer is the resource type for network-reachable HTTPS servers. ResourceTypeNetworkHttpsServer = "network_https_server" // ResourceTypeNetworkMysqlServer is the resource type for network-reachable MySQL servers. ResourceTypeNetworkMysqlServer = "network_mysql_server" // ResourceTypeNetworkPostgresqlServer is the resource type for network-reachable PostgreSQL servers. ResourceTypeNetworkPostgresqlServer = "network_postgresql_server" // ResourceTypeNetworkSshServer is the resource type for network-reachable SSH servers. ResourceTypeNetworkSshServer = "network_ssh_server" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwsBaseDetails ¶
type AwsBaseDetails struct {
AwsAccountId string `json:"aws_account_id"`
AwsRegion string `json:"aws_region"`
AwsArn string `json:"aws_arn"`
}
AwsBaseDetails represents the details of a discovered generic AWS resource.
type AwsEc2InstanceDetails ¶
type AwsEc2InstanceDetails struct {
AwsBaseDetails // extends
Tags map[string]string `json:"tags"`
InstanceId string `json:"instance_id"`
ImageId string `json:"ami_id"`
VpcId string `json:"vpc_id"`
SubnetId string `json:"subnet_id"`
PrivateDnsName string `json:"private_dns_name"`
PrivateIpAddress string `json:"private_ip_address"`
PublicDnsName string `json:"public_dns_name"`
PublicIpAddress string `json:"public_ip_address"`
InstanceType string `json:"instance_type"`
}
AwsEc2InstanceDetails represents the details of a discovered AWS EC2 instance.
type AwsEcsClusterDetails ¶
type AwsEcsClusterDetails struct {
AwsBaseDetails // extends
Tags map[string]string `json:"tags"`
ClusterName string `json:"cluster_name"`
Services []string `json:"services"`
Tasks []string `json:"tasks"`
Containers []string `json:"containers"`
}
AwsEcsClusterDetails represents the details of a discovered AWS ECS cluster.
type AwsRdsInstanceDetails ¶
type AwsRdsInstanceDetails struct {
AwsBaseDetails // extends
Tags map[string]string `json:"tags"`
DBInstanceIdentifier string `json:"db_instance_identifier"`
Engine string `json:"engine"`
EngineVersion string `json:"engine_version"`
VpcId string `json:"vpc_id"`
DBSubnetGroupName string `json:"db_subnet_group_name"`
EndpointAddress string `json:"endpoint_address"`
EndpointPort int32 `json:"endpoint_port"`
}
AwsRdsInstanceDetails represents the details of a discovered AWS RDS instance.
type AwsSsmTargetDetails ¶ added in v0.1.3
type AwsSsmTargetDetails struct {
AwsBaseDetails // extends
InstanceId string `json:"instance_id"`
}
AwsSsmTargetDetails represents the details of a discovered AWS SSM target.
type Discoverer ¶
Discoverer represents an entity capable of discovering resources.
type Engine ¶ added in v0.1.0
Engine represents an entity capable of managing discovery jobs.
An Engine has three responsibilities: - Write zero or more results to the channel - Close the channel as soon as they are done with it - Exit gracefully upon the context being done
type KubernetesContainerDetails ¶ added in v0.1.5
KubernetesContainerDetails represents the details of a discovered kubernetes container.
type KubernetesPodDetails ¶ added in v0.1.5
type KubernetesPodDetails struct {
Namespace string `json:"namespace"`
PodName string `json:"pod_name"`
PodIP string `json:"pod_ip"`
NodeName string `json:"node_name"`
Status string `json:"status"`
Containers []KubernetesContainerDetails `json:"containers"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
}
KubernetesPodDetails represents the details of a discovered kubernetes pod.
type LocalDockerContainerDetails ¶ added in v0.1.5
type LocalDockerContainerDetails struct {
ContainerId string `json:"container_id"`
Status string `json:"status"`
Image string `json:"image"`
Names []string `json:"names"`
PortBindings map[string]string `json:"port_bindings"`
Labels map[string]string `json:"labels"`
}
LocalDockerContainerDetails represents the details of a discovered container managed by the local Docker daemon.
type Metadata ¶ added in v0.1.3
type Metadata struct {
DiscovererId string `json:"discoverer_id"`
StartedAt time.Time `json:"started_at"`
EndedAt time.Time `json:"ended_at"`
}
Metadata represents metadata for a result.
type NetworkBaseDetails ¶ added in v0.1.4
type NetworkBaseDetails struct {
Addresses []string `json:"addresses"`
HostNames []string `json:"hostnames,omitempty"`
Port string `json:"port"`
}
NetworkBaseDetails represents the details of a discovered generic service on the network.
type NetworkHttpServerDetails ¶ added in v0.1.4
type NetworkHttpServerDetails struct {
NetworkBaseDetails // extends
}
NetworkHttpServerDetails represents the details of a discovered HTTP server on the network.
type NetworkHttpsServerDetails ¶ added in v0.1.4
type NetworkHttpsServerDetails struct {
NetworkBaseDetails // extends
}
NetworkHttpsServerDetails represents the details of a discovered HTTPS server on the network.
type NetworkMysqlServerDetails ¶ added in v0.1.4
type NetworkMysqlServerDetails struct {
NetworkBaseDetails // extends
}
NetworkMysqlServerDetails represents the details of a discovered MySQL server on the network.
type NetworkPostgresqlServerDetails ¶ added in v0.1.4
type NetworkPostgresqlServerDetails struct {
NetworkBaseDetails // extends
}
NetworkPostgresqlServerDetails represents the details of a discovered PostgreSQL server on the network.
type NetworkSshServerDetails ¶ added in v0.1.4
type NetworkSshServerDetails struct {
NetworkBaseDetails // extends
}
NetworkSshServerDetails represents the details of a discovered SSH server on the network.
type Resource ¶
type Resource struct {
ResourceType string `json:"resource_type"`
AwsEc2InstanceDetails *AwsEc2InstanceDetails `json:"aws_ec2_instance_details,omitempty"`
AwsEcsClusterDetails *AwsEcsClusterDetails `json:"aws_ecs_cluster_details,omitempty"`
AwsRdsInstanceDetails *AwsRdsInstanceDetails `json:"aws_rds_instance_details,omitempty"`
AwsSsmTargetDetails *AwsSsmTargetDetails `json:"aws_ssm_target_details,omitempty"`
KubernetesPodDetails *KubernetesPodDetails `json:"kubernetes_pod_details,omitempty"`
LocalDockerContainerDetails *LocalDockerContainerDetails `json:"local_docker_container_details,omitempty"`
NetworkHttpServerDetails *NetworkHttpServerDetails `json:"network_http_server_details,omitempty"`
NetworkHttpsServerDetails *NetworkHttpsServerDetails `json:"network_https_server_details,omitempty"`
NetworkMysqlServerDetails *NetworkMysqlServerDetails `json:"network_mysql_server_details,omitempty"`
NetworkPostgresqlServerDetails *NetworkPostgresqlServerDetails `json:"network_postgresql_server_details,omitempty"`
NetworkSshServerDetails *NetworkSshServerDetails `json:"network_ssh_server_details,omitempty"`
}
Resource represents a generic discovered resource.
type Result ¶ added in v0.1.0
type Result struct {
sync.Mutex // inherit lock behaviour
Resources []Resource `json:"resources"`
Errors []string `json:"errors"`
Metadata Metadata `json:"metadata"`
}
Result represents the result of a discoverer.
func NewResult ¶ added in v0.1.0
NewResult returns a new Result object with the StartedAt time set to the current time.
func (*Result) AddResources ¶ added in v0.1.3
AddResources adds resources to a result
Directories
¶
| Path | Synopsis |
|---|---|
|
__examples__
|
|
|
aws_continuous
command
|
|
|
aws_multiregion
command
|
|
|
aws_oneoff
command
|
|
|
docker_oneoff
command
|
|
|
network_oneoff
command
|
|