feat(grafanactl): add PublicNetworkAccess support for Grafana instances - #279
feat(grafanactl): add PublicNetworkAccess support for Grafana instances#279cssjr wants to merge 1 commit into
Conversation
Add the ability to control the PublicNetworkAccess property on Azure Managed Grafana instances. This enables restricting Grafana to MSFT Corp VPN by setting PublicNetworkAccess to Disabled. The default is Disabled (secure-by-default), matching the Azure SDK enum values of Enabled/Disabled. Environments that need public access (e.g. dev) can explicitly override to Enabled via config. Jira: ARO-28693 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds an explicit PublicNetworkAccess option to grafanactl manage reconcile (defaulting to Disabled) and wires it through to Azure Managed Grafana resource properties, while also exposing the same field in the pipelines schema/types so pipeline YAML can pass the value via config.
Changes:
- Added
PublicNetworkAccesstografanactl manage reconcileoptions, flag binding, and validation, with a secure default ofDisabled. - Plumbed
PublicNetworkAccessinto the ARMManagedGrafanaPropertiespayload and dry-run logging. - Extended pipelines schema (
pipeline.schema.v1.json) andGrafanaManageSteptype to includepublicNetworkAccess.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/grafanactl/cmd/manage/options.go | Adds PublicNetworkAccess option with default, flag binding, and validation. |
| tools/grafanactl/cmd/manage/options_test.go | Adds unit tests for defaulting and validation of PublicNetworkAccess. |
| tools/grafanactl/cmd/manage/cmd.go | Sends PublicNetworkAccess into the ARM properties for create/update and logs it in dry-run output. |
| pipelines/types/pipeline.schema.v1.json | Extends the GrafanaManage step schema with publicNetworkAccess. |
| pipelines/types/common.go | Adds PublicNetworkAccess to GrafanaManageStep and includes it in RequiredInputs() dependency discovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| BaseOptions: base.DefaultBaseOptions(), | ||
| SKU: "Standard", | ||
| ZoneRedundancy: "Disabled", | ||
| PublicNetworkAccess: "Disabled", |
There was a problem hiding this comment.
Defaulting to "Disabled" provides a secure-by-default design but risks locking down all environments if this change isn't paired with the new ARO-HCP changes in a timely manner.
Defaulting to "Enabled" ensures backwards-compatibility if these were merged early but breaks the secure-by-default pattern.
My vote is for secure by default as I think the risk is low; however, I'm open to feedback.
Summary
PublicNetworkAccessfield tografanactl manage reconcilecommand, enabling control of whether Azure Managed Grafana instances are accessible from the public internetDisabled(secure-by-default) — environments that need public access (e.g. dev) explicitly override toEnabledvia configGrafanaManagesteps in pipeline YAML can pass this value viaconfigRefFollows the existing
ZoneRedundancypattern exactly.Jira
Disabledprevents accidental exposure)Parent story: ARO-28693 — Restrict Grafana to MSFT Corp VPN and add safeguards
Test plan
DefaultReconcileOptions()validates default isDisabledValidate()acceptsEnabled/Disabled, rejects invalid valuesgo build ./...passes fortools/grafanactlandpipelinesmodulesgo test ./...passes forpipelinesmodule (schema/type tests)make materializesuccessfully🤖 Generated with Claude Code