Publisher
cloudquery
Repository
github.comLatest version
v0.6.10
Type
Policy
Published
Category
Cloud Infrastructure
Loading addon documentation
Publisher
cloudquery
Repository
github.comLatest version
v0.6.10
Type
Policy
Published
Category
Cloud Infrastructure
Loading addon documentation
We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve. You can always opt out later via the link in the footer.
SELECT count(*) as failed_count
FROM k8s_compliance__cis_v1_8
WHERE status = 'fail'
SELECT resource_id, count(*) as failed_count
FROM k8s_compliance__nsa_cisa_v1
WHERE status = 'fail'
GROUP BY resource_id
ORDER BY count(*) DESC
dbt
:pip install dbt-postgres
mkdir -p ~/.dbt
profiles.yml
file in your profile directory (e.g. ~/.dbt/profiles.yml
):k8s_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
profiles.yml
, you should test the connection to ensure everything is configured correctly:dbt debug
cloudquery login
in your terminal.tables
part contains *
for the migration.kind: source
spec:
name: k8s # The source type, in this case, K8S.
path: cloudquery/k8s # The plugin path for handling K8S sources.
registry: cloudquery # The registry from which the K8S plugin is sourced.
version: "7.0.1" # The version of the K8S plugin.
tables: ["*"]
destinations: ["postgresql"] # The destination for the data, in this case, PostgreSQL.
skip_dependent_tables: true
spec:
cloudquery migrate config.yml
*
), but instead, focus on the relevant tables that match the policy to use fewer resources and save runtime. Below is an example of a sync for the relevant tables for the model Kubernetes CIS V1.8
with a PostgreSQL destination. You can modify the list of tables based on the compliance you want to check. This package also supports Snowflake and Google BigQuery.kind: source
spec:
name: k8s # The source type, in this case, K8S.
path: cloudquery/k8s # The plugin path for handling K8S sources.
registry: cloudquery # The registry from which the K8S plugin is sourced.
version: "7.0.1" # The version of the K8S plugin.
tables: ["k8s_networking_network_policies",
"k8s_rbac_cluster_role_bindings",
"k8s_core_pods",
"k8s_rbac_cluster_roles",
"k8s_core_namespaces",
"k8s_core_service_accounts",
"k8s_rbac_roles"]
destinations: ["postgresql"] # The destination for the data, in this case, PostgreSQL.
skip_dependent_tables: true
spec:
---
kind: destination
spec:
name: "postgresql" # The type of destination, in this case, PostgreSQL.
path: "cloudquery/postgresql" # The plugin path for handling PostgreSQL as a destination.
registry: "cloudquery" # The registry from which the PostgreSQL plugin is sourced.
version: "v8.5.2" # The version of the PostgreSQL plugin.
spec:
connection_string: "${POSTGRESQL_CONNECTION_STRING}" # set the environment variable in a format like
# postgresql://postgres:pass@localhost:5432/postgres?sslmode=disable
# You can also specify the connection string in DSN format, which allows for special characters in the password:
# connection_string: "user=postgres password=pass+0-[word host=localhost port=5432 dbname=postgres"
cloudquery sync config.yml
dbt_project.yml
resides. Make sure to have an existing profile in your profiles.yml
that contains your PostgreSQL/Snowflake/BigQuery connection and authentication information.dbt run
dbt
models and create tables/views in your destination database as defined in your models.dbt-core
and not dbt-cloud-cli
as dbt-core does not require extra authentication.--select
option with the dbt run
command. This command ensures that all dependencies for the specified model are also executed.dbt run --select +<model_name>
tables: ["k8s_networking_network_policies",
"k8s_rbac_cluster_role_bindings",
"k8s_core_pods",
"k8s_rbac_cluster_roles",
"k8s_core_namespaces",
"k8s_core_service_accounts",
"k8s_rbac_roles"]
tables: ["k8s_networking_network_policies",
"k8s_core_pods",
"k8s_core_namespaces",
"k8s_core_service_accounts",
"k8s_apps_daemon_sets",
"k8s_apps_replica_sets",
"k8s_apps_deployments",
"k8s_core_resource_quotas",
"k8s_core_limit_ranges",
"k8s_batch_jobs"]
Kubernetes CIS v1.8.0
api_server_1_2_1
: api_server_1_2_1
api_server_1_2_2
: api_server_1_2_2
api_server_1_2_3
: api_server_1_2_3
api_server_1_2_4
: api_server_1_2_4
api_server_1_2_5
: api_server_1_2_5
api_server_1_2_6
: api_server_1_2_6
api_server_1_2_7
: api_server_1_2_7
api_server_1_2_8
: api_server_1_2_8
api_server_1_2_9
: api_server_1_2_9
api_server_1_2_10
: api_server_1_2_10
api_server_1_2_11
: api_server_1_2_11
api_server_1_2_12
: api_server_1_2_12
api_server_1_2_13
: api_server_1_2_13
api_server_1_2_14
: api_server_1_2_14
api_server_1_2_15
: api_server_1_2_15
api_server_1_2_16
: api_server_1_2_16
api_server_1_2_17
: api_server_1_2_17
api_server_1_2_18
: api_server_1_2_18
api_server_1_2_19
: api_server_1_2_19
api_server_1_2_20
: api_server_1_2_20
api_server_1_2_21
: api_server_1_2_21
api_server_1_2_22
: api_server_1_2_22
api_server_1_2_23
: api_server_1_2_23
api_server_1_2_24
: api_server_1_2_24
api_server_1_2_25
: api_server_1_2_25
api_server_1_2_26
: api_server_1_2_26
api_server_1_2_27
: api_server_1_2_27
api_server_1_2_28
: api_server_1_2_28
api_server_1_2_29
: api_server_1_2_29
api_server_1_2_30
: api_server_1_2_30
controller_manager_1_3_1
: controller_manager_1_3_1
controller_manager_1_3_2
: controller_manager_1_3_2
controller_manager_1_3_3
: controller_manager_1_3_3
controller_manager_1_3_4
: controller_manager_1_3_4
controller_manager_1_3_5
: controller_manager_1_3_5
controller_manager_1_3_6
: controller_manager_1_3_6
controller_manager_1_3_7
: controller_manager_1_3_7
etcd_2_1
: etcd_2_1
etcd_2_2
: etcd_2_2
etcd_2_3
: etcd_2_3
etcd_2_4
: etcd_2_4
etcd_2_5
: etcd_2_5
etcd_2_6
: etcd_2_6
logging_3_2_1
: logging_3_2_1
pod_security_standards_5_2_1
: pod_security_standards_5_2_1
pod_security_standards_5_2_2
: pod_security_standards_5_2_2
pod_security_standards_5_2_3
: pod_security_standards_5_2_3
pod_security_standards_5_2_4
: pod_security_standards_5_2_4
pod_security_standards_5_2_5
: pod_security_standards_5_2_5
pod_security_standards_5_2_6
: pod_security_standards_5_2_6
pod_security_standards_5_2_8
: pod_security_standards_5_2_8
pod_security_standards_5_2_9
: pod_security_standards_5_2_9
pod_security_standards_5_2_10
: pod_security_standards_5_2_10
pod_security_standards_5_2_11
: pod_security_standards_5_2_11
pod_security_standards_5_2_12
: pod_security_standards_5_2_12
pod_security_standards_5_2_13
: pod_security_standards_5_2_13
pod_security_standards_5_3_2
: pod_security_standards_5_3_2
pod_security_standards_5_4_1
: pod_security_standards_5_4_1
pod_security_standards_5_4_2
: pod_security_standards_5_4_2
pod_security_standards_5_7_2
: pod_security_standards_5_7_2
pod_security_standards_5_7_3
: pod_security_standards_5_7_3
pod_security_standards_5_7_4
: pod_security_standards_5_7_4
rbac_and_service_accounts_5_1_1
: rbac_and_service_accounts_5_1_1
rbac_and_service_accounts_5_1_2
: rbac_and_service_accounts_5_1_2
rbac_and_service_accounts_5_1_3
: rbac_and_service_accounts_5_1_3
rbac_and_service_accounts_5_1_4
: rbac_and_service_accounts_5_1_4
rbac_and_service_accounts_5_1_5
: rbac_and_service_accounts_5_1_5
rbac_and_service_accounts_5_1_6
: rbac_and_service_accounts_5_1_6
rbac_and_service_accounts_5_1_7
: rbac_and_service_accounts_5_1_7
rbac_and_service_accounts_5_1_8
: rbac_and_service_accounts_5_1_8
rbac_and_service_accounts_5_1_9
: rbac_and_service_accounts_5_1_9
rbac_and_service_accounts_5_1_10
: rbac_and_service_accounts_5_1_10
rbac_and_service_accounts_5_1_11
: rbac_and_service_accounts_5_1_11
rbac_and_service_accounts_5_1_12
: rbac_and_service_accounts_5_1_12
rbac_and_service_accounts_5_1_13
: rbac_and_service_accounts_5_1_13
scheduler_1_4_1
: scheduler_1_4_1
scheduler_1_4_2
: scheduler_1_4_2
Kubernetes CIS v1.7.0
api_server_1_2_1
: api_server_1_2_1
nsa_cisa_v1
container_disallow_host_path
: pod_volume_host_path
daemonset_container_privilege_disabled
: daemonset_container_privilege_disabled
daemonset_container_privilege_escalation_disabled
: daemonset_container_privilege_escalation_disabled
daemonset_cpu_limit
: daemonset_cpu_limit
daemonset_cpu_request
: daemonset_cpu_request
daemonset_host_network_access_disabled
: daemonset_host_network_access_disabled
daemonset_hostpid_hostipc_sharing_disabled
: daemonset_hostpid_hostipc_sharing_disabled
daemonset_immutable_container_filesystem
: daemonset_immutable_container_filesystem
daemonset_memory_limit
: daemonset_memory_limit
daemonset_memory_request
: daemonset_memory_request
daemonset_non_root_container
: daemonset_non_root_container
deployment_container_privilege_disabled
: deployment_container_privilege_disabled
deployment_container_privilege_escalation_disabled
: deployment_container_privilege_escalation_disabled
deployment_cpu_limit
: deployment_cpu_limit
deployment_cpu_request
: deployment_cpu_request
deployment_host_network_access_disabled
: deployment_host_network_access_disabled
deployment_hostpid_hostipc_sharing_disabled
: deployment_hostpid_hostipc_sharing_disabled
deployment_immutable_container_filesystem
: deployment_immutable_container_filesystem
deployment_memory_limit
: deployment_memory_limit
deployment_memory_request
: deployment_memory_request
deployment_non_root_container
: deployment_non_root_container
job_container_privilege_disabled
: job_container_privilege_disabled
job_container_privilege_escalation_disabled
: job_container_privilege_escalation_disabled
job_cpu_limit
: job_cpu_limit
job_host_network_access_disabled
: job_host_network_access_disabled
job_hostpid_hostipc_sharing_disabled
: job_hostpid_hostipc_sharing_disabled
job_immutable_container_filesystem
: job_immutable_container_filesystem
job_memory_limit
: job_memory_limit
job_memory_request
: job_memory_request
job_non_root_container
: job_non_root_container
namespace_limit_range_default_cpu_limit
: namespace_limit_range_default_cpu_limit
namespace_limit_range_default_cpu_request
: namespace_limit_range_default_cpu_request
namespace_limit_range_default_memory_limit
: namespace_limit_range_default_memory_limit
namespace_limit_range_default_memory_request
: namespace_limit_range_default_memory_request
namespace_resource_quota_cpu_limit
: namespace_resource_quota_cpu_limit
namespace_resource_quota_cpu_request
: namespace_resource_quota_cpu_request
namespace_resource_quota_memory_limit
: namespace_resource_quota_memory_limit
namespace_resource_quota_memory_request
: namespace_resource_quota_memory_request
network_policy_default_deny_egress
: network_policy_default_deny_egress
network_policy_default_deny_ingress
: network_policy_default_deny_ingress
pod_container_privilege_disabled
: pod_container_privilege_disabled
pod_container_privilege_escalation_disabled
: pod_host_network_access_disabled
pod_hostpid_hostipc_sharing_disabled
: pod_hostpid_hostipc_sharing_disabled
pod_immutable_container_filesystem
: pod_immutable_container_filesystem
pod_non_root_container
: pod_non_root_container
pod_service_account_token_disabled
: pod_service_account_token_disabled
replicaset_container_privilege_disabled
: replicaset_container_privilege_disabled
replicaset_container_privilege_escalation_disabled
: replicaset_host_network_access_disabled
replicaset_cpu_limit
: replicaset_cpu_limit
replicaset_cpu_request
: replicaset_cpu_request
replicaset_hostpid_hostipc_sharing_disabled
: replicaset_hostpid_hostipc_sharing_disabled
replicaset_immutable_container_filesystem
: replicaset_immutable_container_filesystem
replicaset_memory_limit
: replicaset_memory_limit
replicaset_memory_request
: replicaset_memory_request
replicaset_non_root_container
: replicaset_non_root_container
service_account_token_disabled
: service_account_token_disabled