All Projects → cloudquery → Cloudquery

cloudquery / Cloudquery

Licence: mpl-2.0
cloudquery transforms your cloud infrastructure into SQL or Graph database for easy monitoring, governance and security.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Cloudquery

Cloud Custodian
Rules engine for cloud security, cost optimization, and governance, DSL in yaml for policies to query, filter, and take actions on resources
Stars: ✭ 3,926 (+202%)
Mutual labels:  aws, azure, gcp, cloud-computing, compliance
Pulumi
Pulumi - Developer-First Infrastructure as Code. Your Cloud, Your Language, Your Way 🚀
Stars: ✭ 10,887 (+737.46%)
Mutual labels:  aws, azure, gcp, cloud-computing
Checkov
Prevent cloud misconfigurations during build-time for Terraform, Cloudformation, Kubernetes, Serverless framework and other infrastructure-as-code-languages with Checkov by Bridgecrew.
Stars: ✭ 3,572 (+174.77%)
Mutual labels:  aws, azure, gcp, compliance
Examples
Infrastructure, containers, and serverless apps to AWS, Azure, GCP, and Kubernetes... all deployed with Pulumi
Stars: ✭ 1,085 (-16.54%)
Mutual labels:  aws, azure, gcp
Mkit
MKIT is a Managed Kubernetes Inspection Tool that validates several common security-related configuration settings of managed Kubernetes cluster objects and the workloads/resources running inside the cluster.
Stars: ✭ 330 (-74.62%)
Mutual labels:  aws, azure, gcp
Terratag
Terratag is a CLI tool that enables users of Terraform to automatically create and maintain tags across their entire set of AWS, Azure, and GCP resources
Stars: ✭ 385 (-70.38%)
Mutual labels:  aws, azure, gcp
Docker Android
Android in docker solution with noVNC supported and video recording
Stars: ✭ 4,042 (+210.92%)
Mutual labels:  aws, azure, gcp
Kubernetes Guides
Crosswalk Playbooks and Code for Teams to Manage Kubernetes in Production
Stars: ✭ 51 (-96.08%)
Mutual labels:  aws, azure, gcp
Gbt
Highly configurable prompt builder for Bash, ZSH and PowerShell written in Go.
Stars: ✭ 457 (-64.85%)
Mutual labels:  aws, azure, gcp
Terraform Security Scan
Run a security scan on your terraform with the very nice https://github.com/liamg/tfsec
Stars: ✭ 64 (-95.08%)
Mutual labels:  aws, azure, compliance
Ethereum Etl
Python scripts for ETL (extract, transform and load) jobs for Ethereum blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions. Data is available in Google BigQuery https://goo.gl/oY5BCQ
Stars: ✭ 956 (-26.46%)
Mutual labels:  aws, gcp, sql
Cloudguardiaas
Check Point CloudGuard Network Security repository containing solution templates, Terraform templates, tools and scripts for deploying and configuring CloudGuard Network Security products.
Stars: ✭ 27 (-97.92%)
Mutual labels:  aws, azure, gcp
Pulumi Kubernetesx
Kubernetes for Everyone
Stars: ✭ 74 (-94.31%)
Mutual labels:  aws, azure, gcp
Terracognita
Reads from existing Cloud Providers (reverse Terraform) and generates your infrastructure as code on Terraform configuration
Stars: ✭ 452 (-65.23%)
Mutual labels:  aws, azure, gcp
Grant
OAuth Proxy
Stars: ✭ 3,509 (+169.92%)
Mutual labels:  aws, azure, gcp
Opshell
DevOps Toolkit for Every Cloud on Every Cloud
Stars: ✭ 19 (-98.54%)
Mutual labels:  aws, azure, gcp
Devops Exercises
Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions
Stars: ✭ 20,905 (+1508.08%)
Mutual labels:  aws, azure, sql
Arvados
An open source platform for managing and analyzing biomedical big data
Stars: ✭ 274 (-78.92%)
Mutual labels:  aws, azure, gcp
Terraform Kubestack
Terraform GitOps Framework — Everything you need to build reliable automation for AKS, EKS and GKE Kubernetes clusters in one free and open-source framework.
Stars: ✭ 300 (-76.92%)
Mutual labels:  aws, azure, gcp
Offensive Terraform.github.io
Offensive Terraform Website
Stars: ✭ 25 (-98.08%)
Mutual labels:  aws, azure, gcp

cloudquery logo

cloudquery transforms your cloud infrastructure into queryable SQL or Graphs for easy monitoring, governance and security.

What is cloudquery and why use it?

cloudquery pulls, normalize, expose and monitor your cloud infrastructure and SaaS apps as SQL or Graph(Neo4j) database. This abstracts various scattered APIs enabling you to define security,governance,cost and compliance policies with SQL or Cypher(Neo4j).

cloudquery can be easily extended to more resources and SaaS providers (open an Issue).

cloudquery comes with built-in policy packs such as: AWS CIS (more is coming!).

Think about cloudquery as a compliance-as-code tool inspired by tools like osquery and terraform, cool right?

Links

Supported providers (Actively expanding)

Checkout https://hub.cloudquery.io

If you want us to add a new provider or resource please open an Issue.

Download & install

