Skip to content

Commit

Permalink
policy metadata changes to include policy_type and resource_type (#…
Browse files Browse the repository at this point in the history
…792)

* aws policy changes
* azure policy changes
* gcp policy changes
* github policy changes
* k8s policy changes
  • Loading branch information
patilpankaj212 authored May 24, 2021
1 parent 696481d commit e4ae20c
Show file tree
Hide file tree
Showing 611 changed files with 1,606 additions and 385 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "amiNotEncrypted",
"file": "amiNotEncrypted.rego",
"policy_type": "aws",
"resource_type": "aws_ami",
"template_args": null,
"severity": "MEDIUM",
"description": "Enable AWS AMI Encryption",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "amiSharedToMultipleAccounts",
"file": "amiSharedToMultipleAccounts.rego",
"policy_type": "aws",
"resource_type": "aws_ami_launch_permission",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "apiGatewayAuthorizationDisabled",
"file": "apiGatewayAuthorizationDisabled.rego",
"policy_type": "aws",
"resource_type": "aws_api_gateway_method",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "apiGatewaySettingMetrics",
"file": "apiGatewaySettingMetrics.rego",
"policy_type": "aws",
"resource_type": "aws_api_gateway_method_settings",
"template_args": null,
"severity": "MEDIUM",
"description": "Enable Detailed CloudWatch Metrics for APIs",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "apiGatewayContentEncoding",
"file": "apiGatewayContentEncoding.rego",
"template_args": null,
"severity": "MEDIUM",
"description": "Enable Content Encoding",
"reference_id": "AWS.APIGateway.Medium.0568",
"category": "Infrastructure Security",
"version": 1
}
"name": "apiGatewayContentEncoding",
"file": "apiGatewayContentEncoding.rego",
"policy_type": "aws",
"resource_type": "aws_api_gateway_rest_api",
"template_args": null,
"severity": "MEDIUM",
"description": "Enable Content Encoding",
"reference_id": "AWS.APIGateway.Medium.0568",
"category": "Infrastructure Security",
"version": 1
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "apiGatewayEndpointConfig",
"file": "apiGatewayEndpointConfig.rego",
"policy_type": "aws",
"resource_type": "aws_api_gateway_rest_api",
"template_args": null,
"severity": "MEDIUM",
"description": "API Gateway Private Endpoints",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "apiGatewayRestApiPolicyNotSecure",
"file": "apiGatewayRestApiPolicyNotSecure.rego",
"policy_type": "aws",
"resource_type": "aws_api_gateway_rest_api_policy",
"template_args": {
"prefix": ""
},
Expand All @@ -9,5 +11,4 @@
"reference_id": "AC_AWS_064",
"category": "Identity and Access Management",
"version": 1
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "apiGatewayName",
"file": "apiGatewayName.rego",
"policy_type": "aws",
"resource_type": "aws_api_gateway_stage",
"template_args": null,
"severity": "MEDIUM",
"description": "Enable AWS CloudWatch Logs for APIs",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "apiGatewayTracing",
"file": "apiGatewayTracing.rego",
"policy_type": "aws",
"resource_type": "aws_api_gateway_stage",
"template_args": null,
"severity": "MEDIUM",
"description": "Enable Active Tracing",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "apiGatewayLogging",
"file": "apiGatewayLogging.rego",
"policy_type": "aws",
"resource_type": "aws_api_gateway_stage",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "apiGatewaySslCertificate",
"file": "apiGatewaySslCertificate.rego",
"policy_type": "aws",
"resource_type": "aws_api_gateway_stage",
"template_args": null,
"severity": "MEDIUM",
"description": "Enable SSL Client Certificate",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "apiGatewayMiconfiguredCors",
"file": "apiGatewayMiconfiguredCors.rego",
"policy_type": "aws",
"resource_type": "aws_apigatewayv2_api",
"template_args": null,
"severity": "Medium",
"description": "Insecure Cross-Origin Resource Sharing Configuration allowing all domains",
"reference_id": "AWS.ApiGatewayV2Api.AccessControl.0630",
"category": "Security Best Practices",
"version": 2
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "apiGatewayNoAccessLogs",
"file": "apiGatewayNoAccessLogs.rego",
"policy_type": "aws",
"resource_type": "aws_apigatewayv2_stage",
"template_args": null,
"severity": "Low",
"description": "AWS API Gateway V2 Stage is missing access logs",
"reference_id": "AWS.ApiGatewayV2Stage.Logging.0630",
"category": "Logging and Monitoring",
"version": 2
}
}
2 changes: 2 additions & 0 deletions pkg/policies/opa/rego/aws/aws_athena_database/AC_AWS_016.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "athenaDatabaseEncrypted",
"file": "athenaDatabaseEncrypted.rego",
"policy_type": "aws",
"resource_type": "aws_athena_database",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "awsCloudFormationInUse",
"file": "cloudFormationNullCheck.rego",
"policy_type": "aws",
"resource_type": "aws_cloudformation_stack",
"template_args": {
"name": "awsCloudFormationInUse",
"property": "template_url"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudFormationStackNotifs",
"file": "cloudFormationNullCheck.rego",
"policy_type": "aws",
"resource_type": "aws_cloudformation_stack",
"template_args": {
"name": "cloudFormationStackNotifs",
"property": "notification_arns"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudFormationStackPolicy",
"file": "cloudFormationNullCheck.rego",
"policy_type": "aws",
"resource_type": "aws_cloudformation_stack",
"template_args": {
"name": "cloudFormationStackPolicy",
"property": "policy_url"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudFormationTerminationProtection",
"file": "cloudFormationTerminationProtection.rego",
"policy_type": "aws",
"resource_type": "aws_cloudformation_stack",
"template_args": null,
"severity": "MEDIUM",
"description": "Enable AWS CloudFormation Stack Termination Protection",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudfrontNoGeoRestriction",
"file": "cloudfrontNoGeoRestriction.rego",
"policy_type": "aws",
"resource_type": "aws_cloudfront_distribution",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "noWafEnabled",
"file": "noWafEnabled.rego",
"policy_type": "aws",
"resource_type": "aws_cloudfront_distribution",
"template_args": null,
"severity": "Medium",
"description": "Ensure that cloud-front has web application firewall enabled",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudfrontNoHTTPSTraffic",
"file": "cloudfrontNoHTTPSTraffic.rego",
"policy_type": "aws",
"resource_type": "aws_cloudfront_distribution",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudfrontNoSecureCiphers",
"file": "cloudfrontNoSecureCiphers.rego",
"policy_type": "aws",
"resource_type": "aws_cloudfront_distribution",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudfrontNoLogging",
"file": "cloudfrontNoLogging.rego",
"policy_type": "aws",
"resource_type": "aws_cloudfront_distribution",
"template_args": {
"prefix": ""
},
Expand Down
2 changes: 2 additions & 0 deletions pkg/policies/opa/rego/aws/aws_cloudtrail/AC_AWS_067.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudTrailLogValidationDisabled",
"file": "cloudTrailLogValidationDisabled.rego",
"policy_type": "aws",
"resource_type": "aws_cloudtrail",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudTrailLogNotEncrypted",
"file": "cloudTrailLogNotEncrypted.rego",
"policy_type": "aws",
"resource_type": "aws_cloudtrail",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "reme_enableSNSTopic",
"file": "enableSNSTopic.rego",
"policy_type": "aws",
"resource_type": "aws_cloudtrail",
"template_args": {
"prefix": "reme_"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudTrailMultiRegionNotCreated",
"file": "cloudTrailMultiRegionNotCreated.rego",
"policy_type": "aws",
"resource_type": "aws_cloudtrail",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "logGroupNotEncryptedWithKms",
"file": "logGroupNotEncryptedWithKms.rego",
"policy_type": "aws",
"resource_type": "aws_cloudwatch",
"template_args": null,
"severity": "HIGH",
"description": "AWS CloudWatch log group is not encrypted with a KMS CMK",
"reference_id": "AWS.CloudWatch.EncryptionandKeyManagement.High.0632",
"category": "Data Protection",
"version": 2
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "awsCloudWatchRetentionPreiod",
"file": "awsCloudWatchRetentionPreiod.rego",
"policy_type": "aws",
"resource_type": "aws_cloudwatch",
"template_args": null,
"severity": "MEDIUM",
"description": "App-Tier CloudWatch Log Group Retention Period",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "cloudWatchLogGroupNoRetentionPolicy",
"file": "cloudWatchLogGroupNoRetentionPolicy.rego",
"policy_type": "aws",
"resource_type": "aws_cloudwatch_log_group",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "awsConfigEncryptedVol",
"file": "awsConfigEncryptedVol.rego",
"policy_type": "aws",
"resource_type": "aws_config",
"template_args": null,
"severity": "MEDIUM",
"description": "Ensure AWS Config Rule is enabled for Encrypted Volumes",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "configEnabledForAllRegions",
"file": "configEnabledForAllRegions.rego",
"policy_type": "aws",
"resource_type": "aws_config_configuration_aggregator",
"template_args": {
"prefix": ""
},
Expand Down
2 changes: 2 additions & 0 deletions pkg/policies/opa/rego/aws/aws_dax_cluster/AC_AWS_021.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "daxSse",
"file": "daxSse.rego",
"policy_type": "aws",
"resource_type": "aws_dax_cluster",
"template_args": {
"prefix": ""
},
Expand Down
2 changes: 2 additions & 0 deletions pkg/policies/opa/rego/aws/aws_db_instance/AC_AWS_076.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "dbInstanceLoggingDisabled",
"file": "dbInstanceLoggingDisabled.rego",
"policy_type": "aws",
"resource_type": "aws_db_instance",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "rdsAutoMinorVersionUpgradeEnabled",
"file": "rdsAutoMinorVersionUpgradeEnabled.rego",
"policy_type": "aws",
"resource_type": "aws_db_instance",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "rdsCAExpired",
"file": "rdsCAExpired.rego",
"policy_type": "aws",
"resource_type": "aws_db_instance",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "rdsHasStorageEncrypted",
"file": "rdsHasStorageEncrypted.rego",
"policy_type": "aws",
"resource_type": "aws_db_instance",
"template_args": null,
"severity": "HIGH",
"description": "Ensure that your RDS database instances encrypt the underlying storage. Encrypted RDS instances use the industry standard AES-256 encryption algorithm to encrypt data on the server that hosts RDS DB instances. After data is encrypted, RDS handles authentication of access and descryption of data transparently with minimal impact on performance.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "rdsIamAuthEnabled",
"file": "rdsIamAuthEnabled.rego",
"policy_type": "aws",
"resource_type": "aws_db_instance",
"template_args": {
"prefix": ""
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "rdsPubliclyAccessible",
"file": "rdsPubliclyAccessible.rego",
"policy_type": "aws",
"resource_type": "aws_db_instance",
"template_args": {
"prefix": ""
},
Expand Down
Loading

0 comments on commit e4ae20c

Please sign in to comment.