Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-8816

Documentation RFE: restricting end user application access by source IP

XMLWordPrintable

    • Moderate
    • None
    • Unspecified
    • If docs needed, set a value

      An ARO customer asked how to restrict end user application access by source IP. It's actually quite fiddly to do and I don't believe our 4.x documentation covers it nearly well enough, especially given that this is surely not an uncommon use case. This is the answer I sent back to the customer; it is somewhat Azure specific; it would be great if this could be used as a basis to significantly improve our documentation in this space.

      ==== 8< ====

      My general recommendation here is: either use Routes/Ingress objects combined with the haproxy.router.openshift.io/ip_whitelist annotation, or use a Service object of type LoadBalancer with spec.externalTrafficPolicy set to Local, alongside a NetworkPolicy object. The rationale for this advice is that although spec.loadBalancerSourceRanges also works on a Service, overall the Azure quota of NetworkSecurityGroup (NSG) rules is low and can fairly easily be exhausted.

      OpenShift Routes and Ingress
      ============================

      Kubernetes LoadBalancer Services (spec.externalTrafficPolicy: Cluster)
      ======================================================================

      • application cannot see last hop source address information.
      • NetworkPolicy / ipBlock cannot be used to restrict accesses (don't know if this is a bug or not, but it's definitely a gotcha).
      • whitelisting can be applied using loadBalancerSourceRanges (this configures the NSG), but note that there is only one NSG per cluster and the maximum number of rules per NSG on Azure is low.

      Kubernetes LoadBalancer Services (spec.externalTrafficPolicy: Local)
      ====================================================================

      • application sees last hop source address information transparently.
      • whitelisting can be applied using NetworkPolicy / ipBlock.
      • whitelisting can also be applied using loadBalancerSourceRanges (this configures the NSG), but note that there is only one NSG per cluster and the maximum number of rules per NSG on Azure is low.

              jboxman@redhat.com Jason Boxman
              jminter@redhat.com Jim Minter (Inactive)
              Zhanqi Zhao Zhanqi Zhao
              Red Hat Employee
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: