Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
doc: Fix policies README (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
yevgenypats authored Jul 25, 2022
1 parent e386de7 commit 5ec09df
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions policies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ CloudQuery SQL Policies for Kubernetes
You can execute policies with `psql`. For example:

```bash
# Execute the whole CISA Policy
psql -U postgres -f ./nsa_cisa_v1/policy.sql
# Set DSN to your PostgreSQL populated by CloudQuery
export DSN=postgres://postgres:pass@localhost:5432/postgres
# Execute the NSA CISA Policy
psql ${DSN} -f ./nsa_cisa_v1/policy.sql
```

This will create all the results in `k8s_policy_results` table which you can query directly, connect to any BI system (Grafana, Preset, AWS QuickSight, PowerBI, ...).

You can also output it into CSV or HTML with the following built-in psql commands:

```
# Set DSN to your PostgreSQL populated by CloudQuery
export DSN=postgres://postgres:pass@localhost:5432/postgres
# default tabular output
psql -U postgres -c "select * from k8s_policy_results"
psql ${DSN} -c "select * from k8s_policy_results"
# CSV output
psql -U postgres -c "select * from k8s_policy_results" --csv
psql ${DSN} -c "select * from k8s_policy_results" --csv
# HTML output
psql -U postgres -c "select * from k8s_policy_results" --html
psql ${DSN} -c "select * from k8s_policy_results" --html
```

0 comments on commit 5ec09df

Please sign in to comment.