fetchers

package
v0.0.0-...-ef0304c Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

In order to simplify the mappings, we are trying to query all AzureAssetTypeToTypePair on every asset group Because this is done with an "|"" this means that we won't get irrelevant data

View Source
var AzureAssetTypeToTypePair = map[string]typePair{
	inventory.ClassicStorageAccountAssetType:     newPair(fetching.AzureClassicStorageAccountType, fetching.CloudStorage),
	inventory.DiskAssetType:                      newPair(fetching.AzureDiskType, fetching.CloudCompute),
	inventory.DocumentDBDatabaseAccountAssetType: newPair(fetching.AzureDocumentDBDatabaseAccountType, fetching.CloudDatabase),
	inventory.MySQLDBAssetType:                   newPair(fetching.AzureMySQLDBType, fetching.CloudDatabase),
	inventory.FlexibleMySQLDBAssetType:           newPair(fetching.AzureFlexibleMySQLDBType, fetching.CloudDatabase),
	inventory.NetworkWatchersFlowLogAssetType:    newPair(fetching.AzureNetworkWatchersFlowLogType, fetching.MonitoringIdentity),
	inventory.FlexiblePostgreSQLDBAssetType:      newPair(fetching.AzureFlexiblePostgreSQLDBType, fetching.CloudDatabase),
	inventory.PostgreSQLDBAssetType:              newPair(fetching.AzurePostgreSQLDBType, fetching.CloudDatabase),
	inventory.SQLServersAssetType:                newPair(fetching.AzureSQLServerType, fetching.CloudDatabase),
	inventory.StorageAccountAssetType:            newPair(fetching.AzureStorageAccountType, fetching.CloudStorage),
	inventory.VirtualMachineAssetType:            newPair(fetching.AzureVMType, fetching.CloudCompute),
	inventory.WebsitesAssetType:                  newPair(fetching.AzureWebSiteType, fetching.CloudCompute),
	inventory.VaultAssetType:                     newPair(fetching.AzureVaultType, fetching.KeyManagement),
	inventory.RoleDefinitionsType:                newPair(fetching.AzureRoleDefinitionType, fetching.CloudIdentity),

	inventory.NetworkSecurityGroupAssetType: newPair(fetching.AzureNetworkSecurityGroupType, fetching.MonitoringIdentity),
}
View Source
var AzureBatchAssetGroups = []string{inventory.AssetGroupResources}

In order to simplify the mappings, we are trying to query all AzureBatchAssets on every asset group Because this is done with an "|"" this means that we won't get irrelevant data

Functions

This section is empty.

Types

type AssetsEnricher

type AssetsEnricher interface {
	Enrich(ctx context.Context, cycleMetadata cycle.Metadata, assets []inventory.AzureAsset) error
}

type AzureAssetsFetcher

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

func NewAzureAssetsFetcher

func NewAzureAssetsFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, provider azurelib.ProviderAPI) *AzureAssetsFetcher

func (*AzureAssetsFetcher) Fetch

func (f *AzureAssetsFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (*AzureAssetsFetcher) Stop

func (f *AzureAssetsFetcher) Stop()

type AzureBatchAssetFetcher

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

func NewAzureBatchAssetFetcher

func NewAzureBatchAssetFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, provider azurelib.ProviderAPI) *AzureBatchAssetFetcher

func (*AzureBatchAssetFetcher) Fetch

func (f *AzureBatchAssetFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (*AzureBatchAssetFetcher) Stop

func (f *AzureBatchAssetFetcher) Stop()

type AzureBatchResource

type AzureBatchResource struct {
	Subscription governance.Subscription
	Assets       []inventory.AzureAsset `json:"assets,omitempty"`
	// contains filtered or unexported fields
}

func (*AzureBatchResource) GetData

func (r *AzureBatchResource) GetData() any

func (*AzureBatchResource) GetElasticCommonData

func (r *AzureBatchResource) GetElasticCommonData() (map[string]any, error)

func (*AzureBatchResource) GetMetadata

func (r *AzureBatchResource) GetMetadata() (fetching.ResourceMetadata, error)

type AzureInsightsBatchAssetFetcher

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

func NewAzureInsightsBatchAssetFetcher

func NewAzureInsightsBatchAssetFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, provider azurelib.ProviderAPI) *AzureInsightsBatchAssetFetcher

