Skip to content

Commit

Permalink
audit: add support for monitoring service
Browse files Browse the repository at this point in the history
  • Loading branch information
spiffxp committed May 27, 2021
1 parent 64f3564 commit 608cb26
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion audit/audit-gcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,19 @@ function audit_gcp_project_service() {
> "${service_dir}/sinks.json"
;;
monitoring)
echo "TODO: ${service} needs serviceusage.services.use"
# TODO: does this actually need serviceusage.services.use?
local dashboards_dir="${service_dir}/dashboards"
ensure_clean_dir "${dashboards_dir}"
gcloud monitoring dashboards list \
--project="${project}" \
--format=json | format_gcloud_json \
| jq -r 'map("\(.displayName) \(.)")[]' \
| while read -r name json; do \
echo "dashboard: ${name}"
echo "${json}" \
> "${dashboards_dir}/${name}.json"
done
# TODO: ensure gcloud beta and gcloud alpha are available
#### gcloud alpha monitoring policies list > "projects/${project}/services/monitoring.policies.json"
#### gcloud alpha monitoring channels list > "projects/${project}/services/monitoring.channels.json"
#### gcloud alpha monitoring channel-descriptors list > "projects/${project}/services/monitoring.channel-descriptors.json"
Expand Down

0 comments on commit 608cb26

Please sign in to comment.