{# Step 2 - billing project. Spec 150: optional choice made before the audit target so a fresh-install admin's first scan can't accidentally bill the analysed project. Submitting forwards to step 3 (/setup/target) carrying the value as a query param; submitting blank also forwards (analysed project pays = legacy). #} {% extends "setup/layout.html" %} {% from "components/_project_combobox.html" import project_combobox, project_combobox_script %} {% block content %}

Step 2 ยท Choose a billing project

Optional - pick a GCP project to bill governor-audit's BigQuery INFORMATION_SCHEMA scans to. Leave blank and the analysed project pays for its own metadata queries (the default). Most operators auditing production projects set this to a separate tooling project they own, so the scan cost never lands on the audited project's bill.

{% if errors and errors.get('_general') %}
{{ errors['_general'] }}
{% endif %} {% if discovery_error %}
{{ discovery_error }}
{% endif %}
{{ project_combobox("billing_project_id", gcp_projects, value=(form_data.billing_project_id if form_data and form_data.billing_project_id else ""), pattern="^[a-z][-a-z0-9]{4,28}[a-z0-9]$", placeholder="leave blank to bill the analysed project") }}

When set to a different project than the one you'll choose on the next step, the BigQuery scan job runs in (and is billed to) this project - while still reading the analysed project's job history. The calling ADC identity needs bigquery.jobs.create on this project and bigquery.resourceViewer (or equivalent JOBS_BY_PROJECT read) on the analysed project.

{% if errors and errors.get('billing_project_id') %}

{{ errors['billing_project_id'] }}

{% endif %}
Back
{{ project_combobox_script() }} {% endblock %}