Skip to main content

SQL interface to your cloud resources

Project description

clquery: SQL interface to your cloud resources

One-liner

clquery allows you to perform live queries on your cloud resources, and use the power of SQL to combine and filter across multiple types of services and resources.

Install

$ virtualenv venv && source venv/bin/activate
$ pip install clquery
$ clquery
clquery> .tables

Example queries

See all AWS elastic IPs in us-west-2 region and their associated EC2 instances:

SELECT public_ip, instance_id
FROM aws_elastic_ip
WHERE region='us-west-2';

See all non-default VPCs and their CIDRs in all regions:

SELECT region, vpc_id, cidr
FROM aws_vpc
WHERE is_default is FALSE;

Find EC2 instances in us-west-2 region that have a Security Group rule that is open to the world:

SELECT
  vm.instance_id,
  sgr.ip_range,
  sgr.ip_protocol,
  sgr.from_port,
  sgr.to_port
FROM aws_ec2_instance as vm
JOIN aws_ec2_instance_security_group isg USING(instance_id)
JOIN aws_ec2_security_group_rule sgr USING(security_group_id)
WHERE vm.region='us-west-2'
  AND sgr.direction='ingress'
  AND sgr.ip_range='0.0.0.0/0';

Other trivia

  • The SQL engine is powered by SQLite and APSW through Virtual Tables
  • The shell is also (almost) a SQLite shell, and dot commands will work (e.g. .tables)

Inspiration and reality

The goal is to support mainstream services on major cloud providers. However, it currently only supports AWS for a few services.

This project is inspired by osquery.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clquery-0.1.0.tar.gz (17.4 kB view details)

Uploaded Source

File details

Details for the file clquery-0.1.0.tar.gz.

File metadata

  • Download URL: clquery-0.1.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for clquery-0.1.0.tar.gz
Algorithm Hash digest
SHA256 187cf99930147ce5dc9220688fdf7b932f006c10d2e27082c96d23ee88cc6dda
MD5 ae2bd45ea2456b9fc5743a3d9262c6cc
BLAKE2b-256 5d2cbd95dd7a74f58e630d8bbece148522d503ec6cffee92b847fca2936f5fa9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page