diff --git a/transformations/aws/compliance-free/models/aws_compliance__foundational_security_free.sql b/transformations/aws/compliance-free/models/aws_compliance__foundational_security_free.sql index 48de7c74d..e63305dba 100644 --- a/transformations/aws/compliance-free/models/aws_compliance__foundational_security_free.sql +++ b/transformations/aws/compliance-free/models/aws_compliance__foundational_security_free.sql @@ -1,4 +1,4 @@ -{{ config(enabled=is_snowflake()) }} +{{ config(enabled=block_bigquery() and block_postgres()) }} with aggregated as ( diff --git a/transformations/aws/compliance-free/models/aws_compliance__pci_dss_v3_2_1_free.sql b/transformations/aws/compliance-free/models/aws_compliance__pci_dss_v3_2_1_free.sql index 2a1251e59..a11bffb3b 100644 --- a/transformations/aws/compliance-free/models/aws_compliance__pci_dss_v3_2_1_free.sql +++ b/transformations/aws/compliance-free/models/aws_compliance__pci_dss_v3_2_1_free.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery()) }} + with aggregated as ( ({{ autoscaling_groups_elb_check('pci_dss_v3.2.1','autoscaling.1') }}) diff --git a/transformations/aws/compliance-premium/models/aws_compliance__foundational_security.sql b/transformations/aws/compliance-premium/models/aws_compliance__foundational_security.sql index d3c031c34..f830d4820 100644 --- a/transformations/aws/compliance-premium/models/aws_compliance__foundational_security.sql +++ b/transformations/aws/compliance-premium/models/aws_compliance__foundational_security.sql @@ -1,4 +1,4 @@ -{{ config(enabled=is_snowflake()) }} +{{ config(enabled=block_bigquery() and block_postgres()) }} with aggregated as ( diff --git a/transformations/aws/compliance-premium/models/aws_compliance__imds_v2.sql b/transformations/aws/compliance-premium/models/aws_compliance__imds_v2.sql index d9cb9ef2c..5852df690 100644 --- a/transformations/aws/compliance-premium/models/aws_compliance__imds_v2.sql +++ b/transformations/aws/compliance-premium/models/aws_compliance__imds_v2.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery() and block_snowflake()) }} + with aggregated as ( ({{ ec2_not_imdsv2_instances('imds_v2','EC2-IMDSv2') }}) diff --git a/transformations/aws/compliance-premium/models/aws_compliance__pci_dss_v3.2.1.sql b/transformations/aws/compliance-premium/models/aws_compliance__pci_dss_v3.2.1.sql index 0126d8a05..c5553ba72 100644 --- a/transformations/aws/compliance-premium/models/aws_compliance__pci_dss_v3.2.1.sql +++ b/transformations/aws/compliance-premium/models/aws_compliance__pci_dss_v3.2.1.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery() and block_snowflake()) }} + with aggregated as ( ({{ autoscaling_groups_elb_check('pci_dss_v3.2.1','autoscaling.1') }}) diff --git a/transformations/aws/compliance-premium/models/aws_compliance__public_egress.sql b/transformations/aws/compliance-premium/models/aws_compliance__public_egress.sql index c394db40d..37b3175c8 100644 --- a/transformations/aws/compliance-premium/models/aws_compliance__public_egress.sql +++ b/transformations/aws/compliance-premium/models/aws_compliance__public_egress.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery() and block_snowflake()) }} + with aggregated as ( ({{ public_egress_sg_and_routing_instances('public_egress','ec2-all-instances-with-routes-and-security-groups') }}) diff --git a/transformations/aws/compliance-premium/models/aws_compliance__publicly_available.sql b/transformations/aws/compliance-premium/models/aws_compliance__publicly_available.sql index aad75748b..8de75f69b 100644 --- a/transformations/aws/compliance-premium/models/aws_compliance__publicly_available.sql +++ b/transformations/aws/compliance-premium/models/aws_compliance__publicly_available.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery() and block_snowflake()) }} + with aggregated as ( ({{ api_gw_publicly_accessible('publicly_available','API-Gateways') }}) diff --git a/transformations/aws/macros/efs/access_point_enforce_user_identity.sql b/transformations/aws/macros/efs/access_point_enforce_user_identity.sql index 75f490e26..ada9313ec 100644 --- a/transformations/aws/macros/efs/access_point_enforce_user_identity.sql +++ b/transformations/aws/macros/efs/access_point_enforce_user_identity.sql @@ -1,5 +1,3 @@ -{{ config(enabled=is_snowflake()) }} - {% macro access_point_enforce_user_identity(framework, check_id) %} {{ return(adapter.dispatch('access_point_enforce_user_identity')(framework, check_id)) }} {% endmacro %} diff --git a/transformations/aws/models/aws_compliance__api_gateway_method_settings.sql b/transformations/aws/models/aws_compliance__api_gateway_method_settings.sql index 579e5c7c6..bba559d35 100644 --- a/transformations/aws/models/aws_compliance__api_gateway_method_settings.sql +++ b/transformations/aws/models/aws_compliance__api_gateway_method_settings.sql @@ -1 +1,3 @@ +{{ config(enabled=block_bigquery()) }} + {{ api_gateway_method_settings() }} \ No newline at end of file diff --git a/transformations/aws/models/aws_compliance__networks_acls_ingress_rules.sql b/transformations/aws/models/aws_compliance__networks_acls_ingress_rules.sql index 0642eee7a..a42264819 100644 --- a/transformations/aws/models/aws_compliance__networks_acls_ingress_rules.sql +++ b/transformations/aws/models/aws_compliance__networks_acls_ingress_rules.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery()) }} + with aggregated as ( ({{ networks_acls_ingress_rules() }}) diff --git a/transformations/aws/models/aws_compliance__security_group_egress_rules.sql b/transformations/aws/models/aws_compliance__security_group_egress_rules.sql index ed4cf6a07..a36b6215e 100644 --- a/transformations/aws/models/aws_compliance__security_group_egress_rules.sql +++ b/transformations/aws/models/aws_compliance__security_group_egress_rules.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery()) }} + with aggregated as ( ({{ security_group_egress_rules() }}) diff --git a/transformations/azure/compliance-free/dbt_project.yml b/transformations/azure/compliance-free/dbt_project.yml index ecf7c0c4f..6fd68f2c9 100644 --- a/transformations/azure/compliance-free/dbt_project.yml +++ b/transformations/azure/compliance-free/dbt_project.yml @@ -15,7 +15,7 @@ model-paths: ["models", "../models"] analysis-paths: ["analyses"] test-paths: ["tests"] seed-paths: ["seeds"] -macro-paths: ["../macros"] +macro-paths: ["../macros", "../../macros"] snapshot-paths: ["snapshots"] clean-targets: # directories to be removed by `dbt clean` diff --git a/transformations/azure/compliance-free/models/azure_compliance__cis_v1_3_0_free.sql b/transformations/azure/compliance-free/models/azure_compliance__cis_v1_3_0_free.sql index 41320f52f..bb25d30e6 100644 --- a/transformations/azure/compliance-free/models/azure_compliance__cis_v1_3_0_free.sql +++ b/transformations/azure/compliance-free/models/azure_compliance__cis_v1_3_0_free.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery()) }} + with aggregated as ( ({{iam_custom_subscription_owner_roles('cis_v1.3.0','1.21')}}) diff --git a/transformations/azure/compliance-free/profiles.yml b/transformations/azure/compliance-free/profiles.yml deleted file mode 100644 index a87ed4d91..000000000 --- a/transformations/azure/compliance-free/profiles.yml +++ /dev/null @@ -1,12 +0,0 @@ -azure_compliance: # This should match the name in your dbt_project.yml - target: dev - outputs: - dev: - type: postgres - host: 127.0.0.1 - user: postgres - pass: pass - port: 5432 - dbname: postgres - schema: public # default schema where dbt will build the models - threads: 1 # number of threads to use when running in parallel diff --git a/transformations/azure/compliance-premium/dbt_project.yml b/transformations/azure/compliance-premium/dbt_project.yml index ecf7c0c4f..6fd68f2c9 100644 --- a/transformations/azure/compliance-premium/dbt_project.yml +++ b/transformations/azure/compliance-premium/dbt_project.yml @@ -15,7 +15,7 @@ model-paths: ["models", "../models"] analysis-paths: ["analyses"] test-paths: ["tests"] seed-paths: ["seeds"] -macro-paths: ["../macros"] +macro-paths: ["../macros", "../../macros"] snapshot-paths: ["snapshots"] clean-targets: # directories to be removed by `dbt clean` diff --git a/transformations/azure/compliance-premium/models/azure_compliance__cis_v1_3_0.sql b/transformations/azure/compliance-premium/models/azure_compliance__cis_v1_3_0.sql index 485c592c5..5ff93702d 100644 --- a/transformations/azure/compliance-premium/models/azure_compliance__cis_v1_3_0.sql +++ b/transformations/azure/compliance-premium/models/azure_compliance__cis_v1_3_0.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery()) }} + with aggregated as ( ({{iam_custom_subscription_owner_roles('cis_v1.3.0','1.21')}}) diff --git a/transformations/azure/compliance-premium/profiles.yml b/transformations/azure/compliance-premium/profiles.yml deleted file mode 100644 index a87ed4d91..000000000 --- a/transformations/azure/compliance-premium/profiles.yml +++ /dev/null @@ -1,12 +0,0 @@ -azure_compliance: # This should match the name in your dbt_project.yml - target: dev - outputs: - dev: - type: postgres - host: 127.0.0.1 - user: postgres - pass: pass - port: 5432 - dbname: postgres - schema: public # default schema where dbt will build the models - threads: 1 # number of threads to use when running in parallel diff --git a/transformations/azure/models/view_azure_nsg_dest_port_ranges.sql b/transformations/azure/models/view_azure_nsg_dest_port_ranges.sql index eb1a45937..57c6f592f 100644 --- a/transformations/azure/models/view_azure_nsg_dest_port_ranges.sql +++ b/transformations/azure/models/view_azure_nsg_dest_port_ranges.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery()) }} + with aggregated as ( ({{view_azure_nsg_dest_port_ranges()}}) diff --git a/transformations/azure/models/view_azure_nsg_rules.sql b/transformations/azure/models/view_azure_nsg_rules.sql index 82b034ba0..1b82b9158 100644 --- a/transformations/azure/models/view_azure_nsg_rules.sql +++ b/transformations/azure/models/view_azure_nsg_rules.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery()) }} + with aggregated as ( ({{view_azure_nsg_rules()}}) diff --git a/transformations/azure/models/view_azure_security_policy_parameters.sql b/transformations/azure/models/view_azure_security_policy_parameters.sql index e00be2b27..5fc9df57c 100644 --- a/transformations/azure/models/view_azure_security_policy_parameters.sql +++ b/transformations/azure/models/view_azure_security_policy_parameters.sql @@ -1,3 +1,5 @@ +{{ config(enabled=block_bigquery()) }} + with aggregated as ( ({{view_azure_security_policy_parameters()}}) diff --git a/transformations/macros/block_bigquery.sql b/transformations/macros/block_bigquery.sql new file mode 100644 index 000000000..2f1ed6046 --- /dev/null +++ b/transformations/macros/block_bigquery.sql @@ -0,0 +1,7 @@ +{% macro block_bigquery() %} + {% if target.type == 'bigquery' %} + {{ return(false) }} + {% else %} + {{ return(true) }} + {% endif %} +{% endmacro %} \ No newline at end of file diff --git a/transformations/macros/block_posgres.sql b/transformations/macros/block_posgres.sql new file mode 100644 index 000000000..63d472e1b --- /dev/null +++ b/transformations/macros/block_posgres.sql @@ -0,0 +1,7 @@ +{% macro block_postgres() %} + {% if target.type == 'postgres' %} + {{ return(false) }} + {% else %} + {{ return(true) }} + {% endif %} +{% endmacro %} \ No newline at end of file diff --git a/transformations/macros/block_snowflake.sql b/transformations/macros/block_snowflake.sql new file mode 100644 index 000000000..2faaf2100 --- /dev/null +++ b/transformations/macros/block_snowflake.sql @@ -0,0 +1,7 @@ +{% macro block_snowflake() %} + {% if target.type == 'snowflake' %} + {{ return(false) }} + {% else %} + {{ return(true) }} + {% endif %} +{% endmacro %} \ No newline at end of file