Documentation
¶
Index ¶
- type AprlScanner
- func (a AprlScanner) GetAprlRecommendations() map[string]map[string]models.AprlRecommendation
- func (a AprlScanner) ListRecommendations() (map[string]map[string]models.AprlRecommendation, []models.AprlRecommendation)
- func (a *AprlScanner) RegisterExternalQuery(resourceType string, recommendation models.AprlRecommendation)
- func (a AprlScanner) Scan(ctx context.Context, cred azcore.TokenCredential) []*models.AprlResult
- type GraphQueryClient
- type GraphResult
- type QueryRequest
- type QueryRequestOptions
- type QueryResponse
- type ScanType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AprlScanner ¶
type AprlScanner struct {
// contains filtered or unexported fields
}
func NewAprlScanner ¶
func NewAprlScanner(serviceScanners []models.IAzureScanner, filters *models.Filters, subscriptions map[string]string) AprlScanner
create a new APRL scanner
func (AprlScanner) GetAprlRecommendations ¶
func (a AprlScanner) GetAprlRecommendations() map[string]map[string]models.AprlRecommendation
GetAprlRecommendations returns a map with all APRL recommendations
func (AprlScanner) ListRecommendations ¶
func (a AprlScanner) ListRecommendations() (map[string]map[string]models.AprlRecommendation, []models.AprlRecommendation)
func (*AprlScanner) RegisterExternalQuery ¶
func (a *AprlScanner) RegisterExternalQuery(resourceType string, recommendation models.AprlRecommendation)
RegisterExternalQuery adds an external YAML plugin query to the scanner
func (AprlScanner) Scan ¶
func (a AprlScanner) Scan(ctx context.Context, cred azcore.TokenCredential) []*models.AprlResult
AprlScan scans Azure resources using Azure Proactive Resiliency Library v2 (APRL)
type GraphQueryClient ¶
type GraphQueryClient struct {
// contains filtered or unexported fields
}
GraphQueryClient provides methods to query Azure Resource Graph using HTTP client.
func NewGraphQuery ¶
func NewGraphQuery(cred azcore.TokenCredential) *GraphQueryClient
NewGraphQuery creates a new GraphQuery using the provided TokenCredential.
func (*GraphQueryClient) Query ¶
func (q *GraphQueryClient) Query(ctx context.Context, query string, subscriptions []*string) *GraphResult
Query executes a Resource Graph query for the given subscriptions and query string. It handles batching and pagination.
type GraphResult ¶
type GraphResult struct {
Data []interface{} // Query result data
}
GraphResult holds the data returned from a Resource Graph query.
type QueryRequest ¶
type QueryRequest struct {
Subscriptions []string `json:"subscriptions"` // List of subscription IDs
Query string `json:"query"` // Kusto query string
Options *QueryRequestOptions `json:"options"` // Query options
}
QueryRequest represents the payload for a Resource Graph query.
type QueryRequestOptions ¶
type QueryRequestOptions struct {
ResultFormat string `json:"resultFormat,omitempty"` // Format of the result
Top *int32 `json:"$top,omitempty"` // Max number of results
SkipToken *string `json:"$skipToken,omitempty"` // Token for pagination
AuthorizationScopeFilter *string `json:"authorizationScopeFilter,omitempty"` // Filter by authorization scope
}
QueryRequestOptions represents options for the Resource Graph query.
type QueryResponse ¶
type QueryResponse struct {
Data []interface{} `json:"data"` // Query result data
SkipToken *string `json:"$skipToken,omitempty"`
Quota int // Value of x-ms-user-quota-remaining header as int
RetryAfter time.Duration // Value of x-ms-user-quota-resets-after header as timespan
}
QueryResponse represents the response from the Resource Graph API.