On September 15, 2026, all Cloud Composer 1 versions and versions 2.0.x of Cloud Composer 2 will reach their planned end of life. You will not be able to use environments with these versions. We recommend planning migration to Cloud Composer 3. Cloud Composer 2 versions 2.1.x and later are still supported and are not impacted by this change.
Securing your Cloud Composer environment is crucial for protecting
sensitive data and preventing unauthorized access. This page outlines key best
practices, including recommendations for network security, Identity and Access Management,
encryption, and environment configuration management.
To get more information about security features available in
Cloud Composer, see Security overview.
Manage environment configuration and DAGs using version control
Figure 1. An example of an Airflow CI/CD pipeline (click to enlarge)
Create your environment using Terraform.
In this way, you can store environment's configuration as code in a
repository. In this way, changes to your environment configuration can be
reviewed before they are applied, and you can reduce the number of users
who have permissions to change the configuration by assigning roles with
less permissions.
In Identity and Access Management, disable direct access to DAGs and environment's
configuration to regular users, as detailed in the
Identity and Access Management section.
Deploy DAGs in your environment with a CI/CD pipeline,
so that DAG code is retrieved from a repository. In this way, DAGs are
reviewed and approved before the changes are merged to the version control
system. During the review process, approvers make sure that DAGs meet the
security criteria established within their teams. The review step is
critical to prevent deployment of DAGs that might perform unwanted actions.
Some important security aspects to take into account when reviewing DAGs
are:
DAGs that modify the content of the environment's bucket must not modify
the code of other DAGs or access sensitive data, unless intended.
DAGs must not make direct queries to the Airflow database, unless
intended. A DAG in a Cloud Composer environment has
access to all tables in the Airflow database. It is possible to retrieve
information from any table, process it, and then store it outside of the
Airflow database.
Network security
Use Private IP environments so that Airflow components in
that run your environment's cluster are not assigned public IP addresses
and communicate only over Google's internal network.
Configure connectivity to Google APIs and services
through the private.googleapis.com domain so that your environment
accesses Google APIs and services through IP addresses only routable from
within Google Cloud.
Review the general firewall rules in your project and in the VPC network
where your environment is located. Depending on the way you configure them,
Airflow components of your environment, such as Airflow workers that run
your DAGs, might access the internet.
Identity and Access Management
Isolate permissions.
Create environment service accounts
and use different service accounts for different environments. Assign to
these service accounts only permissions that are strictly necessary to
operate these environments and perform operations defined in Airflow DAGs
that they run.
Avoid using service accounts with broad permissions. While it
is possible to create an environment that uses an account with broad
permissions, such as those granted by the Editor basic role, this
creates a risk of DAGs using broader permissions than intended.
Don't rely on default service accounts of Google services used by
Cloud Composer. It is often impossible to reduce permissions
available to these service accounts without also affecting other Google
services in your project.
Adhere to the principle of least privilege. Grant only the minimum necessary
permissions to users. For example,
assign IAM roles, so that only
administrators can access the environment's bucket
and the environment's cluster
,
and direct access is disabled for regular users. For example, the
Composer User role enables access only to DAG UI and Airflow UI.
Enforce Airflow UI Access Control, which allows to reduce
visibility in Airflow UI and DAG UI based on user's Airflow role, and can be
used to assign DAG-level permissions for individual DAGs.
Review regularly. Regularly audit IAM permissions and roles
to identify and remove any excessive or unused privileges.
Beware of passing and storing sensitive data:
Exercise caution when passing storing sensitive data like personally
identifiable information or passwords. Where required,
use Secret Manager to
securely store Airflow connections and Airflow secrets, API keys,
passwords, and certificates. Don't store this information in your DAGs
or environment variables.
Grant IAM permissions to the environment's bucket only
to trusted users. Use per-object permissions, if possible.
Security considerations for environment's service accounts
list several ways in which users with access to the environment's
bucket can perform actions on behalf of the environment's service
account.
Make sure that you are familiar with
what data is stored in the snapshots and provide
permissions to create environment snapshots and access the bucket where
they are stored only to trusted users.
All Cloud Composer's external interfaces use encryption by
default. When connecting to external products and services, make sure
that you use encrypted communication (SSL/TLS).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eSecuring a Cloud Composer environment involves implementing best practices for network security, Identity and Access Management (IAM), encryption, and environment configuration management.\u003c/p\u003e\n"],["\u003cp\u003eManaging environment configurations and DAGs using version control and CI/CD pipelines is crucial for ensuring code review and preventing unauthorized changes to the environment.\u003c/p\u003e\n"],["\u003cp\u003eUtilizing Private IP environments, implementing strict firewall rules, and configuring connectivity to Google APIs through the \u003ccode\u003eprivate.googleapis.com\u003c/code\u003e domain are vital for network security.\u003c/p\u003e\n"],["\u003cp\u003eIsolating permissions through dedicated service accounts and adhering to the principle of least privilege are key aspects of effective Identity and Access Management.\u003c/p\u003e\n"],["\u003cp\u003eSensitive data should be managed securely using Secret Manager, avoiding storage in DAGs or environment variables, and limiting access to environment buckets and snapshots to trusted users.\u003c/p\u003e\n"]]],[],null,["# Security best practices\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n[Cloud Composer 3](/composer/docs/composer-3/security-practices \"View this page for Cloud Composer 3\") \\| [Cloud Composer 2](/composer/docs/composer-3/security-practices \"View this page for Cloud Composer 2\") \\| **Cloud Composer 1**\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nSecuring your Cloud Composer environment is crucial for protecting\nsensitive data and preventing unauthorized access. This page outlines key best\npractices, including recommendations for network security, Identity and Access Management,\nencryption, and environment configuration management.\n\nTo get more information about security features available in\nCloud Composer, see [Security overview](/composer/docs/composer-1/composer-security-overview).\n\nManage environment configuration and DAGs using version control\n---------------------------------------------------------------\n\n[](/static/composer/docs/images/composer-airflow-secure-cicd.svg) **Figure 1.** An example of an Airflow CI/CD pipeline (click to enlarge)\n\n- [Create your environment using Terraform](/composer/docs/composer-1/terraform-create-environments).\n In this way, you can store environment's configuration as code in a\n repository. In this way, changes to your environment configuration can be\n reviewed before they are applied, and you can reduce the number of users\n who have permissions to change the configuration by assigning roles with\n less permissions.\n\n- In Identity and Access Management, disable direct access to DAGs and environment's\n configuration to regular users, as detailed in the\n [Identity and Access Management](#iam-security) section.\n\n- [Deploy DAGs in your environment with a CI/CD pipeline](/composer/docs/composer-1/dag-cicd-github),\n so that DAG code is retrieved from a repository. In this way, DAGs are\n reviewed and approved before the changes are merged to the version control\n system. During the review process, approvers make sure that DAGs meet the\n security criteria established within their teams. The review step is\n critical to prevent deployment of DAGs that might perform unwanted actions.\n\n Some important security aspects to take into account when reviewing DAGs\n are:\n - DAGs that modify the content of the environment's bucket must not modify\n the code of other DAGs or access sensitive data, unless intended.\n\n - DAGs must not make direct queries to the Airflow database, unless\n intended. A DAG in a Cloud Composer environment has\n access to all tables in the Airflow database. It is possible to retrieve\n information from any table, process it, and then store it outside of the\n Airflow database.\n\nNetwork security\n----------------\n\n\u003cbr /\u003e\n\n- Use [Private IP environments](/composer/docs/composer-1/configure-private-ip) so that Airflow components in\n that run your environment's cluster are not assigned public IP addresses\n and communicate only over Google's internal network.\n\n- [Implement strict firewall rules](/composer/docs/composer-1/configure-private-ip#private-ip-firewall-rules) to control\n traffic to and from your environment's cluster.\n\n- [Configure connectivity to Google APIs and services](/composer/docs/composer-1/configure-private-ip#connectivity-domains)\n through the `private.googleapis.com` domain so that your environment\n accesses Google APIs and services through IP addresses only routable from\n within Google Cloud.\n\n- Review the general firewall rules in your project and in the VPC network\n where your environment is located. Depending on the way you configure them,\n Airflow components of your environment, such as Airflow workers that run\n your DAGs, might access the internet.\n\nIdentity and Access Management\n------------------------------\n\n- Isolate permissions.\n [Create environment service accounts](/composer/docs/composer-1/access-control#service-account)\n and use different service accounts for different environments. Assign to\n these service accounts only permissions that are strictly necessary to\n operate these environments and perform operations defined in Airflow DAGs\n that they run.\n\n- Avoid using service accounts with broad permissions. While it\n is possible to create an environment that uses an account with broad\n permissions, such as those granted by the **Editor** basic role, this\n creates a risk of DAGs using broader permissions than intended.\n\n- Don't rely on default service accounts of Google services used by\n Cloud Composer. It is often impossible to reduce permissions\n available to these service accounts without also affecting other Google\n services in your project.\n\n- Make sure that you are familiar with\n [security considerations for environment's service accounts](/composer/docs/composer-1/access-control#service-account-security)\n and understand how this account interacts with permissions and roles that\n you grant to individual users in your project.\n\n- Adhere to the principle of least privilege. Grant only the minimum necessary\n permissions to users. For example,\n [assign IAM roles](/composer/docs/composer-1/access-control#user-account), so that only\n administrators can access the environment's bucket\n\n and the environment's cluster\n ,\n and direct access is disabled for regular users. For example, the\n **Composer User** role enables access only to DAG UI and Airflow UI.\n\n- Enforce [Airflow UI Access Control](/composer/docs/composer-1/airflow-rbac), which allows to reduce\n visibility in Airflow UI and DAG UI based on user's Airflow role, and can be\n used to assign DAG-level permissions for individual DAGs.\n\n- Review regularly. Regularly audit IAM permissions and roles\n to identify and remove any excessive or unused privileges.\n\n- Beware of passing and storing sensitive data:\n\n - Exercise caution when passing storing sensitive data like personally\n identifiable information or passwords. Where required,\n [use Secret Manager](/composer/docs/composer-1/configure-secret-manager) to\n securely store Airflow connections and Airflow secrets, API keys,\n passwords, and certificates. Don't store this information in your DAGs\n or environment variables.\n\n - Grant IAM permissions to the environment's bucket only\n to trusted users. Use per-object permissions, if possible.\n [Security considerations for environment's service accounts](/composer/docs/composer-1/access-control#service-account-security)\n list several ways in which users with access to the environment's\n bucket can perform actions on behalf of the environment's service\n account.\n\n - Make sure that you are familiar with\n [what data is stored in the snapshots](/composer/docs/composer-1/save-load-snapshots) and provide\n permissions to create environment snapshots and access the bucket where\n they are stored only to trusted users.\n\n - All Cloud Composer's external interfaces use encryption by\n default. When connecting to external products and services, make sure\n that you use encrypted communication (SSL/TLS).\n\nWhat's next\n-----------\n\n- [Security overview](/composer/docs/composer-1/composer-security-overview)\n- [Access control with IAM](/composer/docs/composer-1/access-control)\n- [Airflow UI Access Control](/composer/docs/composer-1/airflow-rbac)\n- [Airflow summit presentation about DAG security](https://www.youtube.com/watch?v=QhnItssm4yU)"]]