Skip to content

The CLoud Asset Repositry and Inventory Tool for You (CLARITY) is a tool to extend Google Cloud Platform's Cloud Asset Inventory (CAI) for better usability and functionality.

License

Notifications You must be signed in to change notification settings

Nuro-ai/CLARITY

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLARITY

The CLoud Asset Repository and Inventory Tool for You (CLARITY) is a tool to extend Google Cloud Platform's Cloud Asset Inventory (CAI) for better usability and functionality. It consists of two components:

  • BigQuery Data Views - a set of helpful views that make it easier to retrieve useful information from the 250+ tables created by the CAI data export process.
  • CLARITY GUI - a web interface for querying and pivoting among common data types.
  • View to Snapshot - an optional script to create static BigQuery tables for each BigQuery view definition to improve query speed and costs by precalulating the data on a regular basis.

Getting Started

Enable GCP Cloud Asset Inventory BigQuery Export

Follow this guide to export asset metadata for your GCP environment to BigQuery table. You may want to start with a single snapshot to get started and then move to a regularly scheduled snapshot using a Google Cloud Function, such as what is described in this Medium.com guide.

Import the CLARITY Views

These 37 views make it easier to access common data types from your CAI BigQuery tables and are needed for the CLARITY web interface to function.

Run the latest version of clarity_view_importer.py from this repository, specifying the GCP project and BigQuery dataset for your existing CAI data. By default, the views will be created within your CAI dataset but this can be overridden with the -P and -D options at runtime.

# Create views in the cai_project project and cai_dataset dataset
./clarity_view_importer.py -p cai_project -d cai_dataset

Adding cai_project.cai_dataset.view_nodepool
Adding cai_project.cai_dataset.view_k8s_rbac_authorization_cluster_role
Adding cai_project.cai_dataset.view_bucket
Adding cai_project.cai_dataset.view_k8s_deployments
...

(Optional) Create Daily Schedule to Create Snapshots from Views for Better Performance

Follow this guide

Install the CLARITY Web Interface

  • Set up a PHP 8 web server with the CLARITY source code running in the webroot.
  • Use Composer to install cloud-bigquery library 1.23 or newer.
  • Define the 'bigquery_project' and 'bigquery_dataset' constant variables in config.php to match the values for where your Cloud Asset Inventory BigQuery export is stored.
  • Browse to web server URL to access CLARITY UI.

Contributors

  • Kesten Broughton
  • Randy Heins
  • Jeffrey Zhang

License

The software is provided by Nuro under the Apache Software License agreement.

About

The CLoud Asset Repositry and Inventory Tool for You (CLARITY) is a tool to extend Google Cloud Platform's Cloud Asset Inventory (CAI) for better usability and functionality.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published