

# Security in Amazon AppFlow
Security

Amazon AppFlow provides a secure platform that enables you to move data bi-directionally between AWS services and software as a service (SaaS) applications, with availability in multiple Regions and built-in redundancy.

Cloud security at AWS is the highest priority. As an AWS customer, you benefit from a data center and network architecture that is built to meet the requirements of the most security-sensitive organizations.

Security is a shared responsibility between AWS and you. The [shared responsibility model](https://aws.amazon.com/compliance/shared-responsibility-model/) describes this as security of the cloud and security in the cloud:
+ **Security of the cloud** – AWS is responsible for protecting the infrastructure that runs AWS services in the AWS Cloud. AWS also provides you with services that you can use securely. Third-party auditors regularly test and verify the effectiveness of our security as part of the [AWS Compliance Programs](https://aws.amazon.com/compliance/programs/).To learn about the compliance programs that apply to Amazon AppFlow, see [AWS Services in Scope by Compliance Program](https://aws.amazon.com/compliance/services-in-scope/).
+ **Security in the cloud** – Your responsibility is determined by the AWS service that you use. You are also responsible for other factors including the sensitivity of your data, your company’s requirements, and applicable laws and regulations 

This documentation helps you understand how to apply the shared responsibility model when using Amazon AppFlow. It shows you how to configure Amazon AppFlow to meet your security and compliance objectives. You also learn how to use other AWS services that help you to monitor and secure your Amazon AppFlow resources.

**Topics**
+ [

# Data protection in Amazon AppFlow
](data-protection.md)
+ [

# Identity and access management for Amazon AppFlow
](security-iam.md)
+ [

# Compliance validation for Amazon AppFlow
](compliance-validation.md)
+ [

# Resilience in Amazon AppFlow
](disaster-recovery-resiliency.md)
+ [

# Infrastructure security in Amazon AppFlow
](infrastructure-security.md)

# Data protection in Amazon AppFlow
Data protection

The AWS [shared responsibility model](https://aws.amazon.com/compliance/shared-responsibility-model/) applies to data protection in Amazon AppFlow. As described in this model, AWS is responsible for protecting the global infrastructure that runs all of the AWS Cloud. You are responsible for maintaining control over your content that is hosted on this infrastructure. You are also responsible for the security configuration and management tasks for the AWS services that you use. For more information about data privacy, see the [Data Privacy FAQ](https://aws.amazon.com/compliance/data-privacy-faq/). For information about data protection in Europe, see the [AWS Shared Responsibility Model and GDPR](https://aws.amazon.com/blogs/security/the-aws-shared-responsibility-model-and-gdpr/) blog post on the *AWS Security Blog*.

For data protection purposes, we recommend that you protect AWS account credentials and set up individual users with AWS IAM Identity Center or AWS Identity and Access Management (IAM). That way, each user is given only the permissions necessary to fulfill their job duties. We also recommend that you secure your data in the following ways:
+ Use multi-factor authentication (MFA) with each account.
+ Use SSL/TLS to communicate with AWS resources. We require TLS 1.2 and recommend TLS 1.3.
+ Set up API and user activity logging with AWS CloudTrail. For information about using CloudTrail trails to capture AWS activities, see [Working with CloudTrail trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-trails.html) in the *AWS CloudTrail User Guide*.
+ Use AWS encryption solutions, along with all default security controls within AWS services.
+ Use advanced managed security services such as Amazon Macie, which assists in discovering and securing sensitive data that is stored in Amazon S3.
+ If you require FIPS 140-3 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint. For more information about the available FIPS endpoints, see [Federal Information Processing Standard (FIPS) 140-3](https://aws.amazon.com/compliance/fips/).

We strongly recommend that you never put confidential or sensitive information, such as your customers' email addresses, into tags or free-form text fields such as a **Name** field. This includes when you work with Amazon AppFlow or other AWS services using the console, API, AWS CLI, or AWS SDKs. Any data that you enter into tags or free-form text fields used for names may be used for billing or diagnostic logs. If you provide a URL to an external server, we strongly recommend that you do not include credentials information in the URL to validate your request to that server.



## Encryption at Rest


When you configure an SaaS application as a source or destination, you create a connection. This includes information required for connecting to the SaaS applications, such as authentication tokens, user names, and passwords. Amazon AppFlow securely stores your connection data, encrypting it using [AWS Key Management Service (AWS KMS)](https://docs.aws.amazon.com/kms) customer master keys (CMK) and then storing it in [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager).

When you delete a connection, all its metadata is permanently deleted.

When you use Amazon S3 as a destination, you can choose either an AWS managed CMK or a customer managed CMK for encrypting the data in the S3 bucket using [Amazon S3 SSE-KMS](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html).

## Encryption in Transit


When you configure a flow, you can choose either an AWS managed CMK or a customer managed CMK. When executing a flow, Amazon AppFlow stores data temporarily in an intermediate S3 bucket and encrypts it using this key. This intermediate bucket is deleted after 7 days, using a bucket lifecycle policy.

Amazon AppFlow secures all data in transit using Transport Layer Security (TLS) 1.2.

With some of the SaaS applications that are a supported source or destination, you can create a connection that does not send traffic over the public internet. For more information, see [Private Amazon AppFlow flows](private-flows.md).

## Key Management


Amazon AppFlow provides both AWS managed and customer managed CMKs for encrypting connection data and data stored in Amazon S3 when it is a destination. We recommend that you use a customer managed CMK, as it puts you in full control over your encrypted data. When you choose a customer managed CMK, Amazon AppFlow attaches a resource policy to the CMK that grants it access to the CMK.

## Connection credentials


Amazon AppFlow stores the encrypted credentials that are used to connect to flow source and destination applications in your AWS Secrets Manager account. These credentials include OAuth tokens, Application and API keys, and passwords. To create a new connection, grant the following permissions to any custom IAM policies.

**Note**  
The [https://docs.aws.amazon.com/appflow/latest/userguide/identity-access-management.html#policy-examples](https://docs.aws.amazon.com/appflow/latest/userguide/identity-access-management.html#policy-examples) policy includes these permissions.

```
{ 
          "Sid": "SecretsManagerCreateSecretAccess", 
          "Effect": "Allow", 
          "Action": "secretsmanager:CreateSecret", 
          "Resource": "*", 
          "Condition": { 
               "StringLike": { "secretsmanager:Name": "appflow!*" 
            }, 
            "ForAnyValue:StringEquals": { 
                  "aws:CalledVia": [ 
                         "appflow.amazonaws.com" 
                    ] 
               } 
          } 
}, 
{ 
          "Sid": "SecretsManagerPutResourcePolicyAccess", 
          "Effect": "Allow", 
          "Action": [
               "secretsmanager:PutResourcePolicy" 
          ], 
          "Resource": "*", 
          "Condition": { 
               "ForAnyValue:StringEquals": { 
                    "aws:CalledVia": [ 
                         "appflow.amazonaws.com" 
                    ] 
          }, 
          "StringEqualsIgnoreCase": { 
               "secretsmanager:ResourceTag/aws:secretsmanager:owningService": "appflow" 
          }
     }
}
```

# Identity and access management for Amazon AppFlow
Identity and access management





AWS Identity and Access Management (IAM) is an AWS service that helps an administrator securely control access to AWS resources. IAM administrators control who can be *authenticated* (signed in) and *authorized* (have permissions) to use Amazon AppFlow resources. IAM is an AWS service that you can use with no additional charge.

**Topics**
+ [

## Audience
](#security_iam_audience)
+ [

## Authenticating with identities
](#security_iam_authentication)
+ [

## Managing access using policies
](#security_iam_access-manage)
+ [

# How Amazon AppFlow works with IAM
](security_iam_service-with-iam.md)
+ [

# Identity-based policy examples for Amazon AppFlow
](security_iam_id-based-policy-examples.md)
+ [

# Service role policies for Amazon AppFlow
](security_iam_service-role-policies.md)
+ [

# Amazon S3 Bucket Policies for Amazon AppFlow
](s3-policies-management.md)
+ [

# AWS managed policies for Amazon AppFlow
](security-iam-awsmanpol.md)
+ [

# Troubleshooting Amazon AppFlow identity and access
](security_iam_troubleshoot.md)

## Audience


How you use AWS Identity and Access Management (IAM) differs based on your role:
+ **Service user** - request permissions from your administrator if you cannot access features (see [Troubleshooting Amazon AppFlow identity and access](security_iam_troubleshoot.md))
+ **Service administrator** - determine user access and submit permission requests (see [How Amazon AppFlow works with IAM](security_iam_service-with-iam.md))
+ **IAM administrator** - write policies to manage access (see [Identity-based policy examples for Amazon AppFlow](security_iam_id-based-policy-examples.md))

## Authenticating with identities


Authentication is how you sign in to AWS using your identity credentials. You must be authenticated as the AWS account root user, an IAM user, or by assuming an IAM role.

You can sign in as a federated identity using credentials from an identity source like AWS IAM Identity Center (IAM Identity Center), single sign-on authentication, or Google/Facebook credentials. For more information about signing in, see [How to sign in to your AWS account](https://docs.aws.amazon.com/signin/latest/userguide/how-to-sign-in.html) in the *AWS Sign-In User Guide*.

For programmatic access, AWS provides an SDK and CLI to cryptographically sign requests. For more information, see [AWS Signature Version 4 for API requests](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) in the *IAM User Guide*.

### AWS account root user


 When you create an AWS account, you begin with one sign-in identity called the AWS account *root user* that has complete access to all AWS services and resources. We strongly recommend that you don't use the root user for everyday tasks. For tasks that require root user credentials, see [Tasks that require root user credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#root-user-tasks) in the *IAM User Guide*. 

### Federated identity


As a best practice, require human users to use federation with an identity provider to access AWS services using temporary credentials.

A *federated identity* is a user from your enterprise directory, web identity provider, or Directory Service that accesses AWS services using credentials from an identity source. Federated identities assume roles that provide temporary credentials.

For centralized access management, we recommend AWS IAM Identity Center. For more information, see [What is IAM Identity Center?](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) in the *AWS IAM Identity Center User Guide*.

### IAM users and groups


An *[IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)* is an identity with specific permissions for a single person or application. We recommend using temporary credentials instead of IAM users with long-term credentials. For more information, see [Require human users to use federation with an identity provider to access AWS using temporary credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-users-federation-idp) in the *IAM User Guide*.

An [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html) specifies a collection of IAM users and makes permissions easier to manage for large sets of users. For more information, see [Use cases for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/gs-identities-iam-users.html) in the *IAM User Guide*.

### IAM roles


An *[IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)* is an identity with specific permissions that provides temporary credentials. You can assume a role by [switching from a user to an IAM role (console)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html) or by calling an AWS CLI or AWS API operation. For more information, see [Methods to assume a role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage-assume.html) in the *IAM User Guide*.

IAM roles are useful for federated user access, temporary IAM user permissions, cross-account access, cross-service access, and applications running on Amazon EC2. For more information, see [Cross account resource access in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html) in the *IAM User Guide*.

## Managing access using policies


You control access in AWS by creating policies and attaching them to AWS identities or resources. A policy defines permissions when associated with an identity or resource. AWS evaluates these policies when a principal makes a request. Most policies are stored in AWS as JSON documents. For more information about JSON policy documents, see [Overview of JSON policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json) in the *IAM User Guide*.

Using policies, administrators specify who has access to what by defining which **principal** can perform **actions** on what **resources**, and under what **conditions**.

By default, users and roles have no permissions. An IAM administrator creates IAM policies and adds them to roles, which users can then assume. IAM policies define permissions regardless of the method used to perform the operation.

### Identity-based policies


Identity-based policies are JSON permissions policy documents that you attach to an identity (user, group, or role). These policies control what actions identities can perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see [Define custom IAM permissions with customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) in the *IAM User Guide*.

Identity-based policies can be *inline policies* (embedded directly into a single identity) or *managed policies* (standalone policies attached to multiple identities). To learn how to choose between managed and inline policies, see [Choose between managed policies and inline policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-choosing-managed-or-inline.html) in the *IAM User Guide*.

### Resource-based policies


Resource-based policies are JSON policy documents that you attach to a resource. Examples include IAM *role trust policies* and Amazon S3 *bucket policies*. In services that support resource-based policies, service administrators can use them to control access to a specific resource. You must [specify a principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) in a resource-based policy.

Resource-based policies are inline policies that are located in that service. You can't use AWS managed policies from IAM in a resource-based policy.

### Other policy types


AWS supports additional policy types that can set the maximum permissions granted by more common policy types:
+ **Permissions boundaries** – Set the maximum permissions that an identity-based policy can grant to an IAM entity. For more information, see [Permissions boundaries for IAM entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the *IAM User Guide*.
+ **Service control policies (SCPs)** – Specify the maximum permissions for an organization or organizational unit in AWS Organizations. For more information, see [Service control policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html) in the *AWS Organizations User Guide*.
+ **Resource control policies (RCPs)** – Set the maximum available permissions for resources in your accounts. For more information, see [Resource control policies (RCPs)](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html) in the *AWS Organizations User Guide*.
+ **Session policies** – Advanced policies passed as a parameter when creating a temporary session for a role or federated user. For more information, see [Session policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) in the *IAM User Guide*.

### Multiple policy types


When multiple types of policies apply to a request, the resulting permissions are more complicated to understand. To learn how AWS determines whether to allow a request when multiple policy types are involved, see [Policy evaluation logic](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html) in the *IAM User Guide*.

# How Amazon AppFlow works with IAM


Before you use IAM to manage access to Amazon AppFlow, learn what IAM features are available to use with Amazon AppFlow.






**IAM features you can use with Amazon AppFlow**  

| IAM feature | Amazon AppFlow support | 
| --- | --- | 
|  [Identity-based policies](#security_iam_service-with-iam-id-based-policies)  |   Yes  | 
|  [Resource-based policies](#security_iam_service-with-iam-resource-based-policies)  |   No   | 
|  [Policy actions](#security_iam_service-with-iam-id-based-policies-actions)  |   Yes  | 
|  [Policy resources](#security_iam_service-with-iam-id-based-policies-resources)  |   Yes  | 
|  [Policy condition keys](#security_iam_service-with-iam-id-based-policies-conditionkeys)  |   Partial  | 
|  [ACLs](#security_iam_service-with-iam-acls)  |   No   | 
|  [ABAC (tags in policies)](#security_iam_service-with-iam-tags)  |   Yes  | 
|  [Temporary credentials](#security_iam_service-with-iam-roles-tempcreds)  |   Yes  | 
|  [Principal permissions](#security_iam_service-with-iam-principal-permissions)  |   Yes  | 
|  [Service roles](#security_iam_service-with-iam-roles-service)  |   No   | 
|  [Service-linked roles](#security_iam_service-with-iam-roles-service-linked)  |   No   | 

To get a high-level view of how Amazon AppFlow and other AWS services work with most IAM features, see [AWS services that work with IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) in the *IAM User Guide*.

## Identity-based policies for Amazon AppFlow
Identity-based policies

**Supports identity-based policies:** Yes

Identity-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role. These policies control what actions users and roles can perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see [Define custom IAM permissions with customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) in the *IAM User Guide*.

With IAM identity-based policies, you can specify allowed or denied actions and resources as well as the conditions under which actions are allowed or denied. To learn about all of the elements that you can use in a JSON policy, see [IAM JSON policy elements reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html) in the *IAM User Guide*.

### Other required permissions in identity-based policies for Amazon AppFlow


Because Amazon AppFlow always encrypts data at rest and in motion, ensure that the user that is creating and running a flow has the following AWS KMS permissions in your identity-based policies.


| Required AWS KMS permission | Description | 
| --- | --- | 
|  kms:ListKeys   | Controls permission to view the key ID and Amazon Resource Name (ARN) of all customer master keys (CMKs) in the account. | 
| kms:DescribeKey | Controls permission to view detailed information about a CMK. | 
|  kms:ListAliases  | Controls permission to view the aliases that are defined in the account. Aliases are optional friendly names that you can associate with CMKs. | 
| kms:CreateGrant  | Controls permission to add a grant to a CMK. You can use grants to add permissions without changing the key policy or IAM policy. | 
|  kms:ListGrants  | Controls permission to view all grants for a CMK. | 

For more information about AWS Key Management Service (AWS KMS), see [What is AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) in the *AWS Key Management Service Developer Guide*.

For the complete list of AWS services that are integrated with AWS KMS, see [AWS Service Integration](https://aws.amazon.com/kms/features/#AWS_Service_Integration).

### Identity-based policy examples for Amazon AppFlow




To view examples of Amazon AppFlow identity-based policies, see [Identity-based policy examples for Amazon AppFlow](security_iam_id-based-policy-examples.md).

## Resource-based policies within Amazon AppFlow
Resource-based policies

**Supports resource-based policies:** No 

Resource-based policies are JSON policy documents that you attach to a resource. Examples of resource-based policies are IAM *role trust policies* and Amazon S3 *bucket policies*. In services that support resource-based policies, service administrators can use them to control access to a specific resource. For the resource where the policy is attached, the policy defines what actions a specified principal can perform on that resource and under what conditions. You must [specify a principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) in a resource-based policy. Principals can include accounts, users, roles, federated users, or AWS services.

To enable cross-account access, you can specify an entire account or IAM entities in another account as the principal in a resource-based policy. For more information, see [Cross account resource access in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html) in the *IAM User Guide*.

## Policy actions for Amazon AppFlow
Policy actions

**Supports policy actions:** Yes

Administrators can use AWS JSON policies to specify who has access to what. That is, which **principal** can perform **actions** on what **resources**, and under what **conditions**.

The `Action` element of a JSON policy describes the actions that you can use to allow or deny access in a policy. Include actions in a policy to grant permissions to perform the associated operation.



To see a list of Amazon AppFlow actions, see [Actions defined by Amazon AppFlow](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonappflow.html#amazonappflow-actions-as-permissions) in the *Service Authorization Reference*.

Policy actions in Amazon AppFlow use the following prefix before the action.

```
appflow
```

To specify multiple actions in a single statement, separate them with commas.

```
"Action": [
      "appflow:CreateConnectorProfile",
      "appflow:CreateFlow"
         ]
```



You can specify multiple actions using wildcards (\$1). For example, to specify all actions that begin with the word `Describe`, include the following action.

```
"Action": "appflow:Describe*"
```

To view examples of Amazon AppFlow identity-based policies, see [Identity-based policy examples for Amazon AppFlow](security_iam_id-based-policy-examples.md).

## Policy resources for Amazon AppFlow
Policy resources

**Supports policy resources:** Yes

Administrators can use AWS JSON policies to specify who has access to what. That is, which **principal** can perform **actions** on what **resources**, and under what **conditions**.

The `Resource` JSON policy element specifies the object or objects to which the action applies. As a best practice, specify a resource using its [Amazon Resource Name (ARN)](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html). For actions that don't support resource-level permissions, use a wildcard (\$1) to indicate that the statement applies to all resources.

```
"Resource": "*"
```

To see a list of Amazon AppFlow resource types and their ARNs, see [Resources defined by Amazon AppFlow](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonappflow.html#amazonappflow-resources-for-iam-policies) in the *Service Authorization Reference*. To learn with which actions you can specify the ARN of each resource, see [Actions defined by Amazon AppFlow](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonappflow.html#amazonappflow-actions-as-permissions).





An Amazon AppFlow connector profile has the following Amazon Resource Name (ARN) format.

```
arn:${Partition}:appflow:${Region}:${Account}:connectorprofile/${connector-profile-name}
```

An Amazon AppFlow flow has the following ARN format.

```
arn:${Partition}:appflow:${Region}:${Account}:flow/${flow-name}
```

For more information about the format of ARNs, see [Amazon Resource Names (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).

For example, to specify the `test-flow` flow in your statement, use the following ARN.

```
"Resource": "arn:aws:appflow:us-east-1:123456789012:flow/test-flow"
```

To specify all flows that belong to a specific account, use the wildcard (\$1).

```
"Resource": "arn:aws:appflow:us-east-1:123456789012:flow/*"
```

Some Amazon AppFlow actions, such as those for creating resources, cannot be performed on a specific resource. In those cases, you must use the wildcard (\$1).

```
"Resource": "*"
```

Many Amazon AppFlow API actions involve multiple resources. For example, `DescribeConnectorProfiles` returns a list of details for specified connector profiles that are accessible by the currently logged in AWS account. So an user must have permissions to view those connector profiles. To specify multiple resources in a single statement, separate the ARNs with commas.

```
"Resource": [
      "resource1",
      "resource2"
```

To see a list of Amazon AppFlow resource types and their ARNs, see [Resources defined by Amazon AppFlow](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonappflow.html#amazonappflow-resources-for-iam-policies) in the *IAM User Guide*. To learn about actions with which you can specify the ARN of each resource, see [Actions defined by Amazon AppFlow](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonappflow.html#amazonappflow-actions-as-permissions).

## Policy condition keys for Amazon AppFlow
Policy condition keys

**Supports service-specific policy condition keys:** Partial

Administrators can use AWS JSON policies to specify who has access to what. That is, which **principal** can perform **actions** on what **resources**, and under what **conditions**.

The `Condition` element (or `Condition` *block*) lets you specify conditions in which a statement is in effect. The `Condition` element is optional. You can create conditional expressions that use [condition operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html), such as equals or less than, to match the condition in the policy with values in the request.

If you specify multiple `Condition` elements in a statement, or multiple keys in a single `Condition` element, AWS evaluates them using a logical `AND` operation. If you specify multiple values for a single condition key, AWS evaluates the condition using a logical `OR` operation. All of the conditions must be met before the statement's permissions are granted.

 You can also use placeholder variables when you specify conditions. For example, you can grant a user permission to access a resource only if it is tagged with their user name. For more information, see [IAM policy elements: variables and tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html) in the *IAM User Guide*.

Amazon AppFlow does not provide any service-specific condition keys, but it does support using some [global condition keys](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonappflow.html#amazonappflow-policy-keys). To see all AWS global condition keys, see [AWS global condition context keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html) in the *IAM User Guide*.

## Access control lists (ACLs) in Amazon AppFlow
ACLs

**Supports ACLs:** No 

Access control lists (ACLs) control which principals (account members, users, or roles) have permissions to access a resource. ACLs are similar to resource-based policies, although they do not use the JSON policy document format.

## Attribute-based access control (ABAC) with Amazon AppFlow
ABAC

**Supports ABAC (tags in policies):** Yes

Attribute-based access control (ABAC) is an authorization strategy that defines permissions based on attributes called tags. You can attach tags to IAM entities and AWS resources, then design ABAC policies to allow operations when the principal's tag matches the tag on the resource.

To control access based on tags, you provide tag information in the [condition element](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) of a policy using the `aws:ResourceTag/key-name`, `aws:RequestTag/key-name`, or `aws:TagKeys` condition keys.

If a service supports all three condition keys for every resource type, then the value is **Yes** for the service. If a service supports all three condition keys for only some resource types, then the value is **Partial**.

For more information about ABAC, see [Define permissions with ABAC authorization](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_attribute-based-access-control.html) in the *IAM User Guide*. To view a tutorial with steps for setting up ABAC, see [Use attribute-based access control (ABAC)](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) in the *IAM User Guide*.

## Using temporary credentials with Amazon AppFlow
Temporary credentials

**Supports temporary credentials:** Yes

Temporary credentials provide short-term access to AWS resources and are automatically created when you use federation or switch roles. AWS recommends that you dynamically generate temporary credentials instead of using long-term access keys. For more information, see [Temporary security credentials in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) and [AWS services that work with IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) in the *IAM User Guide*.

## Cross-service principal permissions for Amazon AppFlow
Principal permissions

**Supports forward access sessions (FAS):** Yes

 Forward access sessions (FAS) use the permissions of the principal calling an AWS service, combined with the requesting AWS service to make requests to downstream services. For policy details when making FAS requests, see [Forward access sessions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_forward_access_sessions.html). 

## Service roles for Amazon AppFlow
Service roles

**Supports service roles:** No 

 A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see [Create a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*. 

## Service-linked roles for Amazon AppFlow
Service-linked roles

**Supports service-linked roles:** No 

 A service-linked role is a type of service role that is linked to an AWS service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your AWS account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles. 

# Identity-based policy examples for Amazon AppFlow
Identity-based policy examples

By default, users and roles don't have permission to create or modify Amazon AppFlow resources. To grant users permission to perform actions on the resources that they need, an IAM administrator can create IAM policies.

To learn how to create an IAM identity-based policy by using these example JSON policy documents, see [Create IAM policies (console)](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html) in the *IAM User Guide*.

For details about actions and resource types defined by Amazon AppFlow, including the format of the ARNs for each of the resource types, see [Actions, resources, and condition keys for Amazon AppFlow](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonappflow.html) in the *Service Authorization Reference*.

**Topics**
+ [

## Policy best practices
](#security_iam_service-with-iam-policy-best-practices)
+ [

## Example 1: Allow IAM users full administrator access to Amazon AppFlow
](#example-full-admin)
+ [

## Example 2: Allow IAM users read-only access to Amazon AppFlow
](#example-read-only)
+ [

## Example 3: Grant access to permission-only actions
](#permission-only-actions)
+ [

## Example 4: Allow users to view their own permissions
](#security_iam_id-based-policy-examples-view-own-permissions)
+ [

## Example 5: Allow Amazon AppFlow to access the AWS Glue Data Catalog
](#security_iam_id-based-policy-examples-access-gdc)

## Policy best practices


Identity-based policies determine whether someone can create, access, or delete Amazon AppFlow resources in your account. These actions can incur costs for your AWS account. When you create or edit identity-based policies, follow these guidelines and recommendations:
+ **Get started with AWS managed policies and move toward least-privilege permissions** – To get started granting permissions to your users and workloads, use the *AWS managed policies* that grant permissions for many common use cases. They are available in your AWS account. We recommend that you reduce permissions further by defining AWS customer managed policies that are specific to your use cases. For more information, see [AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#aws-managed-policies) or [AWS managed policies for job functions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html) in the *IAM User Guide*.
+ **Apply least-privilege permissions** – When you set permissions with IAM policies, grant only the permissions required to perform a task. You do this by defining the actions that can be taken on specific resources under specific conditions, also known as *least-privilege permissions*. For more information about using IAM to apply permissions, see [ Policies and permissions in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) in the *IAM User Guide*.
+ **Use conditions in IAM policies to further restrict access** – You can add a condition to your policies to limit access to actions and resources. For example, you can write a policy condition to specify that all requests must be sent using SSL. You can also use conditions to grant access to service actions if they are used through a specific AWS service, such as CloudFormation. For more information, see [ IAM JSON policy elements: Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) in the *IAM User Guide*.
+ **Use IAM Access Analyzer to validate your IAM policies to ensure secure and functional permissions** – IAM Access Analyzer validates new and existing policies so that the policies adhere to the IAM policy language (JSON) and IAM best practices. IAM Access Analyzer provides more than 100 policy checks and actionable recommendations to help you author secure and functional policies. For more information, see [Validate policies with IAM Access Analyzer](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-validation.html) in the *IAM User Guide*.
+ **Require multi-factor authentication (MFA)** – If you have a scenario that requires IAM users or a root user in your AWS account, turn on MFA for additional security. To require MFA when API operations are called, add MFA conditions to your policies. For more information, see [ Secure API access with MFA](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html) in the *IAM User Guide*.

For more information about best practices in IAM, see [Security best practices in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) in the *IAM User Guide*.

## Example 1: Allow IAM users full administrator access to Amazon AppFlow
Example 1: Allow full administrator access

This policy example provides full access to Amazon AppFlow, to all AWS services that are available as flow sources or destinations, and to AWS Key Management Service (AWS KMS).

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "appflow:*",
            "Resource": "*"
        },
        {
            "Sid": "ListRolesForRedshift",
            "Effect": "Allow",
            "Action": "iam:ListRoles",
            "Resource": "*"
        },
        {
            "Sid": "KMSListAccess",
            "Action": [
                "kms:ListKeys",
                "kms:DescribeKey",
                "kms:ListAliases"
            ],
            "Effect": "Allow",
            "Resource": "*"
        },
        {
            "Sid": "KMSGrantAccess",
            "Effect": "Allow",
            "Action": [
                "kms:CreateGrant"
            ],
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "kms:ViaService": "appflow.*.amazonaws.com"
                },
                "Bool": {
                    "kms:GrantIsForAWSResource": "true"
                }
            }
        },
        {
            "Sid": "KMSListGrantAccess",
            "Effect": "Allow",
            "Action": [
                "kms:ListGrants"
            ],
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "kms:ViaService": "appflow.*.amazonaws.com"
                }
            }
        },
        {
            "Sid": "S3ReadAccess",
            "Effect": "Allow",
            "Action": [
                "s3:ListAllMyBuckets",
                "s3:ListBucket",
                "s3:GetBucketLocation",
                "s3:GetBucketPolicy"
            ],
            "Resource": "*"
        },
        {
            "Sid": "S3PutBucketPolicyAccess",
            "Effect": "Allow",
            "Action": [
                "s3:PutBucketPolicy"
            ],
            "Resource": "arn:aws:s3:::appflow-*"
        },
        {
            "Sid": "SecretsManagerCreateSecretAccess",
            "Effect": "Allow",
            "Action": "secretsmanager:CreateSecret",
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "secretsmanager:Name": "appflow!*"
                },
                "ForAnyValue:StringEquals": {
                    "aws:CalledVia": [
                        "appflow.amazonaws.com"
                    ]
                }
            }
        },
        {
            "Sid": "SecretsManagerPutResourcePolicyAccess",
            "Effect": "Allow",
            "Action": [
                "secretsmanager:PutResourcePolicy"
            ],
            "Resource": "*",
            "Condition": {
                "ForAnyValue:StringEquals": {
                    "aws:CalledVia": [
                        "appflow.amazonaws.com"
                    ]
                },
                "StringEqualsIgnoreCase": {
                    "secretsmanager:ResourceTag/aws:secretsmanager:owningService": "appflow"
                }
            }
        }
    ]
}
```

------

## Example 2: Allow IAM users read-only access to Amazon AppFlow
Example 2: Allow read-only access

This policy example provides read-only access to Amazon AppFlow.

For definitions of each action, see [Actions defined by Amazon AppFlow](https://docs.aws.amazon.com/appflow/latest/userguide/identity-access-management.html#actions-table).

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
            "appflow:DescribeConnectors",
            "appflow:DescribeConnectorProfiles",
            "appflow:DescribeFlows",
            "appflow:DescribeFlowExecution",
            "appflow:DescribeConnectorFields",
            "appflow:ListConnectorFields",
            "appflow:ListTagsForResource"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## Example 3: Grant access to permission-only actions


If you use a custom policy to grant users permission to use Amazon AppFlow instead of the managed policies provided, you must include specific permissions for the user or role to perform specific actions. For example, if the user or role needs to add or update a flow, the policy attached to the user or role must include permission to use the `UseConnectorProfile` permission-only action so that the user has permission to use the connection specified for the flow. You can specify that the user is allowed to use all connector profiles, or only a specific connector profile. The following example policy statement demonstrates how to grant access only to a specific connector profile by specifying the ARN to the connector profile named *test-profile* in the account 123456789012. You can modify this policy statement and include it in a custom policy for your environment, but this statement grants permission only to use the connector profile. The user or role needs additional permissions to perform other Amazon AppFlow actions.

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowConnectionProfile",
            "Effect": "Allow",
            "Action": "appflow:UseConnectorProfile",
            "Resource": "arn:aws:appflow:us-east-1:123456789012:connectorprofile/test-profile"
        }
    ]
}
```

------

## Example 4: Allow users to view their own permissions


This example shows how you might create a policy that allows IAM users to view the inline and managed policies that are attached to their user identity. This policy includes permissions to complete this action on the console or programmatically using the AWS CLI or AWS API.

```
{
    "Version": "2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ViewOwnUserInfo",
            "Effect": "Allow",
            "Action": [
                "iam:GetUserPolicy",
                "iam:ListGroupsForUser",
                "iam:ListAttachedUserPolicies",
                "iam:ListUserPolicies",
                "iam:GetUser"
            ],
            "Resource": ["arn:aws:iam::*:user/${aws:username}"]
        },
        {
            "Sid": "NavigateInConsole",
            "Effect": "Allow",
            "Action": [
                "iam:GetGroupPolicy",
                "iam:GetPolicyVersion",
                "iam:GetPolicy",
                "iam:ListAttachedGroupPolicies",
                "iam:ListGroupPolicies",
                "iam:ListPolicyVersions",
                "iam:ListPolicies",
                "iam:ListUsers"
            ],
            "Resource": "*"
        }
    ]
}
```

## Example 5: Allow Amazon AppFlow to access the AWS Glue Data Catalog


Before you can create a flow that catalogs its output data in the AWS Glue Data Catalog, you must grant Amazon AppFlow the required permissions. Amazon AppFlow requires permissions to create Data Catalog tables, databases, and partitions. To grant those permissions, create an IAM role that contains the following permissions policy and trust policy. Provide this role to Amazon AppFlow in the settings for your flows.

**Example permissions policy**    
****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "glue:BatchCreatePartition",
                "glue:CreatePartitionIndex",
                "glue:DeleteDatabase",
                "glue:GetTableVersions",
                "glue:GetPartitions",
                "glue:BatchDeletePartition",
                "glue:DeleteTableVersion",
                "glue:UpdateTable",
                "glue:DeleteTable",
                "glue:DeletePartitionIndex",
                "glue:GetTableVersion",
                "glue:CreatePartition",
                "glue:UntagResource",
                "glue:UpdatePartition",
                "glue:TagResource",
                "glue:UpdateDatabase",
                "glue:CreateTable",
                "glue:BatchUpdatePartition",
                "glue:GetTables",
                "glue:BatchGetPartition",
                "glue:GetDatabases",
                "glue:GetPartitionIndexes",
                "glue:GetTable",
                "glue:GetDatabase",
                "glue:GetPartition",
                "glue:CreateDatabase",
                "glue:BatchDeleteTableVersion",
                "glue:BatchDeleteTable",
                "glue:DeletePartition"
            ],
            "Resource": "*"
        }
    ]
}
```

**Example trust policy**    
****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "appflow.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}
```

# Service role policies for Amazon AppFlow
Service role policies

 A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see [Create a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*. 

**Warning**  
Changing the permissions for a service role might break Amazon AppFlow functionality. Edit service roles only when Amazon AppFlow provides guidance to do so.

**Topics**
+ [

## Allow Amazon AppFlow to access the AWS Glue Data Catalog
](#access-gdc)
+ [

## Allow Amazon AppFlow to access Amazon Redshift databases with the Data API
](#access-redshift)
+ [

## Allow Amazon Redshift to access your Amazon AppFlow data in Amazon S3
](#redshift-access-s3)

## Allow Amazon AppFlow to access the AWS Glue Data Catalog


Before you can create a flow that catalogs its output data in the AWS Glue Data Catalog, you must grant Amazon AppFlow the required permissions. Amazon AppFlow requires permissions to create Data Catalog tables, databases, and partitions. To grant the required permissions, you provide an IAM role that contains the following permissions policy and trust policy. You provide this role to Amazon AppFlow in the settings for your flows.

**Example permissions policy**    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "VisualEditor0",
      "Effect": "Allow",
      "Action": [
        "glue:BatchCreatePartition",
        "glue:CreatePartitionIndex",
        "glue:DeleteDatabase",
        "glue:GetTableVersions",
        "glue:GetPartitions",
        "glue:BatchDeletePartition",
        "glue:DeleteTableVersion",
        "glue:UpdateTable",
        "glue:DeleteTable",
        "glue:DeletePartitionIndex",
        "glue:GetTableVersion",
        "glue:CreatePartition",
        "glue:UntagResource",
        "glue:UpdatePartition",
        "glue:TagResource",
        "glue:UpdateDatabase",
        "glue:CreateTable",
        "glue:BatchUpdatePartition",
        "glue:GetTables",
        "glue:BatchGetPartition",
        "glue:GetDatabases",
        "glue:GetPartitionIndexes",
        "glue:GetTable",
        "glue:GetDatabase",
        "glue:GetPartition",
        "glue:CreateDatabase",
        "glue:BatchDeleteTableVersion",
        "glue:BatchDeleteTable",
        "glue:DeletePartition"
      ],
      "Resource": "*"
    }
  ]
}
```

**Example trust policy**    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Principal":
      {
        "Service": "appflow.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

## Allow Amazon AppFlow to access Amazon Redshift databases with the Data API


Before you can create a flow that transfers data to an Amazon Redshift database by using the Amazon Redshift Data API, you must grant Amazon AppFlow the required permissions. Amazon AppFlow requires permissions to do the following with your Amazon Redshift database:
+ Gain access through temporary credentials
+ Run SQL statements

To grant those permissions, you create an IAM role that contains the permissions policy and trust policy below. You provide this role to Amazon AppFlow in the settings for your Amazon Redshift connections.

**Example permissions policy**    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "DataAPIPermissions",
      "Effect": "Allow",
      "Action": [
        "redshift-data:ExecuteStatement",
        "redshift-data:GetStatementResult",
        "redshift-data:DescribeStatement"
      ],
      "Resource": "*"
    },
    {
      "Sid": "GetCredentialsForAPIUser",
      "Effect": "Allow",
      "Action": "redshift:GetClusterCredentials",
      "Resource": [
        "arn:aws:redshift:*:*:dbname:*/*",
        "arn:aws:redshift:*:*:dbuser:*/*"
      ]
    },
    {
      "Sid": "GetCredentialsForServerless",
      "Effect": "Allow",
      "Action": "redshift-serverless:GetCredentials",
      "Resource": "*",
      "Condition":
      {
        "StringLike":
        {
          "aws:ResourceTag/RedshiftDataFullAccess": "*"
        }
      }
    },
    {
      "Sid": "DenyCreateAPIUser",
      "Effect": "Deny",
      "Action": "redshift:CreateClusterUser",
      "Resource": [
        "arn:aws:redshift:*:*:dbuser:*/*"
      ]
    },
    {
      "Sid": "ServiceLinkedRole",
      "Effect": "Allow",
      "Action": "iam:CreateServiceLinkedRole",
      "Resource": "arn:aws:iam::*:role/aws-service-role/redshift-data.amazonaws.com/AWSServiceRoleForRedshift",
      "Condition":
      {
        "StringLike":
        {
          "iam:AWSServiceName": "redshift-data.amazonaws.com"
        }
      }
    }
  ]
}
```
**Tag condition for Amazon Redshift Serverless resources**  
In the example permissions policy, the statement that grants the `redshift-serverless:GetCredentials` action has the following condition block:   

```
"Condition":
{
  "StringLike":
  {
    "aws:ResourceTag/RedshiftDataFullAccess": "*"
  }
}
```
In IAM policies, `condition` is an optional element that specifies conditions for when a policy is in effect. With this condition block, the policy allows Amazon AppFlow to get temporary credentials for only those Amazon Redshift Serverless resources that meet the condition. To meet the condition, the resources must be tagged with the key `RedshiftDataFullAccess`. Therefore, to use this policy, you must apply that tag to the appropriate workgroup.  
For more information about tagging resources in Amazon Redshift Serverless, see [Tagging resources overview](https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-tagging-resources.html) in the *Amazon Redshift Management Guide*.

**Example trust policy**    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Principal":
      {
        "Service": "appflow.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

For more information about authorizing access to the Data API, see [Authorizing access to the Amazon Redshift Data API](https://docs.aws.amazon.com/redshift/latest/mgmt/data-api-access.html) in the *Amazon Redshift Management Guide*.

## Allow Amazon Redshift to access your Amazon AppFlow data in Amazon S3


When you run a flow that transfers data to an Amazon Redshift database, Amazon AppFlow first stores the data in an S3 bucket that you provide. Then, Amazon Redshift gets the data from the S3 bucket. For the flow to run successfully, you must authorize Amazon Redshift to get and decrypt the data. To grant those permission, you create an IAM role that contains the permissions policies and trust policy below.

You provide the IAM role in the settings when you create an Amazon Redshift connection in Amazon AppFlow.

You must also associate the role with the Amazon Redshift cluster that receives the data that you transfer with Amazon AppFlow. For the steps to associate the role, see [Associating IAM roles with clusters](https://docs.aws.amazon.com/redshift/latest/mgmt/copy-unload-iam-role.html#copy-unload-iam-role-associating-with-clusters) in the *Amazon Redshift Management Guide*.

**Example permissions policies**  

To provide the required permissions to Amazon Redshift, you can attach the following permissions policies to the IAM role:
+ The AWS managed policy AmazonS3ReadOnlyAccess. This policy is owned and maintained by AWS. It grants read-only access to Amazon S3. To view the permissions for this policy, see [AmazonS3ReadOnlyAccess](https://console.aws.amazon.com/iam/home?#/policies/arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess$jsonEditor) in the AWS Management Console.
+ A policy that permits Amazon Redshift to decrypt the encrypted data that Amazon AppFlow stores in Amazon S3, such as the following example:

------
#### [ JSON ]

****  

  ```
  {
    "Version":"2012-10-17",		 	 	 
    "Statement": [
      {
        "Effect": "Allow",
        "Action": "kms:Decrypt",
        "Resource": "*"
      }
    ]
  }
  ```

------

**Example trust policy**    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Principal":
      {
        "Service": "redshift.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

# Amazon S3 Bucket Policies for Amazon AppFlow
Amazon S3 Bucket Policies for Amazon AppFlow

By default, all Amazon S3 buckets and objects are private. Only the resource owner, the AWS account that created the bucket, can access the bucket and any objects that it contains. However, the resource owner can choose to grant access permissions to other resources and users by writing an access policy.

If you want to create or modify an Amazon S3 bucket to be used as a source or destination in a flow, you must further modify the bucket policy. To read from or write to an Amazon S3 bucket, Amazon AppFlow must have the the following permissions. Amazon AppFlow automatically attaches the required permissions to a bucket when you select an Amazon S3 bucket as either the source or destination in a flow in the Amazon AppFlow console. If using the Amazon AppFlow SDK these policies must be added manually.

## Amazon AppFlow Required Amazon S3 Policies
Amazon AppFlow Required Amazon S3 Policies

Amazon AppFlow requires a permission policy with the following attributes: 
+ The statement SID
+ The bucket name
+ The service principal name for Amazon AppFlow.
+ The resources required for Amazon AppFlow: the bucket and all of its contents
+  The required actions that Amazon AppFlow needs to take, which varies depending on if the bucket is used as a source or destination 

The following policy allows Amazon AppFlow to access an Amazon S3 bucket used as the source in a flow. It contains all of the necessary actions Amazon AppFlow needs to read objects from the specified bucket. 

**Amazon S3 bucket policy**

```
{
    "Statement": [
        {
            "Effect": "Allow",
            "Sid": "AllowAppFlowSourceActions",
            "Principal": {
                "Service": "appflow.amazonaws.com"
            },
            "Action": [
                "s3:ListBucket",
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::myBucketName",
                "arn:aws:s3:::myBucketName/*"
            ]
        }
    ]
}
```

The following policy allows Amazon AppFlow to access an Amazon S3 bucket used as the destination in a flow. It contains all of the necessary actions Amazon AppFlow needs to put objects into an Amazon S3 bucket. 

```
{
    "Statement": [
        {
            "Effect": "Allow",
            "Sid": "AllowAppFlowDestinationActions",
            "Principal": {
                "Service": "appflow.amazonaws.com"
            },
            "Action": [
                "s3:PutObject",
                "s3:AbortMultipartUpload",
                "s3:ListMultipartUploadParts",
                "s3:ListBucketMultipartUploads",
                "s3:GetBucketAcl",
                "s3:PutObjectAcl"
            ],
            "Resource": [
                "arn:aws:s3:::myBucketName",
                "arn:aws:s3:::myBucketName/*"
            ]
        }
    ]
}
```

## Cross-service confused deputy prevention


The Confused Deputy problem is a security issue where an entity that doesn't have permission to perform an action can coerce a more-privileged entity to perform that action in AWS. Cross-service impersonation is one means of creating a confused deputy problem. Cross-service impersonation can occur when one service (the *calling service*) calls another service (the *called service*). The called service can be manipulated to use its permissions to act on another customer's resources in a way it should not otherwise have permission to do. To prevent this, AWS provides tools that help you protect your data for all services with service principals that have been given access to resources in your account.

We recommend using the [https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourcearn](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourcearn) and [https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceaccount](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceaccount) global condition context keys in resource policies to limit the permissions that Amazon AppFlow gives another service to the resource. If you use both global condition context keys, the `aws:SourceAccount` value and the account in the `aws:SourceArn` value must use the same account ID when used in the same policy statement.

The value of `aws:SourceArn` must be the resource that is accessing the Amazon S3 bucket. The most effective way to protect against the confused deputy problem is to use the `aws:SourceArn` global condition context key with the full ARN of the resource. For Amazon AppFlow, these will be the ARNs of the flows created with Amazon S3 as a source or destination. If you would like to specify multiple different flows, you may use a list of different ARNs for the `aws:SourceArn` context key. Additionally, you may use the `aws:SourceArn` global context condition key with wildcards (\$1). For example, `arn:aws:servicename::123456789012:*`. The following example shows how you can use the `aws:SourceArn` and `aws:SourceAccount` global condition context keys in Amazon S3 to prevent the confused deputy problem when Amazon S3 is the destination. (Note that, when Amazon AppFlow creates the policy for you during flow creation, it automatically populates the `aws:SourceAccount` condition key.)

```
{
    "Statement": [
        {
            "Effect": "Allow",
            "Sid": "AllowAppFlowDestinationActions",
            "Principal": {
                "Service": "appflow.amazonaws.com"
            },
            "Action": [
                "s3:PutObject",
                "s3:AbortMultipartUpload",
                "s3:ListMultipartUploadParts",
                "s3:ListBucketMultipartUploads",
                "s3:GetBucketAcl",
                "s3:PutObjectAcl"
            ],
            "Resource": [
                "arn:aws:s3:::myBucketName",
                "arn:aws:s3:::myBucketName/*"
            ],
            "Condition" : {
                "StringEquals" : {
                    "aws:SourceAccount" : "myAccountId"
                },
                "ArnLike" : {
                    "aws:SourceArn": ["arn:aws:appflow::myAccountId:flow/flow-name-1",
                                      "arn:aws:appflow::myAccountId:flow/flow-name-2"]
                }
            }
        }
    ]
}
```

## Cross-service confused deputy prevention for DescribeConnectorEntity


 As part of its DescribeConnectorEntity API, Amazon AppFlow will make calls to Amazon S3 in order to get information about specific objects in a customer’s Amazon S3 bucket. The DescribeConnectorEntity API is invoked either through the direct usage of the Amazon AppFlow SDK, or via the Amazon AppFlow console when using an Amazon S3 bucket as the source during flow creation. This API requires the following permissions: 
+ `S3:GetObject`
+ `S3:ListBucket`

 These calls are not associated with a particular resource. As such, when using `aws:SourceArn` in a bucket policy granting these permissions to Amazon AppFlow, one should use the global context condition key with wildcard if planning to use Amazon AppFlow's console or DescribeConnectorEntity API with the Amazon S3 bucket the policy is attached to.

# AWS managed policies for Amazon AppFlow
AWS managed policies



An AWS managed policy is a standalone policy that is created and administered by AWS. AWS managed policies are designed to provide permissions for many common use cases so that you can start assigning permissions to users, groups, and roles.

Keep in mind that AWS managed policies might not grant least-privilege permissions for your specific use cases because they're available for all AWS customers to use. We recommend that you reduce permissions further by defining [ customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#customer-managed-policies) that are specific to your use cases.

You cannot change the permissions defined in AWS managed policies. If AWS updates the permissions defined in an AWS managed policy, the update affects all principal identities (users, groups, and roles) that the policy is attached to. AWS is most likely to update an AWS managed policy when a new AWS service is launched or new API operations become available for existing services.

For more information, see [AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#aws-managed-policies) in the *IAM User Guide*.

## AWS managed policy: AmazonAppFlowFullAccess
AmazonAppFlowFullAccess

You can attach the `AmazonAppFlowFullAccess` policy to your IAM identities.

This policy grants administrative permissions that allow you to view, create, update, run, and delete flows, and also to list, create, and delete connections. In addition, this policy grants access to the API actions that are required to configure other AWS services as a source or destinations. This policy also provides access to AWS Key Management Service to allow use of customer managed CMKs for encryption. It does not grant the ability to add other users.

**Note**  
This policy automatically grants read and write permissions to S3 buckets with an `appflow-` prefix only. You will not have access rights to any other S3 buckets without this prefix.

**Permissions details**

This policy includes the following permissions.
+ `appflow` – Allows principals to have full access to Amazon AppFlow. This is required so that you can view, create, update, run, and delete flows, in addition to list, create, and delete connections.
+ `iam` – Allows principals to list IAM roles from Amazon Redshift. This is required so that you can use Amazon Redshift as a flow destination.
+ `s3` – Allows principals to access buckets, bucket locations, and bucket policies for Amazon Simple Storage Service (Amazon S3). This is required so that you can use Amazon S3 as a flow source or destination (or use it to support the use of another source or destination).
+ `kms` – Allows principals to view the key ID and Amazon Resource Name (ARN) of all the customer master keys (CMKs) in the account, view detailed information about a CMK, view the aliases that are defined in the account, and add a grant to a CMK. This is required so that you can use customer managed CMKs for encryption.
+ `secretsmanager` – Allows principals to create secrets in Secrets Manager. This is required so that Amazon AppFlow can store the encrypted credentials that you use to connect to flow source and destination applications in your Secrets Manager account.
+ `lambda` – Allows principals to list all the functions in customer account. This is required so that you can register new connectors



------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "appflow:*",
            "Resource": "*"
        },
        {
            "Sid": "ListRolesForRedshift",
            "Effect": "Allow",
            "Action": "iam:ListRoles",
            "Resource": "*"
        },
        {
            "Sid": "KMSListAccess",
            "Action": [
                "kms:ListKeys",
                "kms:DescribeKey",
                "kms:ListAliases"
            ],
            "Effect": "Allow",
            "Resource": "*"
        },
        {
            "Sid": "KMSGrantAccess",
            "Effect": "Allow",
            "Action": [
                "kms:CreateGrant"
            ],
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "kms:ViaService": "appflow.*.amazonaws.com"
                },
                "Bool": {
                    "kms:GrantIsForAWSResource": "true"
                }
            }
        },
        {
            "Sid": "KMSListGrantAccess",
            "Effect": "Allow",
            "Action": [
                "kms:ListGrants"
            ],
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "kms:ViaService": "appflow.*.amazonaws.com"
                }
            }
        },
        {
            "Sid": "S3ReadAccess",
            "Effect": "Allow",
            "Action": [
                "s3:ListAllMyBuckets",
                "s3:ListBucket",
                "s3:GetBucketLocation",
                "s3:GetBucketPolicy"
            ],
            "Resource": "*"
        },
        {
            "Sid": "S3PutBucketPolicyAccess",
            "Effect": "Allow",
            "Action": [
                "s3:PutBucketPolicy"
            ],
            "Resource": "arn:aws:s3:::appflow-*"
        },
        {
            "Sid": "SecretsManagerCreateSecretAccess",
            "Effect": "Allow",
            "Action": "secretsmanager:CreateSecret",
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "secretsmanager:Name": "appflow!*"
                },
                "ForAnyValue:StringEquals": {
                    "aws:CalledVia": [
                        "appflow.amazonaws.com"
                    ]
                }
            }
        },
        {
            "Sid": "SecretsManagerPutResourcePolicyAccess",
            "Effect": "Allow",
            "Action": [
                "secretsmanager:PutResourcePolicy"
            ],
            "Resource": "*",
            "Condition": {
                "ForAnyValue:StringEquals": {
                    "aws:CalledVia": [
                        "appflow.amazonaws.com"
                    ]
                },
                "StringEqualsIgnoreCase": {
                    "secretsmanager:ResourceTag/aws:secretsmanager:owningService": "appflow"
                }
            }
        },
        {
            "Sid": "LambdaListFunctions",
            "Effect": "Allow",
            "Action": [
                "lambda:ListFunctions"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## AWS managed policy: AmazonAppFlowReadOnlyAccess
AmazonAppFlowReadOnlyAccess

You can attach the `AmazonAppFlowReadOnlyAccess` policy to your IAM identities.

This policy grants read-only permissions that allow you to view flows and connections in an AWS account. This policy doesn't allow you to create or delete flows or connections, and it doesn't grant the ability to add other users or grant access to other AWS services.

**Permissions details**

This policy includes the following permissions.
+ `appflow` – Allows principals to describe and list resources from Amazon AppFlow. This is required so that Amazon AppFlow users can view connectors, connector profiles, flows, and their associated metadata. 

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement":
  [
    {
      "Effect": "Allow",
      "Action":
      [
        "appflow:DescribeConnector",
        "appflow:DescribeConnectors",
        "appflow:DescribeConnectorProfiles",
        "appflow:DescribeFlows",
        "appflow:DescribeFlowExecution",
        "appflow:DescribeConnectorFields",
        "appflow:ListConnectors",
        "appflow:ListConnectorFields",
        "appflow:ListTagsForResource"
      ],
      "Resource": "*"
    }
  ]
}
```

------



## Amazon AppFlow updates to AWS managed policies
Policy updates

View details about updates to AWS managed policies for Amazon AppFlow since this service began tracking these changes. For automatic alerts about changes to this page, subscribe to the RSS feed on the Amazon AppFlow [Document history](https://docs.aws.amazon.com/appflow/latest/userguide/doc-history.html) page.




| Change | Description | Date | 
| --- | --- | --- | 
|  [AmazonAppFlowFullAccess](#security-iam-awsmanpol-full) – Update to an existing policy  |  Amazon AppFlow now allows the `lambda:ListFunctions` action in the AmazonAppFlowFullAccess policy.  | 03/01/2022 | 
|  [AmazonAppFlowReadOnlyAccess](#security-iam-awsmanpol-readonly) – Update to an existing policy  |  Amazon AppFlow now allows the `appflow:DescribeConnector` and `appflow:ListConnectors` actions in the AmazonAppFlowReadOnlyAccess policy.  | 03/01/2022 | 
|  Amazon AppFlow started tracking changes  |  Amazon AppFlow started tracking changes for its AWS managed policies.  | 03/26/2021 | 

# Troubleshooting Amazon AppFlow identity and access
Troubleshooting

Use the following information to help you diagnose and fix common issues that you might encounter when working with Amazon AppFlow and IAM.

**Topics**
+ [

## I am not authorized to perform an action in Amazon AppFlow
](#security_iam_troubleshoot-no-permissions)
+ [

## I am not authorized to perform iam:PassRole
](#security_iam_troubleshoot-passrole)
+ [

## I'm an administrator and want to allow others to access Amazon AppFlow
](#security_iam_troubleshoot-admin-delegate)
+ [

## I want to allow people outside of my AWS account to access my Amazon AppFlow resources
](#security_iam_troubleshoot-cross-account-access)

## I am not authorized to perform an action in Amazon AppFlow


If you receive an error that you're not authorized to perform an action, your policies must be updated to allow you to perform the action.

The following example error occurs when the `mateojackson` IAM user tries to use the console to view details about a fictional `my-example-widget` resource but doesn't have the fictional `appflow:GetWidget` permissions.

```
User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: appflow:GetWidget on resource: my-example-widget
```

In this case, the policy for the `mateojackson` user must be updated to allow access to the `my-example-widget` resource by using the `appflow:GetWidget` action.

If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials.

## I am not authorized to perform iam:PassRole


If you receive an error that you're not authorized to perform the `iam:PassRole` action, your policies must be updated to allow you to pass a role to Amazon AppFlow.

Some AWS services allow you to pass an existing role to that service instead of creating a new service role or service-linked role. To do this, you must have permissions to pass the role to the service.

The following example error occurs when an IAM user named `marymajor` tries to use the console to perform an action in Amazon AppFlow. However, the action requires the service to have permissions that are granted by a service role. Mary does not have permissions to pass the role to the service.

```
User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole
```

In this case, Mary's policies must be updated to allow her to perform the `iam:PassRole` action.

If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials.

## I'm an administrator and want to allow others to access Amazon AppFlow


To allow others to access Amazon AppFlow, you must grant permission to the people or applications that need access. If you are using AWS IAM Identity Center to manage people and applications, you assign permission sets to users or groups to define their level of access. Permission sets automatically create and assign IAM policies to IAM roles that are associated with the person or application. For more information, see [Permission sets](https://docs.aws.amazon.com/singlesignon/latest/userguide/permissionsetsconcept.html) in the *AWS IAM Identity Center User Guide*.

If you are not using IAM Identity Center, you must create IAM entities (users or roles) for the people or applications that need access. You must then attach a policy to the entity that grants them the correct permissions in Amazon AppFlow. After the permissions are granted, provide the credentials to the user or application developer. They will use those credentials to access AWS. To learn more about creating IAM users, groups, policies, and permissions, see [IAM Identities](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html) and [Policies and permissions in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) in the *IAM User Guide*.

## I want to allow people outside of my AWS account to access my Amazon AppFlow resources


You can create a role that users in other accounts or people outside of your organization can use to access your resources. You can specify who is trusted to assume the role. For services that support resource-based policies or access control lists (ACLs), you can use those policies to grant people access to your resources.

To learn more, consult the following:
+ To learn whether Amazon AppFlow supports these features, see [How Amazon AppFlow works with IAM](security_iam_service-with-iam.md).
+ To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*.
+ To learn how to provide access to your resources to third-party AWS accounts, see [Providing access to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*.
+ To learn how to provide access through identity federation, see [Providing access to externally authenticated users (identity federation)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*.
+ To learn the difference between using roles and resource-based policies for cross-account access, see [Cross account resource access in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html) in the *IAM User Guide*.

# Compliance validation for Amazon AppFlow
Compliance validation

To learn whether an AWS service is within the scope of specific compliance programs, see [AWS services in Scope by Compliance Program](https://aws.amazon.com/compliance/services-in-scope/) and choose the compliance program that you are interested in. For general information, see [AWS Compliance Programs](https://aws.amazon.com/compliance/programs/).

You can download third-party audit reports using AWS Artifact. For more information, see [Downloading Reports in AWS Artifact](https://docs.aws.amazon.com/artifact/latest/ug/downloading-documents.html).

Your compliance responsibility when using AWS services is determined by the sensitivity of your data, your company's compliance objectives, and applicable laws and regulations. For more information about your compliance responsibility when using AWS services, see [AWS Security Documentation](https://docs.aws.amazon.com/security/).

# Resilience in Amazon AppFlow
Resilience

The AWS global infrastructure is built around AWS Regions and Availability Zones. Regions provide multiple physically separated and isolated Availability Zones, which are connected through low-latency, high-throughput, and highly redundant networking. With Availability Zones, you can design and operate applications and databases that automatically fail over between zones without interruption. Availability Zones are more highly available, fault tolerant, and scalable than traditional single or multiple data center infrastructures.

For more information about AWS Regions and Availability Zones, see [AWS Global Infrastructure](https://aws.amazon.com/about-aws/global-infrastructure/).

# Infrastructure security in Amazon AppFlow
Infrastructure security

As a managed service, Amazon AppFlow is protected by the AWS global network security procedures that are described in the [Amazon Web Services: Overview of Security Processes](https://d0.awsstatic.com/whitepapers/Security/AWS_Security_Whitepaper.pdf) whitepaper.

You use AWS published API calls to access Amazon AppFlow through the network. Clients must support Transport Layer Security (TLS) 1.0 or later. We recommend TLS 1.2 or later. Clients must also support cipher suites with perfect forward secrecy (PFS) such as Ephemeral Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman (ECDHE). Most modern systems such as Java 7 and later support these modes.

Additionally, requests must be signed using an access key ID and a secret access key that is associated with an IAM principal. Or you can use the [AWS Security Token Service](https://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html) (AWS STS) to generate temporary security credentials to sign requests.