← Back to Pull requests

ROSAENG-67407: add Route53 managed-DNS permissions to CPO managed policy #2890

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 09, 2026 09:07 UTC
Author

AWS Managed Policy Change: Managed DNS (HCP Control Plane Operator)

1. Overview

Brief Description: Add the Route53 permissions the HCP Control Plane Operator (CPO) needs for managed DNS, where the CPO creates and reconciles the cluster's Route53 hosted zones (the private .hypershift.local zone and the public and private ingress zones) instead of requiring them to be pre-created externally.

| Field | Value |
|---|---|
| Enhancement | managed-ingress-dns-for-aws-hosted-control-planes |
| Related JIRA | ROSAENG-67407 |
| Feature Documentation | Implementation CNTRLPLANE-4302; code in hypershift support/awsutil/route53.go and the PrivateLink / HCP reconcilers |

Policy Changes: Modifies the CPO managed policy (ROSAControlPlaneOperatorPolicy) in the commercial partition only:

  • resources/sts/hypershift/openshift_hcp_control_plane_operator_credentials_policy.json (commercial)
  • The FedRAMP/GovCloud policy (resources/sts/4.14/fedramp-hypershift/) is intentionally not modified here; AWS requests the equivalent GovCloud permissions internally. This MCC change is the source of truth for what is submitted to AWS to publish a new version of the managed policy; the inline dev/test copy in HyperShift (cmd/infra/aws/iam.go) is kept in sync by the feature implementation.

    Background: these permissions already exist in the installer role

    Managed DNS covers three hosted zones:

    1. the private .hypershift.local zone, used for internal VPC endpoint connectivity;
    2. the public ingress zone, used for customer-facing DNS records and certificate validation;
    3. the private ingress zone, used for VPC-internal DNS resolution.

    Today, in ROSA HCP v1, these zones are pre-created by Clusters Service that leverages the installer role. Therefore, the Route53 actions in this change already live in the cluster installer role (sts_hcp_installer_permission_policy.json). Managed DNS moves zone and record lifecycle to the CPO - which will be leveraged for ROSA HyperFleet (and possibly ROSA HCP v1 in the future).

    2. Policy Analysis

    Policy Chains Table

    | Chain Name | Sid Flow | Purpose |
    |---|---|---|
    | Managed DNS Zone Management | ReadPermissions (route53:ListHostedZones) then ManageHostedZones (CreateHostedZone) then TagHostedZones (ChangeTagsForResource) then ListResourceRecordSets + ChangeResourceRecordSetsRestrictedRecordNames (ChangeResourceRecordSets) | Look up zones by name, create the .hypershift.local and ingress hosted zones, tag them with the cluster ResourceTags, and write the ACME _acme-challenge DNS01 delegation CNAME in the public ingress zone. The .apps wildcard records are written separately by the in-cluster ingress operator via the CPO's dns.config override, not by this policy. |
    | Managed DNS Teardown | ReadPermissions (ListHostedZones) then ManageHostedZones (GetHostedZone) then ListResourceRecordSets then ChangeResourceRecordSetsRestrictedRecordNames (ChangeResourceRecordSets) then ManageHostedZones (DeleteHostedZone) | On cluster delete, look up the zone, delete its records, and delete the zone. |

    Permission Justification Matrix

    | Permission | Justification (why needed) | Permission interaction | Conditions applied | Unconditioned rationale |
    |---|---|---|---|---|
    | route53:CreateHostedZone (new) | Create the private .hypershift.local zone and the public and private ingress zones in the customer account. | Produces the zones that are then tagged and populated. | None (Resource: "
    "). | AWS supports no resource-level permissions and no tag-on-create condition keys for CreateHostedZone, so it must be "". Same scope the installer role already grants. |
    | route53:GetHostedZone (new) | Zone verification and NS record retrieval for delegation. | Reads zones created by CreateHostedZone; gates DeleteHostedZone. | Resource: "
    " (the action is inherently hosted-zone only). | Zone IDs are created at runtime and cannot be enumerated in a static managed policy. The action only acts on hosted zones, so "" grants nothing beyond them. Same scope the installer role already grants. |
    | route53:DeleteHostedZone (new) | Zone cleanup on cluster deletion, and recovery when a zone is deleted out of band. | Terminal step of the teardown chain. | Resource: "
    " (the action is inherently hosted-zone only). | Runtime zone IDs, as above. A tag-based condition is not viable because zones are tagged after creation, so a ResourceTag precondition would break the create then get then tag sequence. Same scope the installer role already grants. |
    | route53:ChangeTagsForResource (new) | Tag created zones with the cluster ResourceTags. | Runs immediately after CreateHostedZone. | Resource: arn:aws:route53:::hostedzone/ (resource-type scoped). | Cannot require aws:ResourceTag because this call is what sets the tag. Scoped to the hostedzone resource type so it cannot tag other taggable Route53 resources such as health checks. |
    | route53:ChangeResourceRecordSets (existing, condition extended) | Write the ACME _acme-challenge DNS01 delegation CNAME in the public ingress zone, and clean up records before zone deletion. (The
    .apps wildcards are written by the in-cluster ingress operator, not by this policy.) | Operates within zones created or returned by the chain above. | ForAllValues:StringLike on route53:ChangeResourceRecordSetsNormalizedRecordNames restricted to .hypershift.local, .openshiftapps.com, .devshift.org, .openshiftusgov.com, .devshiftusgov.com. | Conditioned. .hypershift.local is the pre-existing scope. The ACME record lives under the cluster's managed base domain, so the condition is extended with the same managed-domain suffixes already allowed by the ingress operator and shared-VPC Route53 managed policies. |

    Least-privilege summary: The only unconditioned new grants are CreateHostedZone (AWS API limitation, no conditions or resource types available) and Get / DeleteHostedZone (runtime zone IDs, tag conditions infeasible because zones are tagged after creation). Record mutation is constrained to Red Hat managed-domain suffixes, and tagging is scoped to the hosted-zone resource type. Every added action already existed in sts_hcp_installer_permission_policy.json with equal-or-broader scope, so this change relocates DNS management from the installer to the CPO rather than expanding the account's trust surface.

    3. Testing Evidence

    Cross-Version Compatibility Testing

    HCP managed policies under resources/sts/hypershift/ are un-versioned and apply to all HCP y-streams at once. The managed DNS feature lands in 5.1 and was tested on 5.0 and 5.1.

    | OCP Version | Test Status | Notes |
    |---|---|---|
    | 5.0 | Pass | Managed DNS exercised end to end (zone create/tag, ACME CNAME, teardown). |
    | 5.1 | Pass | Target y-stream for the feature. |

    A "y-stream without perms to y-stream with perms" upgrade test is not applicable: the managed policy applies to all y-streams at once, and the feature is opt-in and only enabled on a cluster after the permissions are in place.

    FedRAMP/GovCloud: The FedRAMP policy is not changed in this PR; AWS requests the equivalent GovCloud permissions internally.

    Test Procedure

    With the policy applied to the CPO role, we created and then deleted an HCP cluster with the managed DNS feature toggled on, and confirmed the feature ran end to end: the .hypershift.local and ingress hosted zones were created and tagged, the ACME _acme-challenge CNAME was written, and all zones and records were cleaned up on cluster deletion.

    References

  • Jira: ROSAENG-67407

  • Feature: OCPSTRAT-3616

  • Implementation: CNTRLPLANE-4302

  • Enhancement: managed-ingress-dns-for-aws-hosted-control-planes

  • HyperShift implementation (inline dev/test policy in cmd/infra/aws/iam.go): https://github.com/openshift/hypershift/pull/9348
  • 🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: joshbranham Review duration: 10007m
    All Vouch review confidence checks passed
    Residual risk 0.40 = Change Risk (0.75) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #2890"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 40.1% · Moderate risk
    40.1%