You can download the precompiled binary from releases, or using CLI:

export OS=Darwin # Possible values: Linux,Windows,Darwin
curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_${OS}_x86_64 -o cloudquery
chmod a+x cloudquery
./cloudquery --help

# if you want to download a specific version and not latest use the following endpoint
export VERSION= # specifiy a version
curl -L https://github.com/cloudquery/cloudquery/releases/download/${VERSION}/cloudquery_${OS}_x86_64 -o cloudquery

Homebrew

brew install cloudquery/tap/cloudquery
# After initial install you can upgrade the version via:
brew upgrade cloudquery

Quick Start

Running

First generate a config.yml file that will describe which resources you want cloudquery to pull, normalize and transform resources to the specified SQL database by running the following command:

cloudquery gen config aws # choose one or more from: [aws azure gcp okta]
# cloudquery gen config gcp okta # This will generate a config containing gcp and okta providers
# cloudquery gen config --help # Show all possible auto generated configs and flags

Once your config.yml is generated run the following command to fetch the resources:

cloudquery init
# you can spawn a local postgresql with docker
# docker run -p 5432:5432 -e POSTGRES_PASSWORD=pass -d postgres 
cloudquery fetch --dsn "host=localhost user=postgres password=pass DB.name=postgres port=5432"
# you can choose a database backend via --driver postgresql/neo4j --dsn <connection_string>
# cloudquery fetch --help # Show all possible fetch flags

Using psql -h localhost -p 5432 -U postgres -d postgres

postgres=# \dt
                                    List of relations
 Schema |                            Name                             | Type  |  Owner   
--------+-------------------------------------------------------------+-------+----------
 public | aws_autoscaling_launch_configuration_block_device_mapping   | table | postgres
 public | aws_autoscaling_launch_configurations                       | table | postgres

Run the following example queries from psql shell

List ec2_images

SELECT * FROM aws_ec2_images;

Find all public facing AWS load balancers

SELECT * FROM aws_elbv2_load_balancers WHERE scheme = 'internet-facing';

Running policy packs

cloudquery comes with some ready compliance policy pack which you can use as is or modify to fit your use-case.

Currently, cloudquery support AWS CIS policy pack (it is under active development, so it doesn't cover the whole spec yet).

To run AWS CIS pack enter the following commands (make sure you fetched all the resources beforehand by the fetch command):

cloudquery gen policy aws_cis
cloudquery query --dsn "host=localhost user=postgres password=pass DB.name=postgres port=5432"

You can also create your own policy file. E.g.:

views:
  - name: "my_custom_view"
    query: >
        CREATE VIEW my_custom_view AS ...
queries:
  - name: "Find thing that violates policy"
    query: >
        SELECT account_id, arn FROM ...

The query command uses the policy file path ./policy.yml by default, but this can be overridden via the --path flag, or the CQ_POLICY_PATH environment variable.

Full Documentation, resources and SQL schema definitions are available here

Providers Authentication

AWS

You should be authenticated with an AWS account with correct permission with either option (see full documentation):

  • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
  • ~/.aws/credentials created via aws configure
  • AWS_PROFILE

Multi-account AWS support is available by using an account which can AssumeRole to other accounts.

In your config.yml you need to specify role_arns if you want to query multiple accounts in the following way:

 accounts:
     - role_arn: <arn>

Azure

You should set the following environment variables: AZURE_CLIENT_ID,AZURE_CLIENT_SECRET, AZURE_TENANT_ID which you can generate via az ad sp create-for-rbac --sdk-auth. See full details at environment based authentication for sdk

GCP

You should be authenticated with a GCP that has correct permissions for the data you want to pull. You should set GOOGLE_APPLICATION_CREDENTIALS to point to your downloaded credential file.

Okta

You need to set OKTA_TOKEN environment variable

Query Examples

Find GCP buckets with public facing read permissions:
SELECT gcp_storage_buckets.name
FROM gcp_storage_buckets
         JOIN gcp_storage_bucket_policy_bindings ON gcp_storage_bucket_policy_bindings.bucket_id = gcp_storage_buckets.id
         JOIN gcp_storage_bucket_policy_binding_members ON gcp_storage_bucket_policy_binding_members.bucket_policy_binding_id = gcp_storage_bucket_policy_bindings.id
WHERE gcp_storage_bucket_policy_binding_members.name = 'allUsers' AND gcp_storage_bucket_policy_bindings.role = 'roles/storage.objectViewer';
Find all public facing AWS load balancers
SELECT * FROM aws_elbv2_load_balancers WHERE scheme = 'internet-facing';
Find all unencrypted RDS instances
SELECT * from aws_rds_clusters where storage_encrypted = 0;
Find all unencrypted AWS buckets
SELECT * from aws_s3_buckets
    JOIN aws_s3_bucket_encryption_rules ON aws_s3_buckets.id != aws_s3_bucket_encryption_rules.bucket_id;

More examples are available here

License

By contributing to cloudquery you agree that your contributions will be licensed as defined on the LICENSE file.

Compile and run

go build .
./cloudquery # --help to see all options

Contribution

Feel free to open Pull-Request for small fixes and changes. For bigger changes and new providers please open an issue first to prevent double work and discuss relevant stuff.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].