scanners

package
v0.0.0-...-223edf0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 84 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

Index

Constants

This section is empty.

Variables

View Source
var ScannerList = map[string][]azqr.IAzureScanner{
	"aa":     {&aa.AutomationAccountScanner{}},
	"adf":    {&adf.DataFactoryScanner{}},
	"afd":    {&afd.FrontDoorScanner{}},
	"afw":    {&afw.FirewallScanner{}},
	"agw":    {&agw.ApplicationGatewayScanner{}},
	"aks":    {&aks.AKSScanner{}},
	"amg":    {&amg.ManagedGrafanaScanner{}},
	"apim":   {&apim.APIManagementScanner{}},
	"appcs":  {&appcs.AppConfigurationScanner{}},
	"appi":   {&appi.AppInsightsScanner{}},
	"as":     {&as.AnalysisServicesScanner{}},
	"asp":    {&asp.AppServiceScanner{}},
	"avd":    {&avd.AzureVirtualDesktopScanner{}},
	"avs":    {&avs.AVSScanner{}},
	"ba":     {&ba.BatchAccountScanner{}},
	"ca":     {&ca.ContainerAppsScanner{}},
	"cae":    {&cae.ContainerAppsEnvironmentScanner{}},
	"ci":     {&ci.ContainerInstanceScanner{}},
	"cog":    {&cog.CognitiveScanner{}},
	"con":    {&conn.ConnectionScanner{}},
	"cosmos": {&cosmos.CosmosDBScanner{}},
	"cr":     {&cr.ContainerRegistryScanner{}},
	"dbw":    {&dbw.DatabricksScanner{}},
	"dec":    {&dec.DataExplorerScanner{}},
	"disk":   {&disk.DiskScanner{}},
	"erc":    {&erc.ExpressRouteScanner{}},
	"evgd":   {&evgd.EventGridScanner{}},
	"evh":    {&evh.EventHubScanner{}},
	"fdfp":   {&fdfp.FrontDoorWAFPolicyScanner{}},
	"gal":    {&gal.GalleryScanner{}},
	"hpc":    {&hpc.HighPerformanceComputingScanner{}},
	"iot":    {&iot.IoTHubScanner{}},
	"it":     {&it.ImageTemplateScanner{}},
	"kv":     {&kv.KeyVaultScanner{}},
	"lb":     {&lb.LoadBalancerScanner{}},
	"log":    {&log.LogAnalyticsScanner{}},
	"logic":  {&logic.LogicAppScanner{}},
	"maria":  {&maria.MariaScanner{}},
	"mysql":  {&mysql.MySQLFlexibleScanner{}, &mysql.MySQLScanner{}},
	"netapp": {&netapp.NetAppScanner{}},
	"ng":     {&ng.NatGatewayScanner{}},
	"nsg":    {&nsg.NSGScanner{}},
	"nw":     {&nw.NetworkWatcherScanner{}},
	"pdnsz":  {&pdnsz.PrivateDNSZoneScanner{}},
	"pep":    {&pep.PrivateEndpointScanner{}},
	"pip":    {&pip.PublicIPScanner{}},
	"psql":   {&psql.PostgreFlexibleScanner{}, &psql.PostgreScanner{}},
	"redis":  {&redis.RedisScanner{}},
	"rsv":    {&rsv.RecoveryServiceScanner{}},
	"rt":     {&rt.RouteTableScanner{}},
	"sap":    {&sap.SAPScanner{}},
	"sb":     {&sb.ServiceBusScanner{}},
	"sigr":   {&sigr.SignalRScanner{}},
	"sql":    {&sql.SQLScanner{}},
	"st":     {&st.StorageScanner{}},
	"synw":   {&synw.SynapseWorkspaceScanner{}},
	"traf":   {&traf.TrafficManagerScanner{}},
	"vdpool": {&vdpool.VirtualDesktopScanner{}},
	"vgw":    {&vgw.VirtualNetworkGatewayScanner{}},
	"vm":     {&vm.VirtualMachineScanner{}},
	"vmss":   {&vmss.VirtualMachineScaleSetScanner{}},
	"vnet":   {&vnet.VirtualNetworkScanner{}},
	"wps":    {&wps.WebPubSubScanner{}},
}

ScannerList is a map of service abbreviation to scanner

Functions

func GetScannerByKeys

func GetScannerByKeys(keys []string) []azqr.IAzureScanner

GetScannerByKeys returns a list of scanners for the given keys

func GetScanners

func GetScanners() []azqr.IAzureScanner

GetScanners returns a list of all scanners in ScannerList

Types

type AdvisorResult

type AdvisorResult struct {
	RecommendationID, SubscriptionID, SubscriptionName, Type, Name, ResourceID, Category, Impact, Description string
}

AdvisorResult - Advisor result

type AdvisorScanner

type AdvisorScanner struct {
	// contains filtered or unexported fields
}

AdvisorScanner - Advisor scanner

func (*AdvisorScanner) Init

func (s *AdvisorScanner) Init(config *azqr.ScannerConfig) error

Init - Initializes the Advisor Scanner

func (*AdvisorScanner) ListRecommendations

func (s *AdvisorScanner) ListRecommendations() ([]AdvisorResult, error)

ListRecommendations - Lists Azure Advisor recommendations.

func (*AdvisorScanner) Scan

func (s *AdvisorScanner) Scan(scan bool, config *azqr.ScannerConfig) []AdvisorResult

type ArmBatchRequest

type ArmBatchRequest struct {
	Requests []ArmBatchRequestItem `json:"requests"`
}

type ArmBatchRequestItem

type ArmBatchRequestItem struct {
	HttpMethod  string `json:"httpMethod"`
	RelativeUrl string `json:"relativeUrl"`
}

type ArmBatchResponse

type ArmBatchResponse struct {
	Responses []ArmBatchResponseItem `json:"responses"`
}

type ArmBatchResponseItem

type ArmBatchResponseItem struct {
	Content armmonitor.DiagnosticSettingsResourceCollection `json:"content"`
}

type CostResult

type CostResult struct {
	From, To time.Time
	Items    []*CostResultItem
}

CostResult - Cost result

type CostResultItem

type CostResultItem struct {
	SubscriptionID, SubscriptionName, ServiceName, Value, Currency string
}

CostResultItem - Cost result ite,

type CostScanner

type CostScanner struct {
	// contains filtered or unexported fields
}

CostScanner - Cost scanner

func (*CostScanner) Init

func (s *CostScanner) Init(config *azqr.ScannerConfig) error

Init - Initializes the Cost Scanner

func (*CostScanner) QueryCosts

func (s *CostScanner) QueryCosts() (*CostResult, error)

QueryCosts - Query Costs.

func (*CostScanner) Scan

func (s *CostScanner) Scan(scan bool, config *azqr.ScannerConfig) *CostResult

type DefenderResult

type DefenderResult struct {
	SubscriptionID, SubscriptionName, Name, Tier string
	Deprecated                                   bool
}

DefenderResult - Defender result

type DefenderScanner

type DefenderScanner struct {
	// contains filtered or unexported fields
}

DefenderScanner - Defender scanner

func (*DefenderScanner) Init

func (s *DefenderScanner) Init(config *azqr.ScannerConfig) error

Init - Initializes the Defender Scanner

func (*DefenderScanner) ListConfiguration

func (s *DefenderScanner) ListConfiguration() ([]DefenderResult, error)

ListConfiguration - Lists Microsoft Defender for Cloud pricing configurations in the subscription.

func (*DefenderScanner) Scan

func (s *DefenderScanner) Scan(scan bool, config *azqr.ScannerConfig) []DefenderResult

type DiagnosticSettingsScanner

type DiagnosticSettingsScanner struct {
	// contains filtered or unexported fields
}

DiagnosticSettingsScanner - scanner for diagnostic settings

func (*DiagnosticSettingsScanner) Init

Init - Initializes the DiagnosticSettingsScanner

func (*DiagnosticSettingsScanner) ListResourcesWithDiagnosticSettings

func (d *DiagnosticSettingsScanner) ListResourcesWithDiagnosticSettings(resources []*string) (map[string]bool, error)

ListResourcesWithDiagnosticSettings - Lists all resources with diagnostic settings

func (*DiagnosticSettingsScanner) Scan

func (d *DiagnosticSettingsScanner) Scan(resources []*string) map[string]bool

type PrivateEndpointScanner

type PrivateEndpointScanner struct {
	// contains filtered or unexported fields
}

PrivateEndpointScanner - Scanner for Private Endpoints

func (*PrivateEndpointScanner) Init

Init - Initializes the PrivateEndpointScanner

func (*PrivateEndpointScanner) ListResourcesWithPrivateEndpoints

func (s *PrivateEndpointScanner) ListResourcesWithPrivateEndpoints() (map[string]bool, error)

ListResourcesWithPrivateEndpoints - Lists all resources with private endpoints

func (*PrivateEndpointScanner) Scan

func (s *PrivateEndpointScanner) Scan(config *azqr.ScannerConfig) map[string]bool

type PublicIPScanner

type PublicIPScanner struct {
	// contains filtered or unexported fields
}

PublicIPScanner - Scanner for Public IPs

func (*PublicIPScanner) Init

func (s *PublicIPScanner) Init(config *azqr.ScannerConfig) error

Init - Initializes the PublicIPScanner

func (*PublicIPScanner) ListPublicIPs

func (s *PublicIPScanner) ListPublicIPs() (map[string]*armnetwork.PublicIPAddress, error)

ListPublicIPs - Lists all Public IPs

func (*PublicIPScanner) Scan

func (s *PublicIPScanner) Scan(config *azqr.ScannerConfig) map[string]*armnetwork.PublicIPAddress

type ResourceScanner

type ResourceScanner struct{}

func (ResourceScanner) GetAllResources

func (sc ResourceScanner) GetAllResources(ctx context.Context, cred azcore.TokenCredential, subscriptions map[string]string, filters *azqr.Filters) []*azqr.Resource

func (ResourceScanner) GetCountPerResourceType

func (sc ResourceScanner) GetCountPerResourceType(ctx context.Context, cred azcore.TokenCredential, subscriptions map[string]string, recommendations map[string]map[string]azqr.AprlRecommendation) []azqr.ResourceTypeCount

type SubcriptionScanner

type SubcriptionScanner struct{}

func (SubcriptionScanner) ListSubscriptions

func (sc SubcriptionScanner) ListSubscriptions(ctx context.Context, cred azcore.TokenCredential, subscriptionID string, filters *azqr.Filters, options *arm.ClientOptions) map[string]string

Jump to

Keyboard shortcuts

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