func (*AzureInsightsBatchAssetFetcher) Fetch

func (f *AzureInsightsBatchAssetFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (*AzureInsightsBatchAssetFetcher) Stop

type AzureLocationsNetworkWatcherAssetBatchFetcher

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

func (*AzureLocationsNetworkWatcherAssetBatchFetcher) Fetch

func (*AzureLocationsNetworkWatcherAssetBatchFetcher) Stop

type AzureResource

type AzureResource struct {
	Type         string
	SubType      string
	Asset        inventory.AzureAsset `json:"asset,omitempty"`
	Subscription governance.Subscription
}

func (*AzureResource) GetData

func (r *AzureResource) GetData() any

func (*AzureResource) GetElasticCommonData

func (r *AzureResource) GetElasticCommonData() (map[string]any, error)

func (*AzureResource) GetMetadata

func (r *AzureResource) GetMetadata() (fetching.ResourceMetadata, error)

type AzureSecurityAssetFetcher

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

func NewAzureSecurityAssetFetcher

func NewAzureSecurityAssetFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, provider azurelib.ProviderAPI) *AzureSecurityAssetFetcher

func (*AzureSecurityAssetFetcher) Fetch

func (f *AzureSecurityAssetFetcher) Fetch(ctx context.Context, cycleMetadata cycle.Metadata) error

func (*AzureSecurityAssetFetcher) Stop

func (f *AzureSecurityAssetFetcher) Stop()

type MockAssetsEnricher

type MockAssetsEnricher struct {
	mock.Mock
}

MockAssetsEnricher is an autogenerated mock type for the AssetsEnricher type

func NewMockAssetsEnricher

func NewMockAssetsEnricher(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockAssetsEnricher

NewMockAssetsEnricher creates a new instance of MockAssetsEnricher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockAssetsEnricher) EXPECT

func (*MockAssetsEnricher) Enrich

func (_m *MockAssetsEnricher) Enrich(ctx context.Context, cycleMetadata cycle.Metadata, assets []inventory.AzureAsset) error

Enrich provides a mock function with given fields: ctx, cycleMetadata, assets

type MockAssetsEnricher_Enrich_Call

type MockAssetsEnricher_Enrich_Call struct {
	*mock.Call
}

MockAssetsEnricher_Enrich_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Enrich'

func (*MockAssetsEnricher_Enrich_Call) Return

func (*MockAssetsEnricher_Enrich_Call) Run

func (*MockAssetsEnricher_Enrich_Call) RunAndReturn

type MockAssetsEnricher_Expecter

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

func (*MockAssetsEnricher_Expecter) Enrich

func (_e *MockAssetsEnricher_Expecter) Enrich(ctx interface{}, cycleMetadata interface{}, assets interface{}) *MockAssetsEnricher_Enrich_Call

Enrich is a helper method to define mock.On call

  • ctx context.Context
  • cycleMetadata cycle.Metadata
  • assets []inventory.AzureAsset

type NetworkWatchersBatchedByLocationResource

type NetworkWatchersBatchedByLocationResource struct {
	Subscription    governance.Subscription `json:"subscription"`
	Location        inventory.AzureAsset    `json:"location"`
	NetworkWatchers []inventory.AzureAsset  `json:"networkWatchers,omitempty"`
	// contains filtered or unexported fields
}

func (*NetworkWatchersBatchedByLocationResource) GetData

func (*NetworkWatchersBatchedByLocationResource) GetElasticCommonData

func (r *NetworkWatchersBatchedByLocationResource) GetElasticCommonData() (map[string]any, error)

func (*NetworkWatchersBatchedByLocationResource) GetMetadata

Jump to

Keyboard shortcuts

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