Documentation
¶
Index ¶
Constants ¶
const DefaultModuleName = "AWTest"
const InvalidAccessKeyId = "InvalidAccessKeyId"
const InvalidClientTokenId = "InvalidClientTokenId"
const MaxAccessibleMethodsInSummary = 20
MaxAccessibleMethodsInSummary caps the number of accessible method names displayed in text/table summaries to avoid overwhelming output.
Variables ¶
var AwsErrorMessages = map[string]string{
"UnauthorizedOperation": "You don't have permission to perform this operation.",
"InvalidAccessKeyId": "Invalid access key. Aborting scan.",
"AccessDeniedException": "Access denied to this service.",
"InvalidClientTokenId": "The security token included in the request is invalid. Aborting scan.",
}
var Regions = []string{
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2",
}
Functions ¶
func FormatAccessibleMethods ¶
FormatAccessibleMethods returns the accessible methods section lines for summary display. The formatName parameter allows callers to wrap method names (e.g., with ANSI coloring). Returns nil if there are no accessible methods.
Types ¶
type AWSService ¶
type InvalidKeyError ¶
type InvalidKeyError struct {
Message string
}
func (*InvalidKeyError) Error ¶
func (e *InvalidKeyError) Error() string
type ScanResult ¶
type ScanResult struct {
ServiceName string // e.g., "S3", "EC2", "IAM"
MethodName string // e.g., "s3:ListBuckets", "ec2:DescribeInstances"
ResourceType string // e.g., "bucket", "instance", "user"
ResourceName string // e.g., "my-bucket", "i-1234567890abcdef0"
Details map[string]interface{} // Service-specific details (region, count, metadata)
Error error // nil if successful, error if failed
Timestamp time.Time // When this result was collected
}
ScanResult represents a single result from an AWS service enumeration. It captures service-specific information along with metadata about the scan.
func (ScanResult) HasError ¶
func (sr ScanResult) HasError() bool
HasError returns true if the scan result contains an error.
type ScanSummary ¶
type ScanSummary struct {
TotalServices int
AccessibleServices int
AccessDeniedServices int
TotalResources int
AccessibleMethodNames []string
ScanDuration time.Duration
Timestamp time.Time
}
ScanSummary holds aggregate statistics about a completed scan.
func GenerateSummary ¶
func GenerateSummary(results []ScanResult, startTime time.Time) ScanSummary
GenerateSummary computes aggregate scan statistics from results. A service can appear in both accessible and denied counts if it has mixed success/error results (e.g., S3 ListBuckets succeeds but ListObjects fails).