Configure VPC Service Controls

Managed Airflow (Gen 3) |  Managed Airflow (Gen 2)  |  Managed Airflow (Legacy Gen 1)

VPC Service Controls enable organizations to define a perimeter around Google Cloud resources to mitigate data exfiltration risks.

Managed Airflow environments can be deployed within a service perimeter. By configuring your environment with VPC Service Controls, you can keep sensitive data private while taking advantage of the fully-managed workflow orchestration capabilities of Managed Airflow.

VPC Service Controls support for Managed Airflow means that:

  • Managed Airflow can now be selected as a secured service inside a VPC Service Controls perimeter.
  • All underlying resources used by Managed Airflow are configured to support VPC Service Controls architecture and follow its rules.

Deploying Managed Airflow environments with VPC Service Controls gives you:

  • Reduced risk of data exfiltration.
  • Protection against data exposure due to misconfigured access controls.
  • Reduced risk of malicious users copying data to unauthorized Google Cloud resources, or external attackers accessing Google Cloud resources from the internet.

About VPC Service Controls in Managed Airflow

About connectivity to Google APIs and services in VPC Service Controls

Managed Airflow (Gen 3) routes traffic to Google services through restricted.googleapis.com , which enables access to Google APIs, services, and domains supported by this range.

For more information and the list of services and domains available through restricted.googleapis.com , see Network configuration in the Virtual Private Cloud documentation.

Managed Airflow (Gen 3) environments block callsto Google APIs, services, and domains that aren't in the list of required APIs and services . If you want to call an API from a DAG:

  1. Make sure that the service supports VPC Service Controls .
  2. Add the service to restricted services.
  3. Add the service to VPC accessible services.

For example, if you use a VertexAI Operator, add aiplatform.googleapis.com both to restricted services and to VPC accessible services.

For more information about adding services to a perimeter, see Manage service perimeters in the VPC Service Controls documentation.

In Managed Airflow (Gen 3), services that don't support VPC Service Controls and aren't available through restricted.googleapis.com can't be accessedfrom environments protected with VPC Service Controls. This restriction was added in Managed Airflow (Gen 3) to enhance environment's security. While Managed Airflow (Gen 2) allows configuring access to such unsupported services, we strongly recommend to avoid doing so in any environment protected by VPC Service Controls.

Create environments in a perimeter

The following steps are required to deploy Managed Airflow inside a perimeter:

  1. Enable Access Context Manager APIand Managed Airflow APIfor your project. See Enabling APIs for reference.

  2. Create a perimeter by following the perimeter configuration instructions in the VPC Service Controls documentation. Make sure that the list of restricted services includes all services used by Managed Airflow, in addition to other services that you want to restrict:

    • Cloud Composer API API (composer.googleapis.com)
    • Artifact Registry API (artifactregistry.googleapis.com)
    • Compute Engine API (compute.googleapis.com)
    • Kubernetes Engine API (container.googleapis.com)
    • Container File System API (containerfilesystem.googleapis.com)
    • Cloud DNS API (dns.googleapis.com)
    • Service Account Credentials API (iamcredentials.googleapis.com)
    • Cloud Logging API (logging.googleapis.com)
    • Cloud Monitoring API (monitoring.googleapis.com)
    • Cloud Pub/Sub API (pubsub.googleapis.com)
    • Cloud SQL Admin API (sqladmin.googleapis.com)
    • Cloud Storage API (storage.googleapis.com)

    • For all other services used by your DAGs:

      1. Add the service to restricted services.
      2. Add the service to VPC accessible services.
  3. Create a new Managed Airflow environment:

    1. Use Google Cloud CLI to create your environment.
    2. Enable Private IP with the --enable-private-environment argument.
    3. Specify access parameters for the web server with --web-server-allow-all , --web-server-allow-ip , or --web-server-deny-all arguments. For more information about using these arguments, see Create environments . To improve protection, only allow access to the web server from specific IP ranges.
    4. Disallow the installation of packages from public internet repositories with the --enable-private-builds-only argument.

      Example:

       gcloud  
      composer  
      environments  
      create  
      example-environment  
       \ 
        
      --location  
      us-central1  
       \ 
        
      --enable-private-environment  
       \ 
        
      --web-server-allow-all  
       \ 
        
      --enable-private-builds-only 
      
  4. By default, access to Airflow UI and API is only allowed from within the security perimeter. If you want to make it available outside of the security perimeter, then configure access levels or ingress and egress rules .

Add an existing environment to the perimeter

You can add the project containing your environment to a perimeter if your environments use Private IP and the installation of PyPI packages from public repositories is disabled.

To update an existing Managed Airflow (Gen 3) environment to this configuration:

  1. Make sure that you already created or configured the perimeter as described in the previous section .
  2. Use Google Cloud CLI to update your environment.
  3. Enable Private IP with the --enable-private-environment argument.
  4. Disallow the installation of packages from public internet repositories with the --enable-private-builds-only argument.
  5. If required, configure access to the Airflow web server . To improve protection, only allow access to the web server from specific IP ranges.

Example:

 gcloud  
composer  
environments  
update  
example-environment  
 \ 
  
--location  
us-central1  
 \ 
  
--enable-private-environment  
 \ 
  
--enable-private-builds-only 

Install PyPI packages in VPC Service Controls

In the default VPC Service Controls configuration, Managed Airflow only supports installing PyPI packages from private repositories that are reachable from the internal IP address space of the VPC network.

All Managed Airflow environments within a VPC Service Controls perimeter don't have access to public PyPI repositories by default.

Install from a private repository

The recommended configuration is to set up a private PyPI repository:

  1. Populate it with vetted packages used by your organization, then configure Managed Airflow to install Python dependencies from a private repository .

Install from a public repository

To install PyPI packages from an external repository:

  1. Create an Artifact Registry remote repository .
  2. Grant this repository access to upstream sources .
  3. Configure Airflow to install packages from an Artifact Registry repository .

VPC Service Controls logs

When troubleshooting environment creation issues, you can analyze audit logs generated by VPC Service Controls.

In addition to other log messages, you can check logs for information about cloud-airflow-prod@system.gserviceaccount.com and service- PROJECT_ID @cloudcomposer-accounts.iam.gserviceaccount.com service accounts that configure components of your environments.

Managed Airflow service uses the cloud-airflow-prod@system.gserviceaccount.com service account to manage tenant project components of your environments.

The service- PROJECT_ID @cloudcomposer-accounts.iam.gserviceaccount.com service account, also known as Composer Service Agent Service Account manages environment components in service and host projects .

What's next

Design a Mobile Site
View Site in Mobile | Classic
Share by: