Skip to content

Commit

Permalink
Remove repetitive fields initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
romulets committed Jan 9, 2025
1 parent 7c0fdb0 commit ae5f84f
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions internal/inventory/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,64 +66,64 @@ type AssetClassification struct {
// 'internal/inventory/ASSETS.md'. Please keep formatting consistent.
var (
// AWS
AssetClassificationAwsEc2Instance = AssetClassification{Category: CategoryHost, Type: "AWS EC2 Instance"}
AssetClassificationAwsElbV1 = AssetClassification{Category: CategoryLoadBalancer, Type: "AWS Elastic Load Balancer"}
AssetClassificationAwsElbV2 = AssetClassification{Category: CategoryLoadBalancer, Type: "AWS Elastic Load Balancer v2"}
AssetClassificationAwsIamPolicy = AssetClassification{Category: CategoryAccessManagement, Type: "AWS IAM Policy"}
AssetClassificationAwsIamRole = AssetClassification{Category: CategoryServiceAccount, Type: "AWS IAM Role"}
AssetClassificationAwsIamUser = AssetClassification{Category: CategoryIdentity, Type: "AWS IAM User"}
AssetClassificationAwsLambdaEventSourceMapping = AssetClassification{Category: CategoryFaaS, Type: "AWS Lambda Event Source Mapping"}
AssetClassificationAwsLambdaFunction = AssetClassification{Category: CategoryFaaS, Type: "AWS Lambda Function"}
AssetClassificationAwsLambdaLayer = AssetClassification{Category: CategoryFaaS, Type: "AWS Lambda Layer"}
AssetClassificationAwsInternetGateway = AssetClassification{Category: CategoryGateway, Type: "AWS Internet Gateway"}
AssetClassificationAwsNatGateway = AssetClassification{Category: CategoryGateway, Type: "AWS NAT Gateway"}
AssetClassificationAwsNetworkAcl = AssetClassification{Category: CategoryNetworking, Type: "AWS EC2 Network ACL"}
AssetClassificationAwsNetworkInterface = AssetClassification{Category: CategoryNetworking, Type: "AWS EC2 Network Interface"}
AssetClassificationAwsSecurityGroup = AssetClassification{Category: CategoryFirewall, Type: "AWS EC2 Security Group"}
AssetClassificationAwsSubnet = AssetClassification{Category: CategoryNetworking, Type: "AWS EC2 Subnet"}
AssetClassificationAwsTransitGateway = AssetClassification{Category: CategoryGateway, Type: "AWS Transit Gateway"}
AssetClassificationAwsTransitGatewayAttachment = AssetClassification{Category: CategoryGateway, Type: "AWS Transit Gateway Attachment"}
AssetClassificationAwsVpcPeeringConnection = AssetClassification{Category: CategoryNetworking, Type: "AWS VPC Peering Connection"}
AssetClassificationAwsVpc = AssetClassification{Category: CategoryNetworking, Type: "AWS VPC"}
AssetClassificationAwsRds = AssetClassification{Category: CategoryDatabase, Type: "AWS RDS Instance"}
AssetClassificationAwsS3Bucket = AssetClassification{Category: CategoryStorageBucket, Type: "AWS S3 Bucket"}
AssetClassificationAwsSnsTopic = AssetClassification{Category: CategoryMessagingService, Type: "AWS SNS Topic"}
AssetClassificationAwsEc2Instance = AssetClassification{CategoryHost, "AWS EC2 Instance"}
AssetClassificationAwsElbV1 = AssetClassification{CategoryLoadBalancer, "AWS Elastic Load Balancer"}
AssetClassificationAwsElbV2 = AssetClassification{CategoryLoadBalancer, "AWS Elastic Load Balancer v2"}
AssetClassificationAwsIamPolicy = AssetClassification{CategoryAccessManagement, "AWS IAM Policy"}
AssetClassificationAwsIamRole = AssetClassification{CategoryServiceAccount, "AWS IAM Role"}
AssetClassificationAwsIamUser = AssetClassification{CategoryIdentity, "AWS IAM User"}
AssetClassificationAwsLambdaEventSourceMapping = AssetClassification{CategoryFaaS, "AWS Lambda Event Source Mapping"}
AssetClassificationAwsLambdaFunction = AssetClassification{CategoryFaaS, "AWS Lambda Function"}
AssetClassificationAwsLambdaLayer = AssetClassification{CategoryFaaS, "AWS Lambda Layer"}
AssetClassificationAwsInternetGateway = AssetClassification{CategoryGateway, "AWS Internet Gateway"}
AssetClassificationAwsNatGateway = AssetClassification{CategoryGateway, "AWS NAT Gateway"}
AssetClassificationAwsNetworkAcl = AssetClassification{CategoryNetworking, "AWS EC2 Network ACL"}
AssetClassificationAwsNetworkInterface = AssetClassification{CategoryNetworking, "AWS EC2 Network Interface"}
AssetClassificationAwsSecurityGroup = AssetClassification{CategoryFirewall, "AWS EC2 Security Group"}
AssetClassificationAwsSubnet = AssetClassification{CategoryNetworking, "AWS EC2 Subnet"}
AssetClassificationAwsTransitGateway = AssetClassification{CategoryGateway, "AWS Transit Gateway"}
AssetClassificationAwsTransitGatewayAttachment = AssetClassification{CategoryGateway, "AWS Transit Gateway Attachment"}
AssetClassificationAwsVpcPeeringConnection = AssetClassification{CategoryNetworking, "AWS VPC Peering Connection"}
AssetClassificationAwsVpc = AssetClassification{CategoryNetworking, "AWS VPC"}
AssetClassificationAwsRds = AssetClassification{CategoryDatabase, "AWS RDS Instance"}
AssetClassificationAwsS3Bucket = AssetClassification{CategoryStorageBucket, "AWS S3 Bucket"}
AssetClassificationAwsSnsTopic = AssetClassification{CategoryMessagingService, "AWS SNS Topic"}

// Azure
AssetClassificationAzureAppService = AssetClassification{Category: CategoryWebService, Type: "Azure App Service"}
AssetClassificationAzureContainerRegistry = AssetClassification{Category: CategoryContainerRegistry, Type: "Azure Container Registry"}
AssetClassificationAzureCosmosDBAccount = AssetClassification{Category: CategoryInfrastructure, Type: "Azure Cosmos DB Account"}
AssetClassificationAzureCosmosDBSQLDatabase = AssetClassification{Category: CategoryInfrastructure, Type: "Azure Cosmos DB SQL Database"}
AssetClassificationAzureDisk = AssetClassification{Category: CategoryVolume, Type: "Azure Disk"}
AssetClassificationAzureElasticPool = AssetClassification{Category: CategoryDatabase, Type: "Azure Elastic Pool"}
AssetClassificationAzureResourceGroup = AssetClassification{Category: CategoryAccessManagement, Type: "Azure Resource Group"}
AssetClassificationAzureSQLDatabase = AssetClassification{Category: CategoryDatabase, Type: "Azure SQL Database"}
AssetClassificationAzureSQLServer = AssetClassification{Category: CategoryDatabase, Type: "Azure SQL Server"}
AssetClassificationAzureServicePrincipal = AssetClassification{Category: CategoryIdentity, Type: "Azure Principal"}
AssetClassificationAzureSnapshot = AssetClassification{Category: CategorySnapshot, Type: "Azure Snapshot"}
AssetClassificationAzureStorageAccount = AssetClassification{Category: CategoryPrivateEndpoint, Type: "Azure Storage Account"}
AssetClassificationAzureStorageBlobService = AssetClassification{Category: CategoryStorageBucket, Type: "Azure Storage Blob Service"}
AssetClassificationAzureStorageQueue = AssetClassification{Category: CategoryMessagingService, Type: "Azure Storage Queue"}
AssetClassificationAzureStorageQueueService = AssetClassification{Category: CategoryMessagingService, Type: "Azure Storage Queue Service"}
AssetClassificationAzureSubscription = AssetClassification{Category: CategoryAccessManagement, Type: "Azure Subscription"}
AssetClassificationAzureTenant = AssetClassification{Category: CategoryAccessManagement, Type: "Azure Tenant"}
AssetClassificationAzureVirtualMachine = AssetClassification{Category: CategoryHost, Type: "Azure Virtual Machine"}
AssetClassificationAzureAppService = AssetClassification{CategoryWebService, "Azure App Service"}
AssetClassificationAzureContainerRegistry = AssetClassification{CategoryContainerRegistry, "Azure Container Registry"}
AssetClassificationAzureCosmosDBAccount = AssetClassification{CategoryInfrastructure, "Azure Cosmos DB Account"}
AssetClassificationAzureCosmosDBSQLDatabase = AssetClassification{CategoryInfrastructure, "Azure Cosmos DB SQL Database"}
AssetClassificationAzureDisk = AssetClassification{CategoryVolume, "Azure Disk"}
AssetClassificationAzureElasticPool = AssetClassification{CategoryDatabase, "Azure Elastic Pool"}
AssetClassificationAzureResourceGroup = AssetClassification{CategoryAccessManagement, "Azure Resource Group"}
AssetClassificationAzureSQLDatabase = AssetClassification{CategoryDatabase, "Azure SQL Database"}
AssetClassificationAzureSQLServer = AssetClassification{CategoryDatabase, "Azure SQL Server"}
AssetClassificationAzureServicePrincipal = AssetClassification{CategoryIdentity, "Azure Principal"}
AssetClassificationAzureSnapshot = AssetClassification{CategorySnapshot, "Azure Snapshot"}
AssetClassificationAzureStorageAccount = AssetClassification{CategoryPrivateEndpoint, "Azure Storage Account"}
AssetClassificationAzureStorageBlobService = AssetClassification{CategoryStorageBucket, "Azure Storage Blob Service"}
AssetClassificationAzureStorageQueue = AssetClassification{CategoryMessagingService, "Azure Storage Queue"}
AssetClassificationAzureStorageQueueService = AssetClassification{CategoryMessagingService, "Azure Storage Queue Service"}
AssetClassificationAzureSubscription = AssetClassification{CategoryAccessManagement, "Azure Subscription"}
AssetClassificationAzureTenant = AssetClassification{CategoryAccessManagement, "Azure Tenant"}
AssetClassificationAzureVirtualMachine = AssetClassification{CategoryHost, "Azure Virtual Machine"}

// GCP
AssetClassificationGcpProject = AssetClassification{Category: CategoryAccount, Type: "GCP Project"}
AssetClassificationGcpOrganization = AssetClassification{Category: CategoryOrganization, Type: "GCP Organization"}
AssetClassificationGcpFolder = AssetClassification{Category: CategoryOrganization, Type: "GCP Folder"}
AssetClassificationGcpInstance = AssetClassification{Category: CategoryHost, Type: "GCP Compute Instance"}
AssetClassificationGcpBucket = AssetClassification{Category: CategoryStorageBucket, Type: "GCP Bucket"}
AssetClassificationGcpFirewall = AssetClassification{Category: CategoryFirewall, Type: "GCP Firewall"}
AssetClassificationGcpSubnet = AssetClassification{Category: CategorySubnet, Type: "GCP Subnet"}
AssetClassificationGcpServiceAccount = AssetClassification{Category: CategoryAccessManagement, Type: "GCP Service Account"}
AssetClassificationGcpServiceAccountKey = AssetClassification{Category: CategoryAccessManagement, Type: "GCP Service Account Key"}
AssetClassificationGcpGkeCluster = AssetClassification{Category: CategoryOrchestrator, Type: "GCP Kubernetes Engine (GKE) Cluster"}
AssetClassificationGcpForwardingRule = AssetClassification{Category: CategoryLoadBalancer, Type: "GCP Load Balancing Forwarding Rule"}
AssetClassificationGcpIamRole = AssetClassification{Category: CategoryServiceUsageTechnology, Type: "GCP IAM Role"}
AssetClassificationGcpCloudFunction = AssetClassification{Category: CategoryFaaS, Type: "GCP Cloud Function"}
AssetClassificationGcpCloudRunService = AssetClassification{Category: CategoryContainerService, Type: "GCP Cloud Run Service"}
AssetClassificationGcpProject = AssetClassification{CategoryAccount, "GCP Project"}
AssetClassificationGcpOrganization = AssetClassification{CategoryOrganization, "GCP Organization"}
AssetClassificationGcpFolder = AssetClassification{CategoryOrganization, "GCP Folder"}
AssetClassificationGcpInstance = AssetClassification{CategoryHost, "GCP Compute Instance"}
AssetClassificationGcpBucket = AssetClassification{CategoryStorageBucket, "GCP Bucket"}
AssetClassificationGcpFirewall = AssetClassification{CategoryFirewall, "GCP Firewall"}
AssetClassificationGcpSubnet = AssetClassification{CategorySubnet, "GCP Subnet"}
AssetClassificationGcpServiceAccount = AssetClassification{CategoryAccessManagement, "GCP Service Account"}
AssetClassificationGcpServiceAccountKey = AssetClassification{CategoryAccessManagement, "GCP Service Account Key"}
AssetClassificationGcpGkeCluster = AssetClassification{CategoryOrchestrator, "GCP Kubernetes Engine (GKE) Cluster"}
AssetClassificationGcpForwardingRule = AssetClassification{CategoryLoadBalancer, "GCP Load Balancing Forwarding Rule"}
AssetClassificationGcpIamRole = AssetClassification{CategoryServiceUsageTechnology, "GCP IAM Role"}
AssetClassificationGcpCloudFunction = AssetClassification{CategoryFaaS, "GCP Cloud Function"}
AssetClassificationGcpCloudRunService = AssetClassification{CategoryContainerService, "GCP Cloud Run Service"}
)

// AssetEvent holds the whole asset
Expand Down

0 comments on commit ae5f84f

Please sign in to comment.