Documentation
¶
Index ¶
- Constants
- func AppendAssets[T Asset](r *Resources, items []T)
- type Asset
- type BucketACLEntry
- type BucketACLManager
- type BucketACLResult
- type BucketManager
- type BucketObject
- type BucketResult
- type CommandResult
- type DBManager
- type Database
- type DatabaseActionResult
- type Domain
- type Enumerator
- type ErrNoSuchKey
- type Event
- type EventActionResult
- type EventReader
- type Host
- type IAMCredential
- type IAMCredentialManager
- type IAMCredentialResult
- type IAMManager
- type IAMResult
- type Log
- type Options
- type Provider
- type Record
- type ResourceCollector
- type ResourceError
- type ResourceHandler
- type Resources
- type RoleBinding
- type RoleBindingManager
- type RoleBindingResult
- type Sms
- type SmsSign
- type SmsTemplate
- type Storage
- type User
- type VMExecutor
Constants ¶
const ( AssetHost = "host" AssetStorage = "storage" AssetUser = "user" AssetDatabase = "database" AssetDomain = "domain" AssetLog = "log" )
Asset type constants. Providers and payloads should reference these rather than raw strings to keep the grouping key canonical.
Variables ¶
This section is empty.
Functions ¶
func AppendAssets ¶ added in v0.2.0
AppendAssets copies a typed slice into r.Assets as Asset values. Provider implementations use this to flow a []Host / []Storage / ... into the open asset list without writing the boxing loop inline.
Types ¶
type Asset ¶ added in v0.2.0
type Asset interface {
AssetType() string
}
Asset is any cloud resource that can be enumerated and rendered. New asset types (FaaS, K8s clusters, container registries, etc.) only need to implement AssetType() to flow through the existing asset-inventory pipeline.
type BucketACLEntry ¶ added in v0.3.1
type BucketACLManager ¶ added in v0.3.1
type BucketACLManager interface {
Provider
BucketACL(ctx context.Context, action, container, level string) (BucketACLResult, error)
}
BucketACLManager powers the bucket-acl-check payload. It exposes operations to audit and toggle public access on object-storage containers. `level` is only used for `expose` and is provider-specific (e.g. Azure "Blob"|"Container").
type BucketACLResult ¶ added in v0.3.1
type BucketACLResult struct {
Action string
Container string
Level string
Containers []BucketACLEntry
Message string
}
type BucketManager ¶ added in v0.2.0
type BucketManager interface {
Provider
BucketDump(ctx context.Context, action, bucketName string) ([]BucketResult, error)
}
BucketManager powers the bucket-check payload.
type BucketObject ¶ added in v0.3.0
type BucketResult ¶ added in v0.3.0
type BucketResult struct {
Action string
BucketName string
ObjectCount int64
Objects []BucketObject
Message string
}
func AggregateBucketResults ¶ added in v0.3.0
func AggregateBucketResults(action, bucketName string, results []BucketResult) BucketResult
type CommandResult ¶ added in v0.3.1
type CommandResult struct {
Output string
}
type DBManager ¶ added in v0.2.0
type DBManager interface {
Provider
DBManagement(context.Context, string, string) (DatabaseActionResult, error)
}
DBManager powers the rds-account-check payload.
type Database ¶
type DatabaseActionResult ¶ added in v0.3.1
type Enumerator ¶ added in v0.2.0
Enumerator powers the asset-inventory (`cloudlist`) payload.
type ErrNoSuchKey ¶
type ErrNoSuchKey struct {
Name string
}
ErrNoSuchKey means no such key exists in metadata.
func (*ErrNoSuchKey) Error ¶
func (e *ErrNoSuchKey) Error() string
Error returns the value of the metadata key
type EventActionResult ¶ added in v0.3.1
type EventReader ¶ added in v0.2.0
type EventReader interface {
Provider
EventDump(context.Context, string, string) (EventActionResult, error)
}
EventReader powers the event-check payload.
type Host ¶
type Host struct {
HostName string `table:"HostName"`
ID string `table:"Instance ID"`
State string `table:"State"`
PublicIPv4 string `table:"Public IP"`
PrivateIpv4 string `table:"Private IP"`
OSType string `table:"OS Type"`
DNSName string `table:"DNS Name"`
Public bool `table:"Public"`
Region string `table:"Region"`
}
type IAMCredential ¶ added in v0.3.1
type IAMCredentialManager ¶ added in v0.3.1
type IAMCredentialManager interface {
Provider
IAMCredential(ctx context.Context, action, principal, credentialID string) (IAMCredentialResult, error)
}
IAMCredentialManager powers the iam-credential-check payload. It validates detection coverage for long-lived IAM credential lifecycle: enumerating, minting, and revoking credentials such as GCP service-account keys, AWS access keys, or Azure client secrets. CredentialData on a `create` action carries the provider-specific secret material returned once at creation time.
type IAMCredentialResult ¶ added in v0.3.1
type IAMManager ¶ added in v0.2.0
type IAMManager interface {
Provider
UserManagement(action, username, password string) (IAMResult, error)
}
IAMManager powers the iam-user-check payload.
type Log ¶ added in v0.1.2
type Provider ¶
type Provider interface {
Name() string
}
Provider is the minimum contract every cloud must satisfy. Capability interfaces below (Enumerator, IAMManager, etc.) extend it optionally; a payload type-asserts for the capability it needs and fails gracefully when the current provider does not implement it.
type ResourceCollector ¶ added in v0.3.1
type ResourceCollector struct {
// contains filtered or unexported fields
}
func NewResourceCollector ¶ added in v0.3.1
func NewResourceCollector(provider string) *ResourceCollector
func (*ResourceCollector) Register ¶ added in v0.3.1
func (c *ResourceCollector) Register(name string, handler ResourceHandler) *ResourceCollector
type ResourceError ¶ added in v0.2.0
type ResourceHandler ¶ added in v0.3.1
type Resources ¶
type Resources struct {
Provider string
Assets []Asset
Sms Sms
Errors []ResourceError
}
type RoleBinding ¶ added in v0.3.1
type RoleBindingManager ¶ added in v0.3.1
type RoleBindingManager interface {
Provider
RoleBinding(ctx context.Context, action, principal, role, scope string) (RoleBindingResult, error)
}
RoleBindingManager powers the role-binding-check payload. It abstracts the "bind a principal to a role at a scope" operation that Azure RBAC and GCP IAM project bindings share, so a single payload can drive validation across providers. `scope` is provider-specific: an absolute Azure resource ID or a GCP project / resource path. An empty scope means "use the provider default scope" (subscription / current project).
type RoleBindingResult ¶ added in v0.3.1
type Sms ¶ added in v0.0.6
type Sms struct {
Signs []SmsSign
Templates []SmsTemplate
DailySize int64
}
type SmsTemplate ¶ added in v0.0.6
type Storage ¶
type User ¶
type VMExecutor ¶ added in v0.2.0
type VMExecutor interface {
Provider
ExecuteCloudVMCommand(context.Context, string, string) (CommandResult, error)
}
VMExecutor powers the instance-cmd-check / shell payloads.