[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-26 (世界標準時間)。"],[[["\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)"]]