├── .editorconfig ├── .github ├── magpie-cspm-flow_v2.png └── workflows │ ├── maven.yml │ └── release.yaml ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yaml ├── magpie-api ├── README.md ├── media │ └── magpie_architecture.png ├── pom.xml └── src │ └── main │ └── java │ └── io │ └── openraven │ └── magpie │ └── api │ ├── EmitFailedException.java │ ├── Emitter.java │ ├── IntermediatePlugin.java │ ├── MagpieAwsResource.java │ ├── MagpieAzureResource.java │ ├── MagpieEnvelope.java │ ├── MagpieGcpResource.java │ ├── MagpiePlugin.java │ ├── OriginPlugin.java │ ├── PolicyOutputPlugin.java │ ├── Session.java │ ├── TerminalPlugin.java │ └── utils │ └── EncodedNamedUUIDGenerator.java ├── magpie-aws ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── openraven │ │ │ └── magpie │ │ │ └── plugins │ │ │ └── aws │ │ │ └── discovery │ │ │ ├── AWSDiscoveryConfig.java │ │ │ ├── AWSDiscoveryPlugin.java │ │ │ ├── AWSUtils.java │ │ │ ├── BackupUtils.java │ │ │ ├── ClientCreators.java │ │ │ ├── Conversions.java │ │ │ ├── DiscoveryExceptions.java │ │ │ ├── EncodedNamedUUIDGenerator.java │ │ │ ├── MagpieAWSClientCreator.java │ │ │ ├── VersionProvider.java │ │ │ ├── VersionedMagpieEnvelopeProvider.java │ │ │ ├── exception │ │ │ └── AwsDiscoveryException.java │ │ │ └── services │ │ │ ├── AWSDiscovery.java │ │ │ ├── AthenaDiscovery.java │ │ │ ├── BackupDiscovery.java │ │ │ ├── BatchDiscovery.java │ │ │ ├── CassandraDiscovery.java │ │ │ ├── CloudFrontDiscovery.java │ │ │ ├── CloudSearchDiscovery.java │ │ │ ├── CloudTrailDiscovery.java │ │ │ ├── CloudWatchDiscovery.java │ │ │ ├── CloudWatchLogsDiscovery.java │ │ │ ├── ConfigDiscovery.java │ │ │ ├── DynamoDbDiscovery.java │ │ │ ├── EBDiscovery.java │ │ │ ├── EC2Discovery.java │ │ │ ├── EC2StorageDiscovery.java │ │ │ ├── ECSDiscovery.java │ │ │ ├── EFSDiscovery.java │ │ │ ├── EKSDiscovery.java │ │ │ ├── ELBDiscovery.java │ │ │ ├── ELBV2Discovery.java │ │ │ ├── EMRDiscovery.java │ │ │ ├── ENIDiscovery.java │ │ │ ├── ESDiscovery.java │ │ │ ├── ElastiCacheDiscovery.java │ │ │ ├── FSXDiscovery.java │ │ │ ├── GlacierDiscovery.java │ │ │ ├── GuardDutyDiscovery.java │ │ │ ├── IAMCredential.java │ │ │ ├── IAMDiscovery.java │ │ │ ├── KMSDiscovery.java │ │ │ ├── LakeFormationDiscovery.java │ │ │ ├── LambdaDiscovery.java │ │ │ ├── LightsailDiscovery.java │ │ │ ├── LocationDiscovery.java │ │ │ ├── OrganizationDiscovery.java │ │ │ ├── QLDBDiscovery.java │ │ │ ├── RDSDiscovery.java │ │ │ ├── RedshiftDiscovery.java │ │ │ ├── RegionDiscovery.java │ │ │ ├── Route53Discovery.java │ │ │ ├── S3Discovery.java │ │ │ ├── SNSDiscovery.java │ │ │ ├── SSMDiscovery.java │ │ │ ├── SecretsManagerDiscovery.java │ │ │ ├── SecurityHubDiscovery.java │ │ │ ├── StorageGatewayDiscovery.java │ │ │ └── VPCDiscovery.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.openraven.magpie.api.OriginPlugin │ └── test │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── plugins │ │ └── aws │ │ └── discovery │ │ ├── AWSDiscoveryPluginTest.java │ │ └── services │ │ ├── DynamoDbDiscoveryIT.java │ │ ├── EC2DiscoveryIT.java │ │ ├── IAMAccountDiscoveryIT.java │ │ ├── IAMCredentialReportDiscoveryIT.java │ │ ├── IAMGroupDiscoveryIT.java │ │ ├── IAMPolicyDiscoveryIT.java │ │ ├── IAMRoleDiscoveryIT.java │ │ ├── LambdaDiscoveryIT.java │ │ ├── Route53DiscoveryIT.java │ │ ├── S3DiscoveryIT.java │ │ ├── SNSDiscoveryIT.java │ │ ├── SecretsManagerDiscoveryIT.java │ │ ├── base │ │ ├── BaseAWSServiceIT.java │ │ └── BaseIAMServiceIT.java │ │ └── disabled │ │ ├── CloudWatchDiscoveryIT.java │ │ ├── KMSDiscoveryIT.java │ │ └── RedshiftDiscoveryIT.java │ └── resources │ ├── demo │ ├── docker-compose.yml │ └── template │ │ ├── iam-s3-dynamo-template.yml │ │ └── sample │ │ └── role-base.yml │ ├── document │ ├── policy-dynamodb-access.json │ ├── policy-dynamodb-inline.json │ └── policy-dynamodb-updated-access.json │ ├── logback-test.xml │ └── template │ ├── cloudwatch-template.yml │ ├── dynamo-db-template.yml │ ├── ec2-template.yml │ ├── empty-stack.yml │ ├── iam-group-template.yml │ ├── iam-policy-template.yml │ ├── iam-role-template.yml │ ├── iam-template.yml │ ├── kms-template.yml │ ├── lambda-template.yml │ ├── redshift-template.yml │ ├── route53-template.yml │ ├── s3-template.yml │ ├── secret-template.yml │ └── sns-subscription-template.yml ├── magpie-azure ├── .gitignore ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── plugins │ │ └── azure │ │ └── discovery │ │ ├── AzureDiscoveryConfig.java │ │ ├── AzureDiscoveryPlugin.java │ │ ├── AzureUtils.java │ │ ├── VersionProvider.java │ │ ├── VersionedMagpieEnvelopeProvider.java │ │ ├── exception │ │ └── AzureDiscoveryException.java │ │ └── services │ │ ├── AzureDiscovery.java │ │ ├── SQLDiscovery.java │ │ ├── StorageDiscovery.java │ │ └── SubscriptionDiscovery.java │ └── resources │ └── META-INF │ └── services │ └── io.openraven.magpie.api.OriginPlugin ├── magpie-cli ├── pom.xml └── src │ ├── assembly │ ├── assembly.xml │ └── files │ │ ├── config.yaml │ │ ├── logging.xml │ │ ├── magpie-discovery │ │ ├── magpie-discovery.bat │ │ ├── magpie-policy │ │ ├── magpie-policy.bat │ │ ├── magpie.sh │ │ └── plugins │ │ └── plugins.txt │ └── main │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── cli │ │ ├── Discovery.java │ │ └── Policy.java │ └── resources │ └── logback.xml ├── magpie-core ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── openraven │ │ └── magpie │ │ └── core │ │ ├── Orchestrator.java │ │ ├── config │ │ ├── ConfigException.java │ │ ├── ConfigUtils.java │ │ ├── FifoConfig.java │ │ ├── LayerConfig.java │ │ ├── MagpieConfig.java │ │ ├── PluginConfig.java │ │ ├── PolicyConfig.java │ │ └── ServiceConfig.java │ │ ├── cspm │ │ ├── CspmSerializationException.java │ │ ├── analysis │ │ │ ├── IgnoredRule.java │ │ │ ├── ScanMetadata.java │ │ │ ├── ScanResults.java │ │ │ └── Violation.java │ │ ├── model │ │ │ ├── Policy.java │ │ │ ├── PolicyContext.java │ │ │ ├── PolicyMetadata.java │ │ │ ├── Rule.java │ │ │ └── Severity.java │ │ └── services │ │ │ ├── CspmFacade.java │ │ │ ├── CspmFacadeImpl.java │ │ │ ├── PolicyAcquisitionService.java │ │ │ ├── PolicyAcquisitionServiceImpl.java │ │ │ ├── PolicyAnalyzerService.java │ │ │ └── PolicyAnalyzerServiceImpl.java │ │ ├── fifos │ │ ├── FifoDequeue.java │ │ ├── FifoException.java │ │ ├── FifoManager.java │ │ ├── FifoQueue.java │ │ ├── KafkaDequeue.java │ │ ├── KafkaQueue.java │ │ ├── LocalQueue.java │ │ └── QueueType.java │ │ ├── layers │ │ ├── IntermediateLayer.java │ │ ├── Layer.java │ │ ├── LayerManager.java │ │ ├── LayerType.java │ │ ├── OriginLayer.java │ │ └── TerminalLayer.java │ │ └── plugins │ │ ├── IdentityPlugin.java │ │ ├── PluginLoaderException.java │ │ └── PluginManager.java │ └── test │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── core │ │ ├── FifoManagerTest.java │ │ ├── config │ │ └── ConfigUtilsTest.java │ │ ├── cspm │ │ └── services │ │ │ ├── AbstractRuleValidator.java │ │ │ ├── PolicyAnalyzerServiceIT.java │ │ │ └── SecurityRuleValidator.java │ │ ├── fifos │ │ └── KafkaDequeueTest.java │ │ ├── plugins │ │ ├── MagpieTestConfig.java │ │ ├── MagpieTestPlugin.java │ │ ├── MagpieTestPlugin2.java │ │ └── PluginManagerTest.java │ │ └── util │ │ └── LoggerStubAppender.java │ └── resources │ ├── META-INF │ └── services │ │ └── io.openraven.magpie.api.OriginPlugin │ ├── dmap │ └── finger-print-analysis.json │ ├── env.json │ ├── fifoconfig │ └── simple.yaml │ ├── logback.xml │ ├── pluginconfig │ └── simple.yaml │ └── sql │ ├── aws-asset-credential-report.sql │ ├── aws-ec2-dmap-scan-targets.sql │ ├── rule-sql-with-available-asset.sql │ └── rule-sql-with-missed-asset.sql ├── magpie-data ├── LICENSE ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── openraven │ │ └── magpie │ │ └── data │ │ ├── Resource.java │ │ ├── aws │ │ ├── AWSResource.java │ │ ├── Envelope.java │ │ ├── accounts │ │ │ ├── AccountResource.java │ │ │ ├── Credential.java │ │ │ ├── IamAccount.java │ │ │ ├── IamCredentialsReport.java │ │ │ ├── IamGroup.java │ │ │ ├── IamPolicy.java │ │ │ ├── IamRole.java │ │ │ ├── IamUser.java │ │ │ ├── ShadowAccountResource.java │ │ │ └── UserCredentialReport.java │ │ ├── athena │ │ │ └── AthenaDataCatalog.java │ │ ├── backup │ │ │ ├── BackupPlan.java │ │ │ └── BackupVault.java │ │ ├── batch │ │ │ ├── BatchComputeEnvironment.java │ │ │ ├── BatchJobDefinition.java │ │ │ └── BatchJobQueue.java │ │ ├── cassandra │ │ │ └── CassandraKeyspace.java │ │ ├── cloudfront │ │ │ └── CloudFrontDistribution.java │ │ ├── cloudsearch │ │ │ └── CloudSearchDomain.java │ │ ├── cloudtrail │ │ │ └── CloudTrail.java │ │ ├── cloudwatch │ │ │ ├── CloudWatchAlarm.java │ │ │ ├── CloudWatchDashboard.java │ │ │ ├── CloudWatchLogGroup.java │ │ │ └── CloudWatchLogsMetricFilter.java │ │ ├── config │ │ │ └── AwsConfigurationRecorder.java │ │ ├── dynamodb │ │ │ ├── DynamoDbGlobalTable.java │ │ │ └── DynamoDbTable.java │ │ ├── eb │ │ │ └── EbEnvironment.java │ │ ├── ec2 │ │ │ ├── EC2SecurityGroup.java │ │ │ ├── Ec2ElasticIpAddress.java │ │ │ ├── Ec2Instance.java │ │ │ ├── Ec2NetworkAcl.java │ │ │ ├── Ec2NetworkInterface.java │ │ │ ├── Ec2Subnet.java │ │ │ ├── Ec2TransitGateway.java │ │ │ ├── Ec2VpcPeeringConnection.java │ │ │ ├── Ec2VpcResource.java │ │ │ └── RegionResource.java │ │ ├── ec2storage │ │ │ ├── EC2Snapshot.java │ │ │ └── EC2Volume.java │ │ ├── ecs │ │ │ └── EcsCluster.java │ │ ├── efs │ │ │ └── EfsFileSystem.java │ │ ├── eks │ │ │ └── EksCluster.java │ │ ├── elasticache │ │ │ └── ElastiCacheCluster.java │ │ ├── elb │ │ │ └── ElasticLoadBalancingLoadBalancer.java │ │ ├── elbv2 │ │ │ └── ElasticLoadBalancingV2LoadBalancer.java │ │ ├── emr │ │ │ └── EmrCluster.java │ │ ├── ess │ │ │ └── EssDomain.java │ │ ├── fsx │ │ │ └── FSxFileSystem.java │ │ ├── glacier │ │ │ └── GlacierVault.java │ │ ├── guardduty │ │ │ └── GuardDutyDetector.java │ │ ├── kms │ │ │ └── KmsKey.java │ │ ├── lakeformation │ │ │ └── LakeFormationResource.java │ │ ├── lambda │ │ │ └── LambdaFunction.java │ │ ├── lightsail │ │ │ ├── LightsailDatabase.java │ │ │ ├── LightsailInstance.java │ │ │ └── LightsailLoadBalancer.java │ │ ├── location │ │ │ ├── LocationGeofenceCollection.java │ │ │ ├── LocationMap.java │ │ │ ├── LocationPlaceIndex.java │ │ │ ├── LocationRouteCalculator.java │ │ │ └── LocationTracker.java │ │ ├── neptune │ │ │ ├── NeptuneCluster.java │ │ │ └── NeptuneInstance.java │ │ ├── organisation │ │ │ └── ServiceControlPolicy.java │ │ ├── qldb │ │ │ └── QldbLedger.java │ │ ├── rds │ │ │ ├── RDSInstance.java │ │ │ ├── RDSProxy.java │ │ │ └── RDSSnapshot.java │ │ ├── redshift │ │ │ └── RedshiftCluster.java │ │ ├── route53 │ │ │ └── Route53HostedZone.java │ │ ├── s3 │ │ │ └── S3Bucket.java │ │ ├── s3objects │ │ │ └── S3BucketObject.java │ │ ├── secretsmanager │ │ │ └── SecretsManagerSecret.java │ │ ├── securityhub │ │ │ └── SecurityHubStandardSubscription.java │ │ ├── shared │ │ │ ├── Conversions.java │ │ │ ├── LocalDiscovery.java │ │ │ ├── PayloadUtils.java │ │ │ └── ResourceType.java │ │ ├── sns │ │ │ ├── SNSSubscription.java │ │ │ └── SNSTopic.java │ │ ├── ssm │ │ │ └── SSMInstance.java │ │ └── storagegateway │ │ │ └── StorageGatewayGateway.java │ │ ├── azure │ │ ├── AzureResource.java │ │ ├── sql │ │ │ ├── SQLDatabase.java │ │ │ └── SQLServer.java │ │ ├── storage │ │ │ ├── StorageAccount.java │ │ │ └── StorageBlobContainer.java │ │ └── subscriptions │ │ │ └── Subscription.java │ │ ├── exception │ │ └── MissingEntityTypeException.java │ │ ├── gcp │ │ ├── GCPResource.java │ │ ├── access │ │ │ └── AccessApproval.java │ │ ├── account │ │ │ ├── GcpIamRole.java │ │ │ └── GcpIamServiceAccount.java │ │ ├── asset │ │ │ ├── Asset.java │ │ │ └── AssetFeed.java │ │ ├── automl │ │ │ ├── AutoMLDataset.java │ │ │ └── AutoMLModel.java │ │ ├── bigquery │ │ │ ├── BigQueryDataTransfer.java │ │ │ ├── BigQueryDataset.java │ │ │ ├── BigQueryReservation.java │ │ │ └── BigQueryReservationCapacity.java │ │ ├── bigtable │ │ │ └── BigTableInstance.java │ │ ├── billing │ │ │ └── BillingAccount.java │ │ ├── cloudbuild │ │ │ ├── CloudBuild.java │ │ │ └── CloudBuildTrigger.java │ │ ├── cluster │ │ │ └── Cluster.java │ │ ├── compute │ │ │ ├── ComputeDisk.java │ │ │ └── ComputeInstance.java │ │ ├── container │ │ │ ├── ContainerAnalysisNote.java │ │ │ └── ContainerAnalysisOccurrence.java │ │ ├── data │ │ │ ├── DataCatalog.java │ │ │ ├── DataLabelingAnnotations.java │ │ │ ├── DataLabelingDataset.java │ │ │ ├── DataLabelingInstruction.java │ │ │ ├── DataProcCluster.java │ │ │ └── DataProcJob.java │ │ ├── dialogflow │ │ │ └── DialogflowConversation.java │ │ ├── dlp │ │ │ ├── DlpJob.java │ │ │ └── DlpJobTrigger.java │ │ ├── dns │ │ │ └── DnsZone.java │ │ ├── error │ │ │ └── ErrorReporting.java │ │ ├── function │ │ │ └── Function.java │ │ ├── game │ │ │ └── GameService.java │ │ ├── iot │ │ │ └── IotDeviceRegistry.java │ │ ├── kms │ │ │ └── KmsKeyring.java │ │ ├── logging │ │ │ ├── LoggingBucket.java │ │ │ ├── LoggingExclusion.java │ │ │ ├── LoggingMetric.java │ │ │ └── LoggingSink.java │ │ ├── memcache │ │ │ └── MemcacheInstance.java │ │ ├── monitoring │ │ │ ├── MonitoringAlertPolicy.java │ │ │ ├── MonitoringDashboard.java │ │ │ ├── MonitoringGroup.java │ │ │ └── MonitoringService.java │ │ ├── osconfig │ │ │ ├── OsConfigPatchDeployment.java │ │ │ └── OsConfigPatchJob.java │ │ ├── project │ │ │ └── ProjectInfo.java │ │ ├── pubsub │ │ │ ├── PubSubSchema.java │ │ │ ├── PubSubSnapshots.java │ │ │ ├── PubSubSubscription.java │ │ │ └── PubSubTopic.java │ │ ├── pubsublite │ │ │ ├── PubSubLiteSubscription.java │ │ │ └── PubSubLiteTopic.java │ │ ├── recaptcha │ │ │ └── RecaptchaEnterpriseKey.java │ │ ├── redis │ │ │ └── RedisInstance.java │ │ ├── resource │ │ │ ├── ResourceManagerFolder.java │ │ │ ├── ResourceManagerOrganization.java │ │ │ └── ResourceManagerProject.java │ │ ├── scheduler │ │ │ └── SchedulerJob.java │ │ ├── secret │ │ │ └── Secret.java │ │ ├── security │ │ │ └── WebSecurity.java │ │ ├── service │ │ │ └── Service.java │ │ ├── spanner │ │ │ └── SpannerInstance.java │ │ ├── sql │ │ │ └── SqlInstance.java │ │ ├── storage │ │ │ └── StorageBucket.java │ │ ├── talent │ │ │ └── Tenant.java │ │ ├── task │ │ │ └── TaskQueue.java │ │ ├── trace │ │ │ └── Trace.java │ │ ├── translate │ │ │ └── Glossary.java │ │ ├── vision │ │ │ ├── Product.java │ │ │ └── ProductSet.java │ │ └── vpc │ │ │ ├── Firewall.java │ │ │ └── Network.java │ │ └── utils │ │ ├── EntityTypeResolver.java │ │ ├── JacksonMapper.java │ │ └── JsonConverter.java │ └── test │ └── java │ └── io │ └── openraven │ └── magpie │ └── data │ └── aws │ └── utils │ └── EntityTypeResolverTest.java ├── magpie-gcp ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── plugins │ │ └── gcp │ │ └── discovery │ │ ├── EncodedNamedUUIDGenerator.java │ │ ├── GCPDiscoveryConfig.java │ │ ├── GCPDiscoveryPlugin.java │ │ ├── GCPUtils.java │ │ ├── VersionProvider.java │ │ ├── VersionedMagpieEnvelopeProvider.java │ │ ├── exception │ │ ├── DiscoveryExceptions.java │ │ └── GcpDiscoveryException.java │ │ └── services │ │ ├── AccessApprovalDiscovery.java │ │ ├── AssetDiscovery.java │ │ ├── AutoMLDiscovery.java │ │ ├── BigQueryDataTransferDiscovery.java │ │ ├── BigQueryDiscovery.java │ │ ├── BigQueryReservationDiscovery.java │ │ ├── BigTableDiscovery.java │ │ ├── BillingDiscovery.java │ │ ├── CloudBuildDiscovery.java │ │ ├── ClusterDiscovery.java │ │ ├── ComputeEngineDiscovery.java │ │ ├── ContainerAnalysisDiscovery.java │ │ ├── DataCatalogDiscovery.java │ │ ├── DataLabelingDiscovery.java │ │ ├── DataprocDiscovery.java │ │ ├── DialogflowDiscovery.java │ │ ├── DlpDiscovery.java │ │ ├── DnsDiscovery.java │ │ ├── ErrorReportingDiscovery.java │ │ ├── FirewallDiscovery.java │ │ ├── FunctionsDiscovery.java │ │ ├── GCPDiscovery.java │ │ ├── GameServicesDiscovery.java │ │ ├── IamDiscovery.java │ │ ├── IoTDiscovery.java │ │ ├── KMSDiscovery.java │ │ ├── LoggingDiscovery.java │ │ ├── MemcacheDiscovery.java │ │ ├── MonitoringDashboardDiscovery.java │ │ ├── MonitoringDiscovery.java │ │ ├── NetworkDiscovery.java │ │ ├── OsConfigDiscovery.java │ │ ├── ProjectDiscovery.java │ │ ├── PubSubDiscovery.java │ │ ├── PubSubLiteDiscovery.java │ │ ├── RecaptchaEnterpriseDiscovery.java │ │ ├── RedisDiscovery.java │ │ ├── ResourceManagerDiscovery.java │ │ ├── SchedulerDiscovery.java │ │ ├── SecretDiscovery.java │ │ ├── ServiceDirectoryDiscovery.java │ │ ├── SpannerDiscovery.java │ │ ├── SqlDiscovery.java │ │ ├── StorageDiscovery.java │ │ ├── TasksDiscovery.java │ │ ├── TenantDiscovery.java │ │ ├── TraceDiscovery.java │ │ ├── TranslateDiscovery.java │ │ ├── VisionDiscovery.java │ │ └── WebSecurityScannerDiscovery.java │ └── resources │ └── META-INF │ └── services │ └── io.openraven.magpie.api.OriginPlugin ├── magpie-json ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── plugins │ │ └── json │ │ └── JSONPlugin.java │ └── resources │ └── META-INF │ └── services │ └── io.openraven.magpie.api.TerminalPlugin ├── magpie-persist ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── openraven │ │ │ └── magpie │ │ │ └── plugins │ │ │ └── persist │ │ │ ├── AssetsRepo.java │ │ │ ├── PersistConfig.java │ │ │ ├── PersistPlugin.java │ │ │ ├── config │ │ │ ├── PostgreSQL10StringDialect.java │ │ │ └── PostgresPersistenceProvider.java │ │ │ ├── impl │ │ │ └── HibernateAssetsRepoImpl.java │ │ │ └── migration │ │ │ └── FlywayMigrationService.java │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ └── io.openraven.magpie.api.TerminalPlugin │ │ └── db │ │ └── migration │ │ ├── V1__create_assets_table.sql │ │ ├── V2__create_static_type_tables.sql │ │ ├── V3__create_subnet_table.sql │ │ ├── V4__create_transit_table.sql │ │ ├── V5__create_orgscp_table.sql │ │ ├── V6__create_rdsproxy_table.sql │ │ └── V7__create_azure_table.sql │ └── test │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── plugins │ │ └── persist │ │ ├── PersistPluginIT.java │ │ └── TestUtils.java │ └── resources │ └── documents │ ├── envelope-content.json │ └── outdated-envelope-content.json ├── magpie-policy-output-csv ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── plugins │ │ └── policy │ │ └── output │ │ └── csv │ │ ├── CsvReportPlugin.java │ │ ├── analysis │ │ ├── IgnoredRule.java │ │ ├── ScanMetadata.java │ │ ├── ScanResults.java │ │ └── Violation.java │ │ ├── exception │ │ └── CsvOutputException.java │ │ └── model │ │ ├── Policy.java │ │ ├── Rule.java │ │ └── Severity.java │ └── resources │ └── META-INF │ └── services │ └── io.openraven.magpie.api.PolicyOutputPlugin ├── magpie-policy-output-json ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── plugins │ │ └── policy │ │ └── output │ │ └── json │ │ ├── JsonReportPlugin.java │ │ ├── analysis │ │ ├── IgnoredRule.java │ │ ├── ScanMetadata.java │ │ ├── ScanResults.java │ │ └── Violation.java │ │ └── model │ │ ├── Policy.java │ │ ├── Rule.java │ │ └── Severity.java │ └── resources │ └── META-INF │ └── services │ └── io.openraven.magpie.api.PolicyOutputPlugin ├── magpie-policy-output-text ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── openraven │ │ └── magpie │ │ └── plugins │ │ └── policy │ │ └── output │ │ └── text │ │ ├── TextReportPlugin.java │ │ ├── analysis │ │ ├── IgnoredRule.java │ │ ├── ScanMetadata.java │ │ ├── ScanResults.java │ │ └── Violation.java │ │ └── model │ │ ├── Policy.java │ │ ├── Rule.java │ │ └── Severity.java │ └── resources │ └── META-INF │ └── services │ └── io.openraven.magpie.api.PolicyOutputPlugin └── pom.xml /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | 9 | [{*.java, *.json, *.xml}] 10 | indent_style = space 11 | indent_size = 2 12 | 13 | # Tab indentation (no size specified) 14 | [Makefile] 15 | indent_style = tab 16 | 17 | 18 | -------------------------------------------------------------------------------- /.github/magpie-cspm-flow_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openraven/magpie/734064674425ce199cc4ea44ad53f15727a75323/.github/magpie-cspm-flow_v2.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/pom.xml.versionsBackup 2 | */dependency-reduced-pom.xml 3 | .DS_Store 4 | target 5 | .idea 6 | *.iml 7 | magpie.log 8 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM maven:3.9.6-amazoncorretto-21-debian-bookworm as builder 2 | RUN mkdir /build/ 3 | COPY ./ /build/ 4 | RUN ls -al /build/ 5 | RUN cd /build/ && mvn clean install -DskipTests && mvn --projects magpie-cli assembly:single -DskipTests 6 | 7 | FROM openjdk:17.0.2-slim-bullseye 8 | COPY --from=builder /build/magpie-cli/target/*.tar.gz /tmp/ 9 | RUN mkdir /magpie 10 | RUN tar -zxvf /tmp/*.tar.gz --strip-components=1 -C magpie 11 | RUN apt update && apt install -y git && apt clean all 12 | WORKDIR /magpie 13 | CMD [] 14 | ENTRYPOINT ["./magpie.sh"] 15 | 16 | 17 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: "3.8" 3 | services: 4 | magpie: 5 | image: magpie:latest 6 | entrypoint: 7 | - /bin/bash 8 | - -c 9 | - sleep infinity 10 | volumes: 11 | # PLEASE CHANGE THE PATH TO THE CONFIG FILE 12 | - ./magpie-cli/src/assembly/files/config.yaml:/magpie/config.yaml 13 | database: 14 | image: postgres:16 15 | environment: 16 | POSTGRES_PASSWORD: magpie 17 | POSTGRES_USER: magpie 18 | POSTGRES_DB: magpie 19 | -------------------------------------------------------------------------------- /magpie-api/media/magpie_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openraven/magpie/734064674425ce199cc4ea44ad53f15727a75323/magpie-api/media/magpie_architecture.png -------------------------------------------------------------------------------- /magpie-api/src/main/java/io/openraven/magpie/api/EmitFailedException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * magpie-api 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | 21 | package io.openraven.magpie.api; 22 | 23 | public class EmitFailedException extends Exception { 24 | 25 | public EmitFailedException(String message) { 26 | super(message); 27 | } 28 | 29 | public EmitFailedException(String message, Throwable cause) { 30 | super(message, cause); 31 | } 32 | 33 | public EmitFailedException(Throwable cause) { 34 | super(cause); 35 | } 36 | 37 | public EmitFailedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 38 | super(message, cause, enableSuppression, writableStackTrace); 39 | } 40 | 41 | public EmitFailedException() { 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /magpie-api/src/main/java/io/openraven/magpie/api/PolicyOutputPlugin.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.api; 21 | 22 | import com.fasterxml.jackson.databind.node.ObjectNode; 23 | 24 | public interface PolicyOutputPlugin extends MagpiePlugin { 25 | 26 | void generateReport(ObjectNode results); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /magpie-api/src/main/java/io/openraven/magpie/api/Session.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * magpie-api 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | 21 | package io.openraven.magpie.api; 22 | 23 | import java.time.Instant; 24 | import java.util.UUID; 25 | 26 | public class Session { 27 | private String id = UUID.randomUUID().toString(); 28 | private Instant createdAt = Instant.now(); 29 | 30 | public String getId() { 31 | return id; 32 | } 33 | 34 | public void setId(String id) { 35 | this.id = id; 36 | } 37 | 38 | public Instant getCreatedAt() { 39 | return createdAt; 40 | } 41 | 42 | public void setCreatedAt(Instant createdAt) { 43 | this.createdAt = createdAt; 44 | } 45 | 46 | 47 | @Override 48 | public String toString() { 49 | return "Session{" + 50 | "id='" + id + '\'' + 51 | ", createdAt=" + createdAt + 52 | '}'; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /magpie-aws/src/main/java/io/openraven/magpie/plugins/aws/discovery/Conversions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.plugins.aws.discovery; 18 | 19 | public class Conversions { 20 | public static long GibToBytes(long gib) { 21 | return gib * 1074000000L; 22 | } 23 | 24 | public static long MibToBytes (long mib) { 25 | return mib * 1049000L; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /magpie-aws/src/main/java/io/openraven/magpie/plugins/aws/discovery/MagpieAWSClientCreator.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.plugins.aws.discovery; 2 | 3 | import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder; 4 | 5 | @FunctionalInterface 6 | public interface MagpieAWSClientCreator { 7 | , ClientT> BuilderT apply(AwsClientBuilder builder); 8 | } 9 | -------------------------------------------------------------------------------- /magpie-aws/src/main/java/io/openraven/magpie/plugins/aws/discovery/exception/AwsDiscoveryException.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.plugins.aws.discovery.exception; 2 | 3 | public class AwsDiscoveryException extends RuntimeException { 4 | 5 | public AwsDiscoveryException(String message, Throwable cause) { 6 | super(message, cause); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /magpie-aws/src/main/resources/META-INF/services/io.openraven.magpie.api.OriginPlugin: -------------------------------------------------------------------------------- 1 | io.openraven.magpie.plugins.aws.discovery.AWSDiscoveryPlugin 2 | -------------------------------------------------------------------------------- /magpie-aws/src/test/java/io/openraven/magpie/plugins/aws/discovery/services/base/BaseIAMServiceIT.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.plugins.aws.discovery.services.base; 2 | 3 | import io.openraven.magpie.plugins.aws.discovery.AWSUtils; 4 | import io.openraven.magpie.plugins.aws.discovery.ClientCreators; 5 | import software.amazon.awssdk.services.iam.IamClient; 6 | import software.amazon.awssdk.services.iam.model.PolicyScopeType; 7 | 8 | public abstract class BaseIAMServiceIT extends BaseAWSServiceIT { 9 | 10 | protected static final IamClient IAMCLIENT = ClientCreators.localClientCreator(BASE_REGION).apply((IamClient.builder())).build(); 11 | 12 | protected static void removePolicies() { 13 | IAMCLIENT.listPolicies(req -> req.scope(PolicyScopeType.LOCAL)) 14 | .policies().forEach(policy -> IAMCLIENT.deletePolicy(req -> req.policyArn(policy.arn()))); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/demo/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | 3 | services: 4 | localstack: 5 | container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}" 6 | image: localstack/localstack:latest 7 | ports: 8 | - "4566:4566" 9 | - "4571:4571" 10 | - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}" 11 | environment: 12 | - SERVICES=dynamodb,s3,cloudformation,iam,sns,route53,redshift,lambda,ec2,kms,secretsmanager 13 | - DEBUG=1 14 | - DATA_DIR=${DATA_DIR- } 15 | - PORT_WEB_UI=${PORT_WEB_UI- } 16 | - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR- } 17 | - KINESIS_ERROR_PROBABILITY=${KINESIS_ERROR_PROBABILITY- } 18 | - DOCKER_HOST=unix:///var/run/docker.sock 19 | - HOST_TMP_FOLDER=${TMPDIR} 20 | - DEFAULT_REGION=us-west-1 21 | volumes: 22 | - "${TMPDIR:-/tmp/localstack}:/tmp/localstack" 23 | - "/var/run/docker.sock:/var/run/docker.sock" 24 | networks: 25 | - localstack_network 26 | networks: 27 | localstack_network: 28 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/demo/template/sample/role-base.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Description: "The Policy and InstanceProfile resources are specified externally to the IAM Role. 3 | They refer to the role by specifying its name, 'RootRole', in their respective Roles properties". 4 | Resources: 5 | RootRole: 6 | Type: "AWS::IAM::Role" 7 | Properties: 8 | AssumeRolePolicyDocument: 9 | Version: "2012-10-17" 10 | Statement: 11 | - 12 | Effect: "Allow" 13 | Principal: 14 | Service: 15 | - "ec2.amazonaws.com" 16 | Action: 17 | - "sts:AssumeRole" 18 | Path: "/" 19 | RolePolicies: 20 | Type: "AWS::IAM::Policy" 21 | Properties: 22 | PolicyName: "root" 23 | PolicyDocument: 24 | Version: "2012-10-17" 25 | Statement: 26 | - Effect: "Allow" 27 | Action: "*" 28 | Resource: "*" 29 | Roles: 30 | - Ref: "RootRole" 31 | RootInstanceProfile: 32 | Type: "AWS::IAM::InstanceProfile" 33 | Properties: 34 | Path: "/" 35 | Roles: 36 | - Ref: "RootRole" 37 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/document/policy-dynamodb-access.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Effect": "Allow", 6 | "Action": [ 7 | "dynamodb:DeleteItem", 8 | "dynamodb:GetItem", 9 | "dynamodb:PutItem", 10 | "dynamodb:Scan", 11 | "dynamodb:UpdateItem" 12 | ], 13 | "Resource": "*" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/document/policy-dynamodb-inline.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Effect": "Deny", 6 | "Action": [ 7 | "dynamodb:DeleteItem", 8 | "dynamodb:GetItem" 9 | ], 10 | "Resource": "*" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/document/policy-dynamodb-updated-access.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version" : "2012-10-17", 3 | "Statement" : [ { 4 | "Effect" : "Deny", 5 | "Action" : [ "dynamodb:GetItem", "dynamodb:PutItem" ], 6 | "Resource" : "*" 7 | } ] 8 | } 9 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.err 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 13 | 14 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/cloudwatch-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Resources: 3 | LambdaInvocationsAnomalyDetector: 4 | Type: AWS::CloudWatch::AnomalyDetector 5 | Properties: 6 | MetricName: Invocations 7 | Namespace: AWS/Lambda 8 | Stat: Sum 9 | 10 | LambdaInvocationsAlarm: 11 | Type: AWS::CloudWatch::Alarm 12 | Properties: 13 | AlarmDescription: Lambda invocations 14 | AlarmName: LambdaInvocationsAlarm 15 | ComparisonOperator: LessThanLowerOrGreaterThanUpperThreshold 16 | EvaluationPeriods: 1 17 | Metrics: 18 | - Expression: ANOMALY_DETECTION_BAND(m1, 2) 19 | Id: ad1 20 | - Id: m1 21 | MetricStat: 22 | Metric: 23 | MetricName: Invocations 24 | Namespace: AWS/Lambda 25 | Period: !!int 86400 26 | Stat: Sum 27 | ThresholdMetricId: ad1 28 | TreatMissingData: breaching 29 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/dynamo-db-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Resources: 3 | DynamoDBTable: 4 | Type: AWS::DynamoDB::Table 5 | Properties: 6 | TableName: entities 7 | AttributeDefinitions: 8 | - 9 | AttributeName: "pk" 10 | AttributeType: "S" 11 | KeySchema: 12 | - 13 | AttributeName: "pk" 14 | KeyType: "HASH" 15 | ProvisionedThroughput: 16 | ReadCapacityUnits: 5 17 | WriteCapacityUnits: 5 18 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/ec2-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Resources: 3 | EC2Instance: 4 | Type: AWS::EC2::Instance 5 | Properties: 6 | ImageId: "ami-79fd7eee" 7 | KeyName: "testkey" 8 | BlockDeviceMappings: 9 | - DeviceName: "/dev/sdm" 10 | Ebs: 11 | VolumeType: "io1" 12 | Iops: "200" 13 | DeleteOnTermination: "false" 14 | VolumeSize: "20" 15 | - DeviceName: "/dev/sdk" 16 | NoDevice: {} 17 | MyEIP: 18 | Type: AWS::EC2::EIP 19 | Properties: 20 | InstanceId: !Ref EC2Instance 21 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/empty-stack.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Description: Empty stack for further test execute and resource allocation 3 | Conditions: 4 | HasNot: !Equals [ 'true', 'false' ] 5 | # dummy (null) resource, never created 6 | Resources: 7 | NullResource: 8 | Type: 'Custom::NullResource' 9 | Condition: HasNot 10 | Outputs: 11 | ExportsStackName: 12 | Value: !Ref 'AWS::StackName' 13 | Export: 14 | Name: !Sub 'ExportsStackName-${AWS::StackName}' 15 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/iam-group-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Description: Test template for creating a stack with a IAM Group and policies resources 3 | Resources: 4 | CFNUserGroup: 5 | Type: AWS::IAM::Group 6 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/iam-policy-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Resources: 3 | AccountManagedPolicy: 4 | Type: AWS::IAM::ManagedPolicy 5 | Properties: 6 | ManagedPolicyName: "accountAccessPolicy" 7 | PolicyDocument: 8 | Version: 2012-10-17 9 | Statement: 10 | - Sid: AllowAllUsersToListAccounts 11 | Effect: Allow 12 | Action: 13 | - iam:ListAccountAliases 14 | - iam:ListUsers 15 | - iam:GetAccountSummary 16 | Resource: "*" 17 | OlderAccountManagedPolicy: 18 | Type: AWS::IAM::ManagedPolicy 19 | Properties: 20 | ManagedPolicyName: "olderAccountAccessPolicy" 21 | PolicyDocument: 22 | Version: 2008-10-17 23 | Statement: 24 | - Sid: AllowAllUsersToListAccounts 25 | Effect: Allow 26 | Action: 27 | - iam:ListUsers 28 | - iam:GetAccountSummary 29 | Resource: "*" 30 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/iam-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Description: Test template for creating a stack with a IAM resources 3 | Resources: 4 | TestUserA: 5 | Type: AWS::IAM::User 6 | Properties: 7 | UserName: userA 8 | Path: "/" 9 | LoginProfile: 10 | Password: myP@ssW0rdAs 11 | TestUserB: 12 | Type: AWS::IAM::User 13 | Properties: 14 | UserName: userB 15 | Path: "/" 16 | LoginProfile: 17 | Password: myP@ssW0rdB 18 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/kms-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Resources: 3 | akscmk: 4 | Type: AWS::KMS::Key 5 | Properties: 6 | Description: "Encrypt sensitive data" 7 | KeyPolicy: 8 | Version: 2012-10-17 9 | Id: key-default-1 10 | Statement: 11 | - Sid: "Allow administration of the key" 12 | Effect: Allow 13 | Principal: 14 | AWS: "arn:aws:iam::1234567890:root" 15 | Action: 16 | - "kms:*" 17 | Resource: "*" 18 | - Sid: "Allow use of the key" 19 | Effect: Allow 20 | Principal: 21 | AWS: 'arn:aws:iam::0987654321:user/devuser' 22 | Action: 23 | - "kms:Encrypt" 24 | - "kms:Decrypt" 25 | - "kms:ReEncrypt" 26 | - "kms:GenerateDataKey*" 27 | - "kms:DescribeKey" 28 | Resource: "*" 29 | Tags: 30 | - Key: country 31 | Value: india 32 | KeyAlias: 33 | Type: 'AWS::KMS::Alias' 34 | Properties: 35 | AliasName: alias/testcmk 36 | TargetKeyId: !Ref akscmk 37 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/lambda-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Resources: 3 | function: 4 | Type: AWS::Lambda::Function 5 | Properties: 6 | FunctionName: cf-integration-test-lambda-function 7 | Handler: index.handler 8 | Role: arn:aws:iam::123456789012:role/lambda-role 9 | Code: 10 | ZipFile: | 11 | exports.handler = async (event) => { 12 | console.log(JSON.stringify(event, null, 2)); 13 | const response = { 14 | statusCode: 200, 15 | body: JSON.stringify('Hello from Lambda!'), 16 | }; 17 | return response; 18 | }; 19 | Runtime: nodejs12.x 20 | TracingConfig: 21 | Mode: Active 22 | s3Permission: 23 | Type: AWS::Lambda::Permission 24 | Properties: 25 | FunctionName: !GetAtt function.Arn 26 | Action: lambda:InvokeFunction 27 | Principal: s3.amazonaws.com 28 | SourceAccount: !Ref 'AWS::AccountId' 29 | SourceArn: !GetAtt bucket.Arn 30 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/redshift-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Resources: 3 | TestCluster: 4 | Type: "AWS::Redshift::Cluster" 5 | Properties: 6 | DBName: "testdb" 7 | MasterUsername: "master" 8 | MasterUserPassword: "password" 9 | NodeType: "ds2.xlarge" 10 | ClusterType: "single-node" 11 | Tags: 12 | - Key: foo 13 | Value: bar 14 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/route53-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Resources: 3 | HealthCheck: 4 | Type: 'AWS::Route53::HealthCheck' 5 | Properties: 6 | HealthCheckConfig: 7 | IPAddress: 192.0.2.44 8 | Port: 80 9 | Type: HTTP 10 | ResourcePath: '/example/index.html' 11 | FullyQualifiedDomainName: example.com 12 | RequestInterval: 30 13 | FailureThreshold: 3 14 | HealthCheckTags: 15 | - Key: SampleKey1 16 | Value: SampleValue1 17 | - Key: SampleKey2 18 | Value: SampleValue2 19 | DNS: 20 | Type: "AWS::Route53::HostedZone" 21 | Properties: 22 | HostedZoneConfig: 23 | Comment: 'My hosted zone for example.com' 24 | Name: 'example.com' 25 | VPCs: 26 | - VPCId: 'vpc-abcd1234' 27 | VPCRegion: 'ap-northeast-1' 28 | - VPCId: 'vpc-efgh5678' 29 | VPCRegion: 'us-west-2' 30 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/s3-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Description: Test template for creating a stack with a s3 bucket 3 | Resources: 4 | S3BucketForPoc: 5 | Type: AWS::S3::Bucket 6 | Properties: 7 | BucketName: testbucket 8 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/secret-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Resources: 3 | TestSecret: 4 | Type: 'AWS::SecretsManager::Secret' 5 | Properties: 6 | Name: TestSecret 7 | Description: This secret has a hardcoded password in SecretString (use GenerateSecretString instead) 8 | SecretString: '{"username":"TestUser","password":"secret-password"}' 9 | Tags: 10 | - Key: AppName 11 | Value: OpenRavenIT 12 | MySecretResourcePolicy: 13 | Type: 'AWS::SecretsManager::ResourcePolicy' 14 | Properties: 15 | SecretId: !Ref TestSecret 16 | ResourcePolicy: 17 | Version: 2012-10-17 18 | Statement: 19 | - Resource: '*' 20 | Action: 'secretsmanager:DeleteSecret' 21 | Effect: Deny 22 | Principal: 23 | AWS: !Sub 'arn:aws:iam::${AWS::AccountId}:root' 24 | -------------------------------------------------------------------------------- /magpie-aws/src/test/resources/template/sns-subscription-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | Resources: 3 | CarSalesTopic: 4 | Type: 'AWS::SNS::Topic' 5 | Properties: 6 | TopicName: CarSalesTopic 7 | SCMSubscription: 8 | Type: 'AWS::SNS::Subscription' 9 | Properties: 10 | TopicArn: !Ref CarSalesTopic 11 | Endpoint: 'test@openraven.com' 12 | Protocol: https 13 | DeliveryPolicy: 14 | healthyRetryPolicy: 15 | numRetries: 20 16 | minDelayTarget: 10 17 | maxDelayTarget: 30 18 | numMinDelayRetries: 3 19 | numMaxDelayRetries: 17 20 | numNoDelayRetries: 0 21 | backoffFunction: exponential 22 | -------------------------------------------------------------------------------- /magpie-azure/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | !**/src/main/**/target/ 4 | !**/src/test/**/target/ 5 | 6 | ### IntelliJ IDEA ### 7 | .idea/modules.xml 8 | .idea/jarRepositories.xml 9 | .idea/compiler.xml 10 | .idea/libraries/ 11 | *.iws 12 | *.iml 13 | *.ipr 14 | 15 | ### Eclipse ### 16 | .apt_generated 17 | .classpath 18 | .factorypath 19 | .project 20 | .settings 21 | .springBeans 22 | .sts4-cache 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | build/ 31 | !**/src/main/**/build/ 32 | !**/src/test/**/build/ 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | 37 | ### Mac OS ### 38 | .DS_Store -------------------------------------------------------------------------------- /magpie-azure/src/main/java/io/openraven/magpie/plugins/azure/discovery/exception/AzureDiscoveryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.plugins.azure.discovery.exception; 17 | 18 | public class AzureDiscoveryException extends RuntimeException { 19 | public AzureDiscoveryException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /magpie-azure/src/main/resources/META-INF/services/io.openraven.magpie.api.OriginPlugin: -------------------------------------------------------------------------------- 1 | io.openraven.magpie.plugins.azure.discovery.AzureDiscoveryPlugin 2 | -------------------------------------------------------------------------------- /magpie-cli/src/assembly/files/logging.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.err 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 13 | 14 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /magpie-cli/src/assembly/files/magpie-discovery: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | java -Dlogback.configurationFile=logging.xml -cp magpie-cli.jar:plugins/* io.openraven.magpie.cli.Discovery "$@" 3 | -------------------------------------------------------------------------------- /magpie-cli/src/assembly/files/magpie-discovery.bat: -------------------------------------------------------------------------------- 1 | java -Dlogback.configurationFile=logging.xml -cp magpie-cli.jar;plugins/* io.openraven.magpie.cli.Discovery "$@" 2 | -------------------------------------------------------------------------------- /magpie-cli/src/assembly/files/magpie-policy: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | java -Dlogback.configurationFile=logging.xml -cp magpie-cli.jar:plugins/* io.openraven.magpie.cli.Policy "$@" 3 | -------------------------------------------------------------------------------- /magpie-cli/src/assembly/files/magpie-policy.bat: -------------------------------------------------------------------------------- 1 | java -Dlogback.configurationFile=logging.xml -cp magpie-cli.jar;plugins/* io.openraven.magpie.cli.Policy "$@" 2 | -------------------------------------------------------------------------------- /magpie-cli/src/assembly/files/magpie.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Determine which of magpie-discovery or magpie-policy we'll be running. Both is always an option and the default if 4 | # not specified. 5 | 6 | if [[ ${MAGPIE_DISCOVERY} == true ]] || [[ ${MAGPIE_POLICY:=false} == false ]] ; 7 | then 8 | echo "Executing Magpie Discovery" >&2 9 | ./magpie-discovery "$@" 10 | fi 11 | 12 | 13 | if [[ ${MAGPIE_POLICY} == true ]] || [[ ${MAGPIE_DISCOVERY:=false} == false ]] ; 14 | then 15 | echo "Executing Magpie Policy" >&2 16 | ./magpie-policy "$@" 17 | fi 18 | 19 | 20 | -------------------------------------------------------------------------------- /magpie-cli/src/assembly/files/plugins/plugins.txt: -------------------------------------------------------------------------------- 1 | Any plugin jar files dropped into this folder will be picked up automatically by the Magpie CLI. 2 | -------------------------------------------------------------------------------- /magpie-cli/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.err 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 13 | 14 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/config/ConfigException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.config; 18 | 19 | public class ConfigException extends RuntimeException{ 20 | 21 | public ConfigException() { 22 | } 23 | 24 | public ConfigException(String message) { 25 | super(message); 26 | } 27 | 28 | public ConfigException(String message, Throwable cause) { 29 | super(message, cause); 30 | } 31 | 32 | public ConfigException(Throwable cause) { 33 | super(cause); 34 | } 35 | 36 | public ConfigException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 37 | super(message, cause, enableSuppression, writableStackTrace); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/config/PluginConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.config; 18 | 19 | public class PluginConfig { 20 | 21 | private boolean enabled = true; 22 | private T config; 23 | 24 | 25 | public boolean isEnabled() { 26 | return enabled; 27 | } 28 | 29 | public void setEnabled(boolean enabled) { 30 | this.enabled = enabled; 31 | } 32 | 33 | public T getConfig() { 34 | return config; 35 | } 36 | 37 | public void setConfig(T config) { 38 | this.config = config; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/config/PolicyConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.config; 18 | 19 | 20 | import java.util.List; 21 | 22 | public class PolicyConfig { 23 | private String root = "~/.magpie/policies"; 24 | private List repositories = List.of(); 25 | 26 | public String getRoot() { 27 | return root; 28 | } 29 | 30 | public void setRoot(String root) { 31 | this.root = root; 32 | } 33 | 34 | public List getRepositories() { 35 | return repositories; 36 | } 37 | 38 | public void setRepositories(List repositories) { 39 | this.repositories = repositories == null ? List.of() : repositories; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/config/ServiceConfig.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.config; 2 | 3 | public class ServiceConfig { 4 | private String url; 5 | 6 | public String getUrl() { 7 | return url; 8 | } 9 | 10 | public void setUrl(String url) { 11 | this.url = url; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/cspm/CspmSerializationException.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.cspm; 2 | 3 | public class CspmSerializationException extends RuntimeException { 4 | 5 | public CspmSerializationException(String message, Throwable cause) { 6 | super(message, cause); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/cspm/analysis/ScanMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.core.cspm.analysis; 17 | 18 | import java.time.Duration; 19 | import java.util.Date; 20 | 21 | public class ScanMetadata { 22 | private Date startDateTime; 23 | private Duration duration; 24 | 25 | public ScanMetadata(Date startDateTime, Duration duration) { 26 | this.startDateTime = startDateTime; 27 | this.duration = duration; 28 | } 29 | 30 | public Date getStartDateTime() { 31 | return startDateTime; 32 | } 33 | 34 | public Duration getDuration() { 35 | return duration; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/cspm/model/PolicyContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.cspm.model; 18 | 19 | public class PolicyContext { 20 | 21 | private final PolicyMetadata metadata; 22 | private final Policy policy; 23 | 24 | public PolicyContext(PolicyMetadata metadata, Policy policy) { 25 | this.metadata = metadata; 26 | this.policy = policy; 27 | } 28 | 29 | public PolicyMetadata getMetadata() { 30 | return metadata; 31 | } 32 | 33 | public Policy getPolicy() { 34 | return policy; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/cspm/model/PolicyMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.cspm.model; 18 | 19 | public class PolicyMetadata { 20 | 21 | private final String policyPath; 22 | private final String repoHash; 23 | 24 | public PolicyMetadata(String policyPath, String repoHash) { 25 | this.policyPath = policyPath; 26 | this.repoHash = repoHash; 27 | } 28 | 29 | public String getPolicyPath() { 30 | return policyPath; 31 | } 32 | 33 | public String getRepoHash() { 34 | return repoHash; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/cspm/model/Severity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.core.cspm.model; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | public enum Severity { 21 | @JsonProperty("high") 22 | HIGH("High"), 23 | @JsonProperty("medium") 24 | MEDIUM("Medium"), 25 | @JsonProperty("low") 26 | LOW("Low"); 27 | 28 | private final String title; 29 | 30 | Severity(String title) { 31 | this.title = title; 32 | } 33 | 34 | public String getTitle() { 35 | return title; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/cspm/services/CspmFacade.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.core.cspm.services; 17 | 18 | import io.openraven.magpie.core.config.MagpieConfig; 19 | 20 | public interface CspmFacade { 21 | 22 | void analyze(MagpieConfig config); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/cspm/services/PolicyAcquisitionService.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.cspm.services; 2 | 3 | import io.openraven.magpie.core.config.MagpieConfig; 4 | import io.openraven.magpie.core.cspm.model.PolicyContext; 5 | 6 | import java.io.IOException; 7 | import java.util.List; 8 | 9 | public interface PolicyAcquisitionService { 10 | void init(MagpieConfig config); 11 | List loadPolicies() throws IOException; 12 | } 13 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/cspm/services/PolicyAnalyzerService.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.cspm.services; 2 | 3 | import io.openraven.magpie.core.config.MagpieConfig; 4 | import io.openraven.magpie.core.cspm.model.PolicyContext; 5 | import io.openraven.magpie.core.cspm.model.Rule; 6 | import io.openraven.magpie.core.cspm.analysis.ScanResults; 7 | 8 | import java.io.IOException; 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | public interface PolicyAnalyzerService { 13 | 14 | void init(MagpieConfig config); 15 | 16 | 17 | /** 18 | * Using the supplied List of Policies, execute each Policy's Rules (SQL query) against the database credentials provided in 19 | * MagpieConfig. Each query is expected to return at a minimum a field named 'arn' for each row matched. If no rows 20 | * are matched then no violation occured for that Rule. 21 | * 22 | * @param policies The List of PolicyContexts to match against. 23 | * @return A list of violations, or an empty list of none are found. 24 | * @throws IOException 25 | */ 26 | ScanResults analyze(List policies) throws Exception; 27 | 28 | List> evaluate(Rule rule, Object resultSet) throws Exception; 29 | } 30 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/fifos/FifoDequeue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.core.fifos; 17 | 18 | import io.openraven.magpie.api.MagpieEnvelope; 19 | 20 | import java.util.Optional; 21 | 22 | @FunctionalInterface 23 | public interface FifoDequeue { 24 | Optional poll() throws FifoException; 25 | } 26 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/fifos/FifoException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.fifos; 18 | 19 | public class FifoException extends Exception { 20 | public FifoException() { 21 | } 22 | 23 | public FifoException(String message) { 24 | super(message); 25 | } 26 | 27 | public FifoException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | public FifoException(Throwable cause) { 32 | super(cause); 33 | } 34 | 35 | public FifoException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 36 | super(message, cause, enableSuppression, writableStackTrace); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/fifos/FifoQueue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.fifos; 18 | 19 | import io.openraven.magpie.api.MagpieEnvelope; 20 | 21 | @FunctionalInterface 22 | public interface FifoQueue { 23 | void add(MagpieEnvelope env) throws FifoException; 24 | } 25 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/fifos/LocalQueue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.fifos; 18 | 19 | import io.openraven.magpie.api.MagpieEnvelope; 20 | 21 | import java.util.Optional; 22 | import java.util.Queue; 23 | import java.util.concurrent.ConcurrentLinkedQueue; 24 | 25 | public class LocalQueue implements FifoQueue, FifoDequeue{ 26 | 27 | private final Queue queue = new ConcurrentLinkedQueue<>(); 28 | 29 | @Override 30 | public Optional poll() throws FifoException { 31 | return Optional.ofNullable(queue.poll()); 32 | } 33 | 34 | @Override 35 | public void add(MagpieEnvelope env) throws FifoException { 36 | if (!queue.add(env)) { 37 | throw new FifoException("Couldn't enqueue " + env.toString()); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/fifos/QueueType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.fifos; 18 | 19 | public enum QueueType { 20 | LOCAL, 21 | KAFKA 22 | } 23 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/layers/Layer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.layers; 18 | 19 | import io.openraven.magpie.core.fifos.FifoException; 20 | 21 | public interface Layer { 22 | 23 | void exec() throws FifoException; 24 | String getName(); 25 | LayerType getType(); 26 | void shutdown(); 27 | } 28 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/layers/LayerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.core.layers; 18 | 19 | public enum LayerType { 20 | ORIGIN, 21 | INTERMEDIATE, 22 | TERMINAL 23 | } 24 | -------------------------------------------------------------------------------- /magpie-core/src/main/java/io/openraven/magpie/core/plugins/PluginLoaderException.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.plugins; 2 | 3 | public class PluginLoaderException extends RuntimeException { 4 | public PluginLoaderException(Throwable cause) { 5 | super(cause); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /magpie-core/src/test/java/io/openraven/magpie/core/FifoManagerTest.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; 5 | import io.openraven.magpie.core.config.MagpieConfig; 6 | import io.openraven.magpie.core.fifos.FifoManager; 7 | import io.openraven.magpie.core.fifos.LocalQueue; 8 | import org.junit.jupiter.api.Test; 9 | 10 | import java.io.InputStream; 11 | 12 | import static org.junit.jupiter.api.Assertions.*; 13 | 14 | class FifoManagerTest { 15 | 16 | private static final ObjectMapper MAPPER = new ObjectMapper(new YAMLFactory()); 17 | 18 | @Test 19 | public void testSimpleConfig() throws Exception { 20 | try(InputStream is = FifoManagerTest.class.getResourceAsStream("/fifoconfig/simple.yaml")) { 21 | var config = MAPPER.readValue(is, MagpieConfig.class); 22 | 23 | assertEquals(3, config.getLayers().size()); 24 | assertTrue(config.getLayers().containsKey("enumerate")); 25 | assertTrue(config.getLayers().containsKey("transform")); 26 | assertTrue(config.getLayers().containsKey("output")); 27 | assertFalse(config.getLayers().containsKey("test")); 28 | 29 | var fifoManager = new FifoManager(config); 30 | assertTrue(fifoManager.getDequeue("default") instanceof LocalQueue); 31 | assertTrue(fifoManager.getQueue("default") instanceof LocalQueue); 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /magpie-core/src/test/java/io/openraven/magpie/core/config/ConfigUtilsTest.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.config; 2 | 3 | 4 | import org.junit.jupiter.api.Test; 5 | 6 | import java.util.Map; 7 | import java.util.stream.Collectors; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertEquals; 10 | import static org.junit.jupiter.api.Assertions.assertTrue; 11 | 12 | class ConfigUtilsTest { 13 | 14 | @Test 15 | void testEnvMapping() { 16 | var env = Map.of( 17 | "MAGPIE_CONFIG_1", "[{'/plugins/magpie.json.output/enabled': true}, {'/plugins/magpie.aws.discovery/config/services': ['s3']}]", 18 | "MAGPIE_CONFIG_2", "{'/plugins/magpie.aws.discovery.2/config/services': ['ec2', 'rds']}" 19 | ); 20 | 21 | var config = ConfigUtils.envOverrides(env).entrySet().stream() 22 | .map(e -> Map.entry(e.getKey().toString(), e.getValue())) 23 | .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); 24 | 25 | assertEquals(3, config.size()); 26 | assertTrue(config.get("/plugins/magpie.json.output/enabled").booleanValue()); 27 | assertEquals("s3", config.get("/plugins/magpie.aws.discovery/config/services").get(0).textValue()); 28 | assertEquals(2, config.get("/plugins/magpie.aws.discovery.2/config/services").size()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /magpie-core/src/test/java/io/openraven/magpie/core/fifos/KafkaDequeueTest.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.fifos; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.fasterxml.jackson.databind.SerializationFeature; 5 | import io.openraven.magpie.api.MagpieEnvelope; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import java.io.FileInputStream; 9 | 10 | import static org.junit.jupiter.api.Assertions.*; 11 | 12 | class KafkaDequeueTest { 13 | 14 | private static final ObjectMapper MAPPER = new ObjectMapper() 15 | .enable(SerializationFeature.INDENT_OUTPUT) 16 | .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) 17 | .findAndRegisterModules(); 18 | 19 | @Test 20 | public void test() throws Exception { 21 | try(var is = KafkaDequeue.class.getResourceAsStream("/env.json")) { 22 | var env = MAPPER.readValue(is, MagpieEnvelope.class); 23 | assertNotNull(env); 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /magpie-core/src/test/java/io/openraven/magpie/core/plugins/MagpieTestConfig.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.plugins; 2 | 3 | public class MagpieTestConfig { 4 | private String apiKey; 5 | private String apiSecret; 6 | 7 | public String getApiKey() { 8 | return apiKey; 9 | } 10 | 11 | public void setApiKey(String apiKey) { 12 | this.apiKey = apiKey; 13 | } 14 | 15 | public String getApiSecret() { 16 | return apiSecret; 17 | } 18 | 19 | public void setApiSecret(String apiSecret) { 20 | this.apiSecret = apiSecret; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /magpie-core/src/test/java/io/openraven/magpie/core/plugins/MagpieTestPlugin.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.plugins; 2 | 3 | import io.openraven.magpie.api.Emitter; 4 | import io.openraven.magpie.api.OriginPlugin; 5 | import io.openraven.magpie.api.Session; 6 | import org.slf4j.Logger; 7 | 8 | public class MagpieTestPlugin implements OriginPlugin { 9 | 10 | protected MagpieTestConfig config; 11 | 12 | @Override 13 | public void discover(Session session, Emitter emitter) { } 14 | 15 | @Override 16 | public String id() { 17 | return "magpie.test"; 18 | } 19 | 20 | @Override 21 | public void init(MagpieTestConfig config, Logger logger) { 22 | this.config = config; 23 | } 24 | 25 | @Override 26 | public Class configType() { 27 | return MagpieTestConfig.class; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /magpie-core/src/test/java/io/openraven/magpie/core/plugins/MagpieTestPlugin2.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.core.plugins; 2 | 3 | import io.openraven.magpie.api.Emitter; 4 | import io.openraven.magpie.api.OriginPlugin; 5 | import io.openraven.magpie.api.Session; 6 | import org.slf4j.Logger; 7 | 8 | public class MagpieTestPlugin2 implements OriginPlugin { 9 | 10 | private Object config; 11 | 12 | @Override 13 | public void discover(Session session, Emitter emitter) { } 14 | 15 | @Override 16 | public String id() { 17 | return "magpie.test.2"; 18 | } 19 | 20 | @Override 21 | public void init(Void v, Logger logger) { 22 | config = v; 23 | } 24 | 25 | @Override 26 | public Class configType() { 27 | return Void.class; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /magpie-core/src/test/resources/META-INF/services/io.openraven.magpie.api.OriginPlugin: -------------------------------------------------------------------------------- 1 | io.openraven.magpie.core.plugins.MagpieTestPlugin 2 | io.openraven.magpie.core.plugins.MagpieTestPlugin2 3 | -------------------------------------------------------------------------------- /magpie-core/src/test/resources/env.json: -------------------------------------------------------------------------------- 1 | {"session":{"id":"709f4323-df33-4740-ba9d-75f28e9a0b55","createdAt":"2021-03-05T18:05:49.908120Z"},"pluginPath":["magpie.aws.discovery:sg"],"contents":{"description":"default VPC security group","groupName":"default","ipPermissions":[{"fromPort":null,"ipProtocol":"-1","ipRanges":[],"ipv6Ranges":[],"prefixListIds":[],"toPort":null,"userIdGroupPairs":[{"description":null,"groupId":"sg-370d975f","groupName":null,"peeringStatus":null,"userId":"160390125595","vpcId":null,"vpcPeeringConnectionId":null}]}],"ownerId":"160390125595","groupId":"sg-370d975f","ipPermissionsEgress":[{"fromPort":null,"ipProtocol":"-1","ipRanges":[{"cidrIp":"0.0.0.0/0","description":null}],"ipv6Ranges":[],"prefixListIds":[],"toPort":null,"userIdGroupPairs":[]}],"tags":null,"vpcId":"vpc-efdf1f86"},"contentClass":"software.amazon.awssdk.services.ec2.model.SecurityGroup$BuilderImpl"} 2 | -------------------------------------------------------------------------------- /magpie-core/src/test/resources/fifoconfig/simple.yaml: -------------------------------------------------------------------------------- 1 | layers: 2 | enumerate: 3 | type: origin 4 | queue: xform 5 | plugins: 6 | - magpie.aws 7 | - magpie.gcp 8 | transform: 9 | type: intermediate 10 | dequeue: xform 11 | queue: default 12 | plugins: 13 | - magpie.awstransform 14 | output: 15 | type: terminal 16 | dequeue: default 17 | fifos: 18 | default: 19 | type: local 20 | xform: 21 | type: local 22 | plugins: 23 | magpie.aws: 24 | enabled: true 25 | config: 26 | api_key: deadbeef 27 | api_secret: cafebabe 28 | magpie.awstransform: 29 | enabled: true 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /magpie-core/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.err 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 13 | 14 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /magpie-core/src/test/resources/pluginconfig/simple.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | magpie.test: 3 | enabled: true 4 | config: 5 | apiKey: deadbeef 6 | apiSecret: cafebabe 7 | magpie.test.2: 8 | enabled: true 9 | -------------------------------------------------------------------------------- /magpie-core/src/test/resources/sql/aws-asset-credential-report.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO magpie.awsusercredentialreport (documentid, arn, resourcename, resourceid, resourcetype, awsregion, awsaccountid, creatediso, updatediso, discoverysessionid, configuration, supplementaryconfiguration, tags, discoverymeta) 2 | VALUES ('oOMICZrqNEGIIyspVFRGQw', 'arn:aws:iam::723176279592:root', '', 'arn:aws:iam::723176279592:root', 'AWS::IAM::CredentialsReport', 'aws-global', '723176279592', NULL, '2021-07-06 11:30:03.439601+00', NULL, '{"arn": "arn:aws:iam::723176279592:root", "user": "", "mfa_active": "true", "cert_1_active": "false", "cert_2_active": "false", "password_enabled": "not_supported", "password_last_used": "2021-01-03T02:24:22+00:00", "user_creation_time": "2019-12-06T23:39:32+00:00", "access_key_1_active": "true", "access_key_2_active": "false", "cert_1_last_rotated": null, "cert_2_last_rotated": null, "password_last_changed": null, "password_next_rotation": null, "access_key_1_last_rotated": null, "access_key_2_last_rotated": null, "access_key_1_last_used_date": null, "access_key_2_last_used_date": null, "access_key_1_last_used_region": "N/A", "access_key_2_last_used_region": "N/A", "access_key_1_last_used_service": "N/A", "access_key_2_last_used_service": "N/A"}', '{}', '{}', '{}'); 3 | -------------------------------------------------------------------------------- /magpie-core/src/test/resources/sql/rule-sql-with-available-asset.sql: -------------------------------------------------------------------------------- 1 | SELECT arn as assetid 2 | FROM magpie.awsusercredentialreport 3 | WHERE resourcetype = 'AWS::IAM::CredentialsReport' 4 | AND ((configuration->>'access_key_1_active' = 'true' 5 | AND (configuration->>'access_key_1_last_used_date' IS NULL 6 | OR configuration->>'access_key_1_last_used_date' = 'N/A')) 7 | OR (configuration->>'access_key_2_active' = 'true' 8 | AND (configuration->>'access_key_2_last_used_date' IS NULL 9 | OR configuration->>'access_key_2_last_used_date' = 'N/A'))); 10 | -------------------------------------------------------------------------------- /magpie-core/src/test/resources/sql/rule-sql-with-missed-asset.sql: -------------------------------------------------------------------------------- 1 | SELECT arn as assetid 2 | FROM magpie.awscloudtrail cloudtrail 3 | WHERE resourcetype = 'AWS::CloudTrail::Trail' 4 | AND NOT EXISTS 5 | (SELECT * 6 | FROM magpie.awss3bucket s3bucket 7 | WHERE resource_type = 'AWS::S3::Bucket' 8 | AND s3bucket.resource_name = cloudtrail.supplementaryconfiguration->'trailDetails'->'trail'->>'s3BucketName' 9 | AND s3bucket.supplementaryconfiguration->'bucketLoggingConfiguration'->'loggingEnabled' != 'null'); 10 | ` 11 | -------------------------------------------------------------------------------- /magpie-data/README.md: -------------------------------------------------------------------------------- 1 | # magpie-data -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/Resource.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data; 21 | 22 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 23 | import com.fasterxml.jackson.databind.annotation.JsonTypeIdResolver; 24 | import io.openraven.magpie.data.utils.EntityTypeResolver; 25 | 26 | @JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "resourceType") 27 | @JsonTypeIdResolver(EntityTypeResolver.class) 28 | public class Resource { 29 | 30 | public String resourceType; 31 | 32 | public String getResourceType() { 33 | return resourceType; 34 | } 35 | 36 | public void setResourceType(String resourceType) { 37 | this.resourceType = resourceType; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/accounts/IamAccount.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.accounts; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = IamAccount.TABLE_NAME) 27 | public class IamAccount extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awsiamaccount"; 30 | public static final String RESOURCE_TYPE = "AWS::IAM::Account"; 31 | 32 | public IamAccount() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/accounts/IamCredentialsReport.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.accounts; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = IamCredentialsReport.TABLE_NAME) 27 | public class IamCredentialsReport extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awsiamcredentialsreport"; 30 | public static final String RESOURCE_TYPE = "AWS::IAM::CredentialsReport"; 31 | 32 | public IamCredentialsReport() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/cloudwatch/CloudWatchAlarm.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.cloudwatch; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = CloudWatchAlarm.TABLE_NAME) 27 | public class CloudWatchAlarm extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awswatchalarm"; 30 | public static final String RESOURCE_TYPE = "AWS::CloudWatch::Alarm"; 31 | 32 | public CloudWatchAlarm() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/cloudwatch/CloudWatchDashboard.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.cloudwatch; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = CloudWatchDashboard.TABLE_NAME) 27 | public class CloudWatchDashboard extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awswatchdashboard"; 30 | public static final String RESOURCE_TYPE = "AWS::CloudWatch::Dashboard"; 31 | 32 | public CloudWatchDashboard() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/cloudwatch/CloudWatchLogsMetricFilter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.cloudwatch; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = CloudWatchLogsMetricFilter.TABLE_NAME) 27 | public class CloudWatchLogsMetricFilter extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awswatchlogsmetricfilter"; 30 | public static final String RESOURCE_TYPE = "AWS::CloudWatchLogs::MetricFilter"; 31 | 32 | public CloudWatchLogsMetricFilter() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/config/AwsConfigurationRecorder.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.config; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = AwsConfigurationRecorder.TABLE_NAME) 27 | public class AwsConfigurationRecorder extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awsconfigurationrecorder"; 30 | public static final String RESOURCE_TYPE = "AWS::Config::ConfigurationRecorder"; 31 | 32 | public AwsConfigurationRecorder() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/guardduty/GuardDutyDetector.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.guardduty; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = GuardDutyDetector.TABLE_NAME) 27 | public class GuardDutyDetector extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awsguarddutydetector"; 30 | public static final String RESOURCE_TYPE = "AWS::GuardDuty::Detector"; 31 | 32 | public GuardDutyDetector() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/location/LocationGeofenceCollection.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.location; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = LocationGeofenceCollection.TABLE_NAME) 27 | public class LocationGeofenceCollection extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awslocationgeofencecollection"; 30 | public static final String RESOURCE_TYPE = "AWS::Location::GeofenceCollection"; 31 | 32 | public LocationGeofenceCollection() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/location/LocationMap.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.location; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = LocationMap.TABLE_NAME) 27 | public class LocationMap extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awslocationmap"; 30 | public static final String RESOURCE_TYPE = "AWS::Location::Map"; 31 | 32 | public LocationMap() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/location/LocationPlaceIndex.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.location; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = LocationPlaceIndex.TABLE_NAME) 27 | public class LocationPlaceIndex extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awslocationplaceindex"; 30 | public static final String RESOURCE_TYPE = "AWS::Location::PlaceIndex"; 31 | 32 | public LocationPlaceIndex() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/location/LocationRouteCalculator.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.location; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = LocationRouteCalculator.TABLE_NAME) 27 | public class LocationRouteCalculator extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awslocationroutecalculator"; 30 | public static final String RESOURCE_TYPE = "AWS::Location::RouteCalculator"; 31 | 32 | public LocationRouteCalculator() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/location/LocationTracker.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.location; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = LocationTracker.TABLE_NAME) 27 | public class LocationTracker extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awslocationtracker"; 30 | public static final String RESOURCE_TYPE = "AWS::Location::Tracker"; 31 | 32 | public LocationTracker() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/rds/RDSSnapshot.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.rds; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = RDSSnapshot.TABLE_NAME) 27 | public class RDSSnapshot extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awsrdsdbsnapshot"; 30 | public static final String RESOURCE_TYPE = "AWS::RDS::DBSnapshot"; 31 | 32 | public RDSSnapshot() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/securityhub/SecurityHubStandardSubscription.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.securityhub; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = SecurityHubStandardSubscription.TABLE_NAME) 27 | public class SecurityHubStandardSubscription extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awssecurityhubstandardsubscription"; 30 | public static final String RESOURCE_TYPE = "AWS::SecurityHub::StandardsSubscription"; 31 | 32 | public SecurityHubStandardSubscription() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/sns/SNSSubscription.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.sns; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = SNSSubscription.TABLE_NAME) 27 | public class SNSSubscription extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awssnssubscription"; 30 | public static final String RESOURCE_TYPE = "AWS::SNS::Subscription"; 31 | 32 | public SNSSubscription() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/aws/sns/SNSTopic.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.aws.sns; 21 | 22 | import io.openraven.magpie.data.aws.AWSResource; 23 | 24 | @jakarta.persistence.Entity 25 | @jakarta.persistence.Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 26 | @jakarta.persistence.Table(name = SNSTopic.TABLE_NAME) 27 | public class SNSTopic extends AWSResource { 28 | 29 | protected static final String TABLE_NAME = "awssnstopic"; 30 | public static final String RESOURCE_TYPE = "AWS::SNS::Topic"; 31 | 32 | public SNSTopic() { 33 | this.resourceType = RESOURCE_TYPE; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/exception/MissingEntityTypeException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 - 2022 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.exception; 21 | 22 | 23 | /** 24 | * Signals that an exception occurred due to an asset type being consumed that isn't supported by the library. 25 | */ 26 | public class MissingEntityTypeException extends RuntimeException { 27 | 28 | /** 29 | * Constructs an {@code MissingEntityTypeException} with the specified detail message. 30 | * 31 | * @param message 32 | * The detail message (which is saved for later retrieval 33 | * by the {@link #getMessage()} method) 34 | */ 35 | public MissingEntityTypeException(String message) { 36 | super(message); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/access/AccessApproval.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.access; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = AccessApproval.TABLE_NAME) 31 | public class AccessApproval extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpaccess"; 34 | public static final String RESOURCE_TYPE = "GCP::AccessApproval::ApprovalRequest"; 35 | 36 | public AccessApproval() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/account/GcpIamRole.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.account; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = GcpIamRole.TABLE_NAME) 31 | public class GcpIamRole extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpiamrole"; 34 | public static final String RESOURCE_TYPE = "GCP::Iam::Role"; 35 | 36 | public GcpIamRole() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/account/GcpIamServiceAccount.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.account; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = GcpIamServiceAccount.TABLE_NAME) 31 | public class GcpIamServiceAccount extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpiamserviceaccount"; 34 | public static final String RESOURCE_TYPE = "GCP::Iam::ServiceAccount"; 35 | 36 | public GcpIamServiceAccount() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/asset/Asset.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.asset; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Asset.TABLE_NAME) 31 | public class Asset extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpasset"; 34 | public static final String RESOURCE_TYPE = "GCP::Asset::Asset"; 35 | 36 | public Asset() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/asset/AssetFeed.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.asset; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = AssetFeed.TABLE_NAME) 31 | public class AssetFeed extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpassetfeed"; 34 | public static final String RESOURCE_TYPE = "GCP::Asset::Feed"; 35 | 36 | public AssetFeed() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/automl/AutoMLDataset.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.automl; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = AutoMLDataset.TABLE_NAME) 31 | public class AutoMLDataset extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpautomldataset"; 34 | public static final String RESOURCE_TYPE = "GCP::AutoML::Dataset"; 35 | 36 | public AutoMLDataset() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/automl/AutoMLModel.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.automl; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = AutoMLModel.TABLE_NAME) 31 | public class AutoMLModel extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpautomlmodel"; 34 | public static final String RESOURCE_TYPE = "GCP::AutoML::Model"; 35 | 36 | public AutoMLModel() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/bigquery/BigQueryDataTransfer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.bigquery; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = BigQueryDataTransfer.TABLE_NAME) 31 | public class BigQueryDataTransfer extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpbigquerydatatransfer"; 34 | public static final String RESOURCE_TYPE = "GCP::BigQueryDataTransfer::TransferConfig"; 35 | 36 | public BigQueryDataTransfer() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/bigquery/BigQueryDataset.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.bigquery; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = BigQueryDataset.TABLE_NAME) 31 | public class BigQueryDataset extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpbigquerydataset"; 34 | public static final String RESOURCE_TYPE = "GCP::BigQuery::Dataset"; 35 | 36 | public BigQueryDataset() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/bigquery/BigQueryReservation.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.bigquery; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = BigQueryReservation.TABLE_NAME) 31 | public class BigQueryReservation extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpbigqueryreservation"; 34 | public static final String RESOURCE_TYPE = "GCP::BigQueryReservation::Reservation"; 35 | 36 | public BigQueryReservation() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/bigtable/BigTableInstance.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.bigtable; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = BigTableInstance.TABLE_NAME) 31 | public class BigTableInstance extends GCPResource { 32 | protected static final String TABLE_NAME = "gcpbigtableinstance"; 33 | public static final String RESOURCE_TYPE = "GCP::BigTable::Instance"; 34 | 35 | public BigTableInstance() { 36 | this.resourceType = RESOURCE_TYPE; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/billing/BillingAccount.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.billing; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = BillingAccount.TABLE_NAME) 31 | public class BillingAccount extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpbillingaccount"; 34 | public static final String RESOURCE_TYPE = "GCP::Billing::BillingAccount"; 35 | 36 | public BillingAccount() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/cloudbuild/CloudBuild.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.cloudbuild; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = CloudBuild.TABLE_NAME) 31 | public class CloudBuild extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpcloudbuild"; 34 | public static final String RESOURCE_TYPE = "GCP::CloudBuild::Build"; 35 | 36 | public CloudBuild() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/cloudbuild/CloudBuildTrigger.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.cloudbuild; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = CloudBuildTrigger.TABLE_NAME) 31 | public class CloudBuildTrigger extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpcloudbuildtrigger"; 34 | public static final String RESOURCE_TYPE = "GCP::CloudBuild::BuildTrigger"; 35 | 36 | public CloudBuildTrigger() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/cluster/Cluster.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.cluster; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Cluster.TABLE_NAME) 31 | public class Cluster extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpcluster"; 34 | public static final String RESOURCE_TYPE = "GCP::ClusterManager::Cluster"; 35 | 36 | public Cluster() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/compute/ComputeDisk.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.compute; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = ComputeDisk.TABLE_NAME) 31 | public class ComputeDisk extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpcomputedisk"; 34 | public static final String RESOURCE_TYPE = "GCP::ComputeEngine::Disk"; 35 | 36 | public ComputeDisk() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/compute/ComputeInstance.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.compute; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = ComputeInstance.TABLE_NAME) 31 | public class ComputeInstance extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpcomputeinstance"; 34 | public static final String RESOURCE_TYPE = "GCP::ComputeEngine::Instance"; 35 | 36 | public ComputeInstance() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/container/ContainerAnalysisNote.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.container; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = ContainerAnalysisNote.TABLE_NAME) 31 | public class ContainerAnalysisNote extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpcontaineranalysisnote"; 34 | public static final String RESOURCE_TYPE = "GCP::ContainerAnalysis::Note"; 35 | 36 | public ContainerAnalysisNote() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/data/DataCatalog.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.data; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DataCatalog.TABLE_NAME) 31 | public class DataCatalog extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpdatacatalog"; 34 | public static final String RESOURCE_TYPE = "GCP::DataCatalog::EntryGroup"; 35 | 36 | public DataCatalog() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/data/DataLabelingAnnotations.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.data; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DataLabelingAnnotations.TABLE_NAME) 31 | public class DataLabelingAnnotations extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpdatalabelingannotations"; 34 | public static final String RESOURCE_TYPE = "GCP::DataLabeling::AnnotationSpecSet"; 35 | 36 | public DataLabelingAnnotations() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/data/DataLabelingDataset.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.data; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DataLabelingDataset.TABLE_NAME) 31 | public class DataLabelingDataset extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpdatalabelig"; 34 | public static final String RESOURCE_TYPE = "GCP::DataLabeling::Dataset"; 35 | 36 | public DataLabelingDataset() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/data/DataLabelingInstruction.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.data; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DataLabelingInstruction.TABLE_NAME) 31 | public class DataLabelingInstruction extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpdatalabelinginstruction"; 34 | public static final String RESOURCE_TYPE = "GCP::DataLabeling::Instruction"; 35 | 36 | public DataLabelingInstruction() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/data/DataProcCluster.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.data; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DataProcCluster.TABLE_NAME) 31 | public class DataProcCluster extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gpcdataproccluster"; 34 | public static final String RESOURCE_TYPE = "GCP::Dataproc::Cluster"; 35 | 36 | public DataProcCluster() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/data/DataProcJob.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.data; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DataProcJob.TABLE_NAME) 31 | public class DataProcJob extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gpcdataprocjob"; 34 | public static final String RESOURCE_TYPE = "GCP::Dataproc::Job"; 35 | 36 | public DataProcJob() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/dialogflow/DialogflowConversation.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.dialogflow; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DialogflowConversation.TABLE_NAME) 31 | public class DialogflowConversation extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpdialogflowconversation"; 34 | public static final String RESOURCE_TYPE = "GCP::Dialogflow::Conversation"; 35 | 36 | public DialogflowConversation() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/dlp/DlpJob.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.dlp; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DlpJob.TABLE_NAME) 31 | public class DlpJob extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpdlpjob"; 34 | public static final String RESOURCE_TYPE = "GCP::Dlp::DlpJob"; 35 | 36 | public DlpJob() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/dlp/DlpJobTrigger.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.dlp; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DlpJobTrigger.TABLE_NAME) 31 | public class DlpJobTrigger extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpdlpjobtrigger"; 34 | public static final String RESOURCE_TYPE = "GCP::Dlp::JobTrigger"; 35 | 36 | public DlpJobTrigger() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/dns/DnsZone.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.dns; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = DnsZone.TABLE_NAME) 31 | public class DnsZone extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpdnszone"; 34 | public static final String RESOURCE_TYPE = "GCP::Dns::Zone"; 35 | 36 | public DnsZone() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/error/ErrorReporting.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.error; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = ErrorReporting.TABLE_NAME) 31 | public class ErrorReporting extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcperrorreporting"; 34 | public static final String RESOURCE_TYPE = "GCP::ErrorReporting::GroupStat"; 35 | 36 | public ErrorReporting() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/function/Function.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.function; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Function.TABLE_NAME) 31 | public class Function extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gpcfunction"; 34 | public static final String RESOURCE_TYPE = "GCP::Functions::Function"; 35 | 36 | public Function() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/game/GameService.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.game; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = GameService.TABLE_NAME) 31 | public class GameService extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpgameservice"; 34 | public static final String RESOURCE_TYPE = "GCP::GameServices::Realm"; 35 | 36 | public GameService() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/iot/IotDeviceRegistry.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.iot; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = IotDeviceRegistry.TABLE_NAME) 31 | public class IotDeviceRegistry extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpiotdeviceregistry"; 34 | public static final String RESOURCE_TYPE = "GCP::IoT::deviceRegistry"; 35 | 36 | public IotDeviceRegistry() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/kms/KmsKeyring.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.kms; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = KmsKeyring.TABLE_NAME) 31 | public class KmsKeyring extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpkmskeyring"; 34 | public static final String RESOURCE_TYPE = "GCP::KMS::Keyring"; 35 | 36 | public KmsKeyring() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/logging/LoggingBucket.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.logging; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = LoggingBucket.TABLE_NAME) 31 | public class LoggingBucket extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcploggingbucket"; 34 | public static final String RESOURCE_TYPE = "GCP::Logging::Bucket"; 35 | 36 | public LoggingBucket() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/logging/LoggingExclusion.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.logging; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = LoggingExclusion.TABLE_NAME) 31 | public class LoggingExclusion extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcploggingexclusion"; 34 | public static final String RESOURCE_TYPE = "GCP::Logging::Exclusion"; 35 | 36 | public LoggingExclusion() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/logging/LoggingMetric.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.logging; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = LoggingMetric.TABLE_NAME) 31 | public class LoggingMetric extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcploggingmetric"; 34 | public static final String RESOURCE_TYPE = "GCP::Logging::Metric"; 35 | 36 | public LoggingMetric() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/logging/LoggingSink.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.logging; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = LoggingSink.TABLE_NAME) 31 | public class LoggingSink extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcploggingsink"; 34 | public static final String RESOURCE_TYPE = "GCP::Logging::Sink"; 35 | 36 | public LoggingSink() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/memcache/MemcacheInstance.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.memcache; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = MemcacheInstance.TABLE_NAME) 31 | public class MemcacheInstance extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpmemcacheinstance"; 34 | public static final String RESOURCE_TYPE = "GCP::Memcache::Instance"; 35 | 36 | public MemcacheInstance() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/monitoring/MonitoringAlertPolicy.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.monitoring; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = MonitoringAlertPolicy.TABLE_NAME) 31 | public class MonitoringAlertPolicy extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpmonitoringalertpolicy"; 34 | public static final String RESOURCE_TYPE = "GCP::Monitoring::AlertPolicy"; 35 | 36 | public MonitoringAlertPolicy() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/monitoring/MonitoringDashboard.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.monitoring; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = MonitoringDashboard.TABLE_NAME) 31 | public class MonitoringDashboard extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpmonitoringdashboard"; 34 | public static final String RESOURCE_TYPE = "GCP::MonitoringDashboard::Dashboard"; 35 | 36 | public MonitoringDashboard() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/monitoring/MonitoringGroup.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.monitoring; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = MonitoringGroup.TABLE_NAME) 31 | public class MonitoringGroup extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpmonitoringgroup"; 34 | public static final String RESOURCE_TYPE = "GCP::Monitoring::Group"; 35 | 36 | public MonitoringGroup() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/monitoring/MonitoringService.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.monitoring; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = MonitoringService.TABLE_NAME) 31 | public class MonitoringService extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpmonitoringservice"; 34 | public static final String RESOURCE_TYPE = "GCP::Monitoring::Service"; 35 | 36 | public MonitoringService() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/osconfig/OsConfigPatchDeployment.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.osconfig; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = OsConfigPatchDeployment.TABLE_NAME) 31 | public class OsConfigPatchDeployment extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcposconfigpatchdeployment"; 34 | public static final String RESOURCE_TYPE = "GCP::OsConfig::PatchDeployment"; 35 | 36 | public OsConfigPatchDeployment() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/osconfig/OsConfigPatchJob.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.osconfig; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = OsConfigPatchJob.TABLE_NAME) 31 | public class OsConfigPatchJob extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcposconfigpatchjob"; 34 | public static final String RESOURCE_TYPE = "GCP::OsConfig::PatchJob"; 35 | 36 | public OsConfigPatchJob() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/project/ProjectInfo.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.project; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = ProjectInfo.TABLE_NAME) 31 | public class ProjectInfo extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpprojectinfo"; 34 | public static final String RESOURCE_TYPE = "GCP::Project::Info"; 35 | 36 | public ProjectInfo() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/pubsub/PubSubSchema.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.pubsub; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = PubSubSchema.TABLE_NAME) 31 | public class PubSubSchema extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcppubsubschema"; 34 | public static final String RESOURCE_TYPE = "GCP::PubSub::Schema"; 35 | 36 | public PubSubSchema() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/pubsub/PubSubSnapshots.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.pubsub; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = PubSubSnapshots.TABLE_NAME) 31 | public class PubSubSnapshots extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcppubsubsnapshots"; 34 | public static final String RESOURCE_TYPE = "GCP::PubSub::Snapshots"; 35 | 36 | public PubSubSnapshots() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/pubsub/PubSubSubscription.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.pubsub; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = PubSubSubscription.TABLE_NAME) 31 | public class PubSubSubscription extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcppubsubsubscription"; 34 | public static final String RESOURCE_TYPE = "GCP::PubSub::Subscription"; 35 | 36 | public PubSubSubscription() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/pubsub/PubSubTopic.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.pubsub; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = PubSubTopic.TABLE_NAME) 31 | public class PubSubTopic extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcppubsubtopic"; 34 | public static final String RESOURCE_TYPE = "GCP::PubSub::Topic"; 35 | 36 | public PubSubTopic() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/pubsublite/PubSubLiteSubscription.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.pubsublite; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = PubSubLiteSubscription.TABLE_NAME) 31 | public class PubSubLiteSubscription extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcppubsublitesubscription"; 34 | public static final String RESOURCE_TYPE = "GCP::PubSubLite::Subscription"; 35 | 36 | public PubSubLiteSubscription() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/pubsublite/PubSubLiteTopic.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.pubsublite; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = PubSubLiteTopic.TABLE_NAME) 31 | public class PubSubLiteTopic extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcppubsublitetopic"; 34 | public static final String RESOURCE_TYPE = "GCP::PubSubLite::Topic"; 35 | 36 | public PubSubLiteTopic() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/recaptcha/RecaptchaEnterpriseKey.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.recaptcha; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = RecaptchaEnterpriseKey.TABLE_NAME) 31 | public class RecaptchaEnterpriseKey extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcprecaptchaenterprisekey"; 34 | public static final String RESOURCE_TYPE = "GCP::RecaptchaEnterprise::Key"; 35 | 36 | public RecaptchaEnterpriseKey() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/redis/RedisInstance.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.redis; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = RedisInstance.TABLE_NAME) 31 | public class RedisInstance extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpredisinstance"; 34 | public static final String RESOURCE_TYPE = "GCP::Redis::Instance"; 35 | 36 | public RedisInstance() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/resource/ResourceManagerFolder.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.resource; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = ResourceManagerFolder.TABLE_NAME) 31 | public class ResourceManagerFolder extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpresourcemanagerfolder"; 34 | public static final String RESOURCE_TYPE = "GCP::ResourceManager::Folder"; 35 | 36 | public ResourceManagerFolder() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/resource/ResourceManagerProject.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.resource; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = ResourceManagerProject.TABLE_NAME) 31 | public class ResourceManagerProject extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpresourcemanagerproject"; 34 | public static final String RESOURCE_TYPE = "GCP::ResourceManager::Project"; 35 | 36 | public ResourceManagerProject() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/scheduler/SchedulerJob.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.scheduler; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = SchedulerJob.TABLE_NAME) 31 | public class SchedulerJob extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpschedulerjob"; 34 | public static final String RESOURCE_TYPE = "GCP::Scheduler::Job"; 35 | 36 | public SchedulerJob() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/secret/Secret.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.secret; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Secret.TABLE_NAME) 31 | public class Secret extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpsecretmanagersecret"; 34 | public static final String RESOURCE_TYPE = "GCP::SecretManager::Secret"; 35 | 36 | public Secret() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/security/WebSecurity.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.security; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = WebSecurity.TABLE_NAME) 31 | public class WebSecurity extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpsecurityscanconfig"; 34 | public static final String RESOURCE_TYPE = "GCP::WebSecurityScanner::ScanConfig"; 35 | 36 | public WebSecurity() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/service/Service.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.service; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Service.TABLE_NAME) 31 | public class Service extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpservicediscoveryservice"; 34 | public static final String RESOURCE_TYPE = "GCP::ServiceDirectory::Service"; 35 | 36 | public Service() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/spanner/SpannerInstance.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.spanner; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = SpannerInstance.TABLE_NAME) 31 | public class SpannerInstance extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpspannerinstance"; 34 | public static final String RESOURCE_TYPE = "GCP::Spanner::Instance"; 35 | 36 | public SpannerInstance() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/sql/SqlInstance.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.sql; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = SqlInstance.TABLE_NAME) 31 | public class SqlInstance extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpsqlinstance"; 34 | public static final String RESOURCE_TYPE = "GCP::SQL::Instance"; 35 | 36 | public SqlInstance() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/storage/StorageBucket.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.storage; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = StorageBucket.TABLE_NAME) 31 | public class StorageBucket extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpstoragebucket"; 34 | public static final String RESOURCE_TYPE = "GCP::Storage::Bucket"; 35 | 36 | public StorageBucket() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/talent/Tenant.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.talent; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Tenant.TABLE_NAME) 31 | public class Tenant extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcptalenttenant"; 34 | public static final String RESOURCE_TYPE = "GCP::Talent::Tenant"; 35 | 36 | public Tenant() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/task/TaskQueue.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.task; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = TaskQueue.TABLE_NAME) 31 | public class TaskQueue extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcptaskqueue"; 34 | public static final String RESOURCE_TYPE = "GCP::Tasks::Queue"; 35 | 36 | public TaskQueue() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/trace/Trace.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.trace; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Trace.TABLE_NAME) 31 | public class Trace extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcptrace"; 34 | public static final String RESOURCE_TYPE = "GCP::Trace::Trace"; 35 | 36 | public Trace() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/translate/Glossary.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.translate; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Glossary.TABLE_NAME) 31 | public class Glossary extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcptranslateglossary"; 34 | public static final String RESOURCE_TYPE = "GCP::Translate::Glossary"; 35 | 36 | public Glossary() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/vision/Product.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.vision; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Product.TABLE_NAME) 31 | public class Product extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpvisionproduct"; 34 | public static final String RESOURCE_TYPE = "GCP::Vision::Product"; 35 | 36 | public Product() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/vision/ProductSet.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.vision; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = ProductSet.TABLE_NAME) 31 | public class ProductSet extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpvisionproductset"; 34 | public static final String RESOURCE_TYPE = "GCP::Vision::ProductSet"; 35 | 36 | public ProductSet() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/vpc/Firewall.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.vpc; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Firewall.TABLE_NAME) 31 | public class Firewall extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpvpcfirewall"; 34 | public static final String RESOURCE_TYPE = "GCP::VPC::Firewall"; 35 | 36 | public Firewall() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-data/src/main/java/io/openraven/magpie/data/gcp/vpc/Network.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * Magpie API 4 | * %% 5 | * Copyright (C) 2021 Open Raven Inc 6 | * %% 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * #L% 19 | */ 20 | package io.openraven.magpie.data.gcp.vpc; 21 | 22 | import io.openraven.magpie.data.gcp.GCPResource; 23 | 24 | import jakarta.persistence.Entity; 25 | import jakarta.persistence.Inheritance; 26 | import jakarta.persistence.Table; 27 | 28 | @Entity 29 | @Inheritance(strategy = jakarta.persistence.InheritanceType.TABLE_PER_CLASS) 30 | @Table(name = Network.TABLE_NAME) 31 | public class Network extends GCPResource { 32 | 33 | protected static final String TABLE_NAME = "gcpvpcnetwork"; 34 | public static final String RESOURCE_TYPE = "GCP::VPC::Network"; 35 | 36 | public Network() { 37 | this.resourceType = RESOURCE_TYPE; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /magpie-gcp/src/main/java/io/openraven/magpie/plugins/gcp/discovery/exception/GcpDiscoveryException.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.plugins.gcp.discovery.exception; 2 | 3 | public class GcpDiscoveryException extends RuntimeException { 4 | public GcpDiscoveryException(String message, Throwable cause) { 5 | super(message, cause); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /magpie-gcp/src/main/resources/META-INF/services/io.openraven.magpie.api.OriginPlugin: -------------------------------------------------------------------------------- 1 | io.openraven.magpie.plugins.gcp.discovery.GCPDiscoveryPlugin 2 | -------------------------------------------------------------------------------- /magpie-json/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | magpie-parent 5 | io.openraven.magpie 6 | 0.11.7-SNAPSHOT 7 | 8 | 4.0.0 9 | 10 | magpie-json 11 | 12 | 13 | 17 14 | 17 15 | 16 | 17 | 18 | 19 | io.openraven.magpie 20 | magpie-api 21 | 22 | 23 | com.fasterxml.jackson.core 24 | jackson-databind 25 | 26 | 27 | com.fasterxml.jackson.datatype 28 | jackson-datatype-jsr310 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /magpie-json/src/main/resources/META-INF/services/io.openraven.magpie.api.TerminalPlugin: -------------------------------------------------------------------------------- 1 | io.openraven.magpie.plugins.json.JSONPlugin 2 | -------------------------------------------------------------------------------- /magpie-persist/src/main/java/io/openraven/magpie/plugins/persist/AssetsRepo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.plugins.persist; 18 | 19 | import io.openraven.magpie.data.Resource; 20 | 21 | import java.io.Closeable; 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | public interface AssetsRepo extends Closeable { 26 | 27 | void upsert(Resource awsResource); 28 | 29 | void upsert(List awsResource); 30 | 31 | void executeNative(String query); 32 | 33 | List> queryNative(String query); 34 | 35 | Long getAssetCount(String resourceType); 36 | } 37 | -------------------------------------------------------------------------------- /magpie-persist/src/main/java/io/openraven/magpie/plugins/persist/config/PostgreSQL10StringDialect.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.openraven.magpie.plugins.persist.config; 18 | 19 | 20 | import org.hibernate.dialect.PostgreSQLDialect; 21 | 22 | public class PostgreSQL10StringDialect extends PostgreSQLDialect { 23 | 24 | public PostgreSQL10StringDialect() { 25 | super(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /magpie-persist/src/main/resources/META-INF/services/io.openraven.magpie.api.TerminalPlugin: -------------------------------------------------------------------------------- 1 | io.openraven.magpie.plugins.persist.PersistPlugin 2 | -------------------------------------------------------------------------------- /magpie-persist/src/main/resources/db/migration/V1__create_assets_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS aws( 2 | documentid TEXT primary key not null, 3 | arn TEXT, 4 | resourcename TEXT, 5 | resourceid TEXT, 6 | resourcetype TEXT, 7 | awsregion TEXT, 8 | awsaccountid TEXT, 9 | creatediso TIMESTAMPTZ, 10 | updatediso TIMESTAMPTZ, 11 | discoverysessionid TEXT, 12 | tags JSONB, 13 | configuration JSONB, 14 | supplementaryconfiguration JSONB, 15 | discoverymeta JSONB 16 | ); 17 | CREATE INDEX IF NOT EXISTS aws_resource_type ON aws (resourcetype); 18 | 19 | CREATE TABLE IF NOT EXISTS gcp ( 20 | documentid TEXT primary key not null, 21 | assetid TEXT, 22 | resourcename TEXT, 23 | resourceid TEXT, 24 | resourcetype TEXT, 25 | region TEXT, 26 | gcpaccountid TEXT, 27 | projectid TEXT, 28 | creatediso TIMESTAMPTZ, 29 | updatediso TIMESTAMPTZ, 30 | discoverysessionid TEXT, 31 | tags JSONB, 32 | configuration JSONB, 33 | supplementaryconfiguration JSONB, 34 | discoverymeta JSONB 35 | ); 36 | CREATE INDEX IF NOT EXISTS gcp_resource_type ON gcp (resourcetype); 37 | -------------------------------------------------------------------------------- /magpie-persist/src/main/resources/db/migration/V3__create_subnet_table.sql: -------------------------------------------------------------------------------- 1 | create table awsec2subnet () INHERITS (aws); 2 | -------------------------------------------------------------------------------- /magpie-persist/src/main/resources/db/migration/V4__create_transit_table.sql: -------------------------------------------------------------------------------- 1 | create table awsec2transitgateway () INHERITS (aws); 2 | -------------------------------------------------------------------------------- /magpie-persist/src/main/resources/db/migration/V5__create_orgscp_table.sql: -------------------------------------------------------------------------------- 1 | create table awsorganizationscp () INHERITS (aws); 2 | -------------------------------------------------------------------------------- /magpie-persist/src/main/resources/db/migration/V6__create_rdsproxy_table.sql: -------------------------------------------------------------------------------- 1 | create table awsrdsproxy () INHERITS (aws); 2 | -------------------------------------------------------------------------------- /magpie-persist/src/main/resources/db/migration/V7__create_azure_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS azure ( 2 | documentid TEXT primary key not null, 3 | resourceid TEXT, 4 | resourcename TEXT, 5 | resourcetype TEXT, 6 | region TEXT, 7 | subscriptionid TEXT, 8 | containingEntity TEXT, 9 | containingEntityid TEXT, 10 | projectid TEXT, 11 | creatediso TIMESTAMPTZ, 12 | updatediso TIMESTAMPTZ, 13 | discoverysessionid TEXT, 14 | tags JSONB, 15 | configuration JSONB, 16 | supplementaryconfiguration JSONB, 17 | discoverymeta JSONB 18 | ); 19 | CREATE INDEX IF NOT EXISTS azure_resource_type ON azure (resourcetype); 20 | 21 | create table azuresqldatabase () INHERITS (azure); 22 | create table azuresqlserver () INHERITS (azure); 23 | create table azurestorageaccount () INHERITS (azure); 24 | create table azurestorageblobcontainer () INHERITS (azure); 25 | create table azuresubscription () INHERITS (azure); 26 | -------------------------------------------------------------------------------- /magpie-persist/src/test/java/io/openraven/magpie/plugins/persist/TestUtils.java: -------------------------------------------------------------------------------- 1 | package io.openraven.magpie.plugins.persist; 2 | 3 | import java.nio.charset.StandardCharsets; 4 | import java.util.Objects; 5 | import java.util.Scanner; 6 | 7 | public class TestUtils { 8 | 9 | protected static String getResourceAsString(String resourcePath) { 10 | return new Scanner(Objects.requireNonNull(TestUtils.class.getResourceAsStream(resourcePath)), StandardCharsets.UTF_8) 11 | .useDelimiter("\\A").next(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /magpie-persist/src/test/resources/documents/envelope-content.json: -------------------------------------------------------------------------------- 1 | { 2 | "documentId":"4jUz_CPXMG-Z7f8oJltkPg", 3 | "arn":"arn:aws:iam::000000000000:group/Accountants", 4 | "resourceName":"Accountants", 5 | "resourceId":"y9xomssf3o582439fxep", 6 | "resourceType":"AWS::IAM::Group", 7 | "awsRegion":"us-west-1", 8 | "awsAccountId":"account", 9 | "createdIso":null, 10 | "updatedIso":"2021-06-23T09:44:50.397706Z", 11 | "discoverySessionId":null, 12 | "maxSizeInBytes":null, 13 | "sizeInBytes":null, 14 | "configuration":{ 15 | "path":"/", 16 | "groupName":"Accountants", 17 | "groupId":"y9xomssf3o582439fxep", 18 | "arn":"arn:aws:iam::000000000000:group/Accountants", 19 | "createDate":null 20 | }, 21 | "supplementaryConfiguration":{ 22 | "inlinePolicies":[ 23 | { 24 | "name":"inlineDataAccess", 25 | "policyDocument":"{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"dynamodb:DeleteItem\",\"dynamodb:GetItem\"],\"Resource\":\"*\"}]}" 26 | } 27 | ], 28 | "attachedPolicies":[ 29 | { 30 | "name":"managedDataAccess", 31 | "arn":"arn:aws:iam::000000000000:policy/managedDataAccess" 32 | } 33 | ] 34 | }, 35 | "tags":{ 36 | 37 | }, 38 | "discoveryMeta":{ 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /magpie-persist/src/test/resources/documents/outdated-envelope-content.json: -------------------------------------------------------------------------------- 1 | { 2 | "documentId":"4jUz_CPXMG-Z7f8oJltkPg", 3 | "arn":"arn:aws:iam::000000000000:group/Accountants", 4 | "resourceName":"outdated-resource", 5 | "resourceId":"y9xomssf3o582439fxep", 6 | "resourceType":"AWS::IAM::Group", 7 | "awsRegion":"us-west-1", 8 | "awsAccountId":"account1", 9 | "createdIso":null, 10 | "updatedIso":"2021-06-23T09:44:50.397706Z", 11 | "discoverySessionId":null, 12 | "maxSizeInBytes":null, 13 | "sizeInBytes":null, 14 | "configuration":{ 15 | "path":"/", 16 | "groupName":"Accountants", 17 | "groupId":"y9xomssf3o582439fxep", 18 | "arn":"arn:aws:iam::000000000000:group/Accountants", 19 | "createDate":null 20 | }, 21 | "supplementaryConfiguration":{ 22 | "inlinePolicies":[ 23 | { 24 | "name":"inlineDataAccess", 25 | "policyDocument":"{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"dynamodb:DeleteItem\",\"dynamodb:GetItem\"],\"Resource\":\"*\"}]}" 26 | } 27 | ], 28 | "attachedPolicies":[ 29 | { 30 | "name":"managedDataAccess", 31 | "arn":"arn:aws:iam::000000000000:policy/managedDataAccess" 32 | } 33 | ] 34 | }, 35 | "tags":{ 36 | 37 | }, 38 | "discoveryMeta":{ 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /magpie-policy-output-csv/src/main/java/io/openraven/magpie/plugins/policy/output/csv/analysis/ScanMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.plugins.policy.output.csv.analysis; 17 | 18 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 19 | 20 | import java.time.Duration; 21 | import java.util.Date; 22 | 23 | @JsonIgnoreProperties(ignoreUnknown = true) 24 | public class ScanMetadata { 25 | private Date startDateTime; 26 | private Duration duration; 27 | 28 | public Date getStartDateTime() { 29 | return startDateTime; 30 | } 31 | 32 | public Duration getDuration() { 33 | return duration; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /magpie-policy-output-csv/src/main/java/io/openraven/magpie/plugins/policy/output/csv/exception/CsvOutputException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.plugins.policy.output.csv.exception; 17 | 18 | public class CsvOutputException extends RuntimeException { 19 | public CsvOutputException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /magpie-policy-output-csv/src/main/java/io/openraven/magpie/plugins/policy/output/csv/model/Severity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.plugins.policy.output.csv.model; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | public enum Severity { 21 | @JsonProperty("high") 22 | HIGH("High"), 23 | @JsonProperty("medium") 24 | MEDIUM("Medium"), 25 | @JsonProperty("low") 26 | LOW("Low"); 27 | 28 | private final String title; 29 | 30 | Severity(String title) { 31 | this.title = title; 32 | } 33 | 34 | public String getTitle() { 35 | return title; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /magpie-policy-output-csv/src/main/resources/META-INF/services/io.openraven.magpie.api.PolicyOutputPlugin: -------------------------------------------------------------------------------- 1 | io.openraven.magpie.plugins.policy.output.csv.CsvReportPlugin 2 | -------------------------------------------------------------------------------- /magpie-policy-output-json/src/main/java/io/openraven/magpie/plugins/policy/output/json/analysis/ScanMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.plugins.policy.output.json.analysis; 17 | 18 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 19 | 20 | import java.time.Duration; 21 | import java.util.Date; 22 | 23 | @JsonIgnoreProperties(ignoreUnknown = true) 24 | public class ScanMetadata { 25 | private Date startDateTime; 26 | private Duration duration; 27 | 28 | public Date getStartDateTime() { 29 | return startDateTime; 30 | } 31 | 32 | public Duration getDuration() { 33 | return duration; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /magpie-policy-output-json/src/main/java/io/openraven/magpie/plugins/policy/output/json/model/Severity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.plugins.policy.output.json.model; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | public enum Severity { 21 | @JsonProperty("high") 22 | HIGH("High"), 23 | @JsonProperty("medium") 24 | MEDIUM("Medium"), 25 | @JsonProperty("low") 26 | LOW("Low"); 27 | 28 | private final String title; 29 | 30 | Severity(String title) { 31 | this.title = title; 32 | } 33 | 34 | public String getTitle() { 35 | return title; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /magpie-policy-output-json/src/main/resources/META-INF/services/io.openraven.magpie.api.PolicyOutputPlugin: -------------------------------------------------------------------------------- 1 | io.openraven.magpie.plugins.policy.output.json.JsonReportPlugin 2 | -------------------------------------------------------------------------------- /magpie-policy-output-text/src/main/java/io/openraven/magpie/plugins/policy/output/text/analysis/ScanMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.plugins.policy.output.text.analysis; 17 | 18 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 19 | 20 | import java.time.Duration; 21 | import java.util.Date; 22 | 23 | @JsonIgnoreProperties(ignoreUnknown = true) 24 | public class ScanMetadata { 25 | private Date startDateTime; 26 | private Duration duration; 27 | 28 | public Date getStartDateTime() { 29 | return startDateTime; 30 | } 31 | 32 | public Duration getDuration() { 33 | return duration; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /magpie-policy-output-text/src/main/java/io/openraven/magpie/plugins/policy/output/text/model/Severity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Open Raven Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.openraven.magpie.plugins.policy.output.text.model; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | public enum Severity { 21 | @JsonProperty("high") 22 | HIGH("High"), 23 | @JsonProperty("medium") 24 | MEDIUM("Medium"), 25 | @JsonProperty("low") 26 | LOW("Low"); 27 | 28 | private final String title; 29 | 30 | Severity(String title) { 31 | this.title = title; 32 | } 33 | 34 | public String getTitle() { 35 | return title; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /magpie-policy-output-text/src/main/resources/META-INF/services/io.openraven.magpie.api.PolicyOutputPlugin: -------------------------------------------------------------------------------- 1 | io.openraven.magpie.plugins.policy.output.text.TextReportPlugin 2 | --------------------------------------------------------------------------------