id
stringlengths
8
78
source
stringclasses
743 values
chunk_id
int64
1
5.05k
text
stringlengths
593
49.7k
transferfamily-api-075
transferfamily-api.pdf
75
more information about using this API in one of the language-specific AWS SDKs, see the following: See Also 368 AWS Transfer Family • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also 369 API Reference AWS Transfer Family DescribedHostKey The details for a server host key. Contents Arn The unique Amazon Resource Name (ARN) for the host key. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes DateImported The date on which the host key was added to the server. Type: Timestamp Required: No Description The text description for this host key. Type: String Length Constraints: Minimum length of 0. Maximum length of 200. Pattern: [\p{Print}]* Required: No HostKeyFingerprint The public key fingerprint, which is a short sequence of bytes used to identify the longer public key. Type: String DescribedHostKey 370 API Reference AWS Transfer Family Required: No HostKeyId A unique identifier for the host key. Type: String Length Constraints: Fixed length of 25. Pattern: hostkey-[0-9a-f]{17} Required: No Tags Key-value pairs that can be used to group and search for host keys. Type: Array of Tag objects Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No Type The encryption algorithm that is used for the host key. The Type parameter is specified by using one of the following values: • ssh-rsa • ssh-ed25519 • ecdsa-sha2-nistp256 • ecdsa-sha2-nistp384 • ecdsa-sha2-nistp521 Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: See Also 371 AWS Transfer Family • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also 372 AWS Transfer Family API Reference DescribedIdentityCenterConfig A structure that contains the details of the IAM Identity Center used for your web app. Returned during a call to DescribeWebApp. Contents ApplicationArn The Amazon Resource Name (ARN) for the IAM Identity Center application: this value is set automatically when you create your web app. Type: String Length Constraints: Minimum length of 10. Maximum length of 1224. Pattern: arn:[\w-]+:sso::\d{12}:application/(sso)?ins-[a-zA-Z0-9-.]{16}/ apl-[a-zA-Z0-9]{16} Required: No InstanceArn The Amazon Resource Name (ARN) for the IAM Identity Center used for the web app. Type: String Length Constraints: Minimum length of 10. Maximum length of 1224. Pattern: arn:[\w-]+:sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16} Required: No Role The IAM role in IAM Identity Center used for the web app. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: No DescribedIdentityCenterConfig 373 AWS Transfer Family See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 374 API Reference AWS Transfer Family DescribedProfile The details for a local or partner AS2 profile. Contents Arn The unique Amazon Resource Name (ARN) for the profile. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes As2Id The As2Id is the AS2-name, as defined in the RFC 4130. For inbound transfers, this is the AS2- From header for the AS2 messages sent from the partner. For outbound connectors, this is the AS2-To header for the AS2 messages sent to the partner using the StartFileTransfer API operation. This ID cannot include spaces. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\p{Print}\s]* Required: No CertificateIds An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles. Type: Array of strings Length Constraints: Fixed length of 22. Pattern: cert-([0-9a-f]{17}) DescribedProfile 375 API Reference AWS Transfer Family Required: No ProfileId A unique identifier for the local or partner AS2 profile. Type: String Length Constraints: Fixed length of 19. Pattern: p-([0-9a-f]{17}) Required: No ProfileType Indicates whether to list only LOCAL type profiles or only PARTNER type profiles. If not supplied in the request, the command lists all types of profiles. Type: String Valid Values: LOCAL | PARTNER Required: No Tags Key-value pairs that can be used to group and search for profiles. Type: Array of Tag objects Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 376 AWS Transfer Family API Reference See Also 377 AWS Transfer Family API Reference DescribedSecurityPolicy Describes the properties of a security policy that you specify. For more information about security policies, see Working with security policies for servers or Working with security policies for SFTP connectors. Contents SecurityPolicyName
transferfamily-api-076
transferfamily-api.pdf
76
Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 376 AWS Transfer Family API Reference See Also 377 AWS Transfer Family API Reference DescribedSecurityPolicy Describes the properties of a security policy that you specify. For more information about security policies, see Working with security policies for servers or Working with security policies for SFTP connectors. Contents SecurityPolicyName The text name of the specified security policy. Type: String Length Constraints: Minimum length of 0. Maximum length of 100. Pattern: Transfer[A-Za-z0-9]*SecurityPolicy-[A-Za-z0-9-]+ Required: Yes Fips Specifies whether this policy enables Federal Information Processing Standards (FIPS). This parameter applies to both server and connector security policies. Type: Boolean Required: No Protocols Lists the file transfer protocols that the security policy applies to. Type: Array of strings Array Members: Minimum number of 1 item. Maximum number of 5 items. Valid Values: SFTP | FTPS Required: No SshCiphers Lists the enabled Secure Shell (SSH) cipher encryption algorithms in the security policy that is attached to the server or connector. This parameter applies to both server and connector security policies. DescribedSecurityPolicy 378 AWS Transfer Family Type: Array of strings API Reference Length Constraints: Minimum length of 0. Maximum length of 50. Required: No SshHostKeyAlgorithms Lists the host key algorithms for the security policy. Note This parameter only applies to security policies for connectors. Type: Array of strings Length Constraints: Minimum length of 0. Maximum length of 50. Required: No SshKexs Lists the enabled SSH key exchange (KEX) encryption algorithms in the security policy that is attached to the server or connector. This parameter applies to both server and connector security policies. Type: Array of strings Length Constraints: Minimum length of 0. Maximum length of 50. Required: No SshMacs Lists the enabled SSH message authentication code (MAC) encryption algorithms in the security policy that is attached to the server or connector. This parameter applies to both server and connector security policies. Type: Array of strings Length Constraints: Minimum length of 0. Maximum length of 50. Required: No Contents 379 AWS Transfer Family TlsCiphers API Reference Lists the enabled Transport Layer Security (TLS) cipher encryption algorithms in the security policy that is attached to the server. Note This parameter only applies to security policies for servers. Type: Array of strings Length Constraints: Minimum length of 0. Maximum length of 50. Required: No Type The resource type to which the security policy applies, either server or connector. Type: String Valid Values: SERVER | CONNECTOR Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 380 AWS Transfer Family DescribedServer API Reference Describes the properties of a file transfer protocol-enabled server that was specified. Contents Arn Specifies the unique Amazon Resource Name (ARN) of the server. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes As2ServiceManagedEgressIpAddresses The list of egress IP addresses of this server. These IP addresses are only relevant for servers that use the AS2 protocol. They are used for sending asynchronous MDNs. These IP addresses are assigned automatically when you create an AS2 server. Additionally, if you update an existing server and add the AS2 protocol, static IP addresses are assigned as well. Type: Array of strings Pattern: \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} Required: No Certificate Specifies the ARN of the AWSCertificate Manager (ACM) certificate. Required when Protocols is set to FTPS. Type: String Length Constraints: Minimum length of 0. Maximum length of 1600. Required: No DescribedServer 381 AWS Transfer Family Domain API Reference Specifies the domain of the storage system that is used for file transfers. There are two domains available: Amazon Simple Storage Service (Amazon S3) and Amazon Elastic File System (Amazon EFS). The default value is S3. Type: String Valid Values: S3 | EFS Required: No EndpointDetails The virtual private cloud (VPC) endpoint settings that are configured for your server. When you host your endpoint within your VPC, you can make your endpoint accessible only to resources within your VPC, or you can attach Elastic IP addresses and make your endpoint accessible to clients over the internet. Your VPC's default security groups are automatically assigned to your endpoint. Type: EndpointDetails object Required: No EndpointType Defines the type of endpoint that your server is connected to. If your server is connected to a VPC endpoint, your server isn't accessible over the public internet. Type: String Valid Values: PUBLIC | VPC | VPC_ENDPOINT Required: No HostKeyFingerprint Specifies the Base64-encoded SHA256 fingerprint
transferfamily-api-077
transferfamily-api.pdf
77
server. When you host your endpoint within your VPC, you can make your endpoint accessible only to resources within your VPC, or you can attach Elastic IP addresses and make your endpoint accessible to clients over the internet. Your VPC's default security groups are automatically assigned to your endpoint. Type: EndpointDetails object Required: No EndpointType Defines the type of endpoint that your server is connected to. If your server is connected to a VPC endpoint, your server isn't accessible over the public internet. Type: String Valid Values: PUBLIC | VPC | VPC_ENDPOINT Required: No HostKeyFingerprint Specifies the Base64-encoded SHA256 fingerprint of the server's host key. This value is equivalent to the output of the ssh-keygen -l -f my-new-server-key command. Type: String Required: No Contents 382 AWS Transfer Family IdentityProviderDetails API Reference Specifies information to call a customer-supplied authentication API. This field is not populated when the IdentityProviderType of a server is AWS_DIRECTORY_SERVICE or SERVICE_MANAGED. Type: IdentityProviderDetails object Required: No IdentityProviderType The mode of authentication for a server. The default value is SERVICE_MANAGED, which allows you to store and access user credentials within the AWS Transfer Family service. Use AWS_DIRECTORY_SERVICE to provide access to Active Directory groups in AWS Directory Service for Microsoft Active Directory or Microsoft Active Directory in your on-premises environment or in AWS using AD Connector. This option also requires you to provide a Directory ID by using the IdentityProviderDetails parameter. Use the API_GATEWAY value to integrate with an identity provider of your choosing. The API_GATEWAY setting requires you to provide an Amazon API Gateway endpoint URL to call for authentication by using the IdentityProviderDetails parameter. Use the AWS_LAMBDA value to directly use an AWS Lambda function as your identity provider. If you choose this value, you must specify the ARN for the Lambda function in the Function parameter for the IdentityProviderDetails data type. Type: String Valid Values: SERVICE_MANAGED | API_GATEWAY | AWS_DIRECTORY_SERVICE | AWS_LAMBDA Required: No LoggingRole The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows a server to turn on Amazon CloudWatch logging for Amazon S3 or Amazon EFS events. When set, you can view user activity in your CloudWatch logs. Type: String Contents 383 AWS Transfer Family API Reference Length Constraints: Minimum length of 0. Maximum length of 2048. Pattern: (|arn:.*role/\S+) Required: No PostAuthenticationLoginBanner Specifies a string to display when users connect to a server. This string is displayed after the user authenticates. Note The SFTP protocol does not support post-authentication display banners. Type: String Length Constraints: Minimum length of 0. Maximum length of 4096. Pattern: [\x09-\x0D\x20-\x7E]* Required: No PreAuthenticationLoginBanner Specifies a string to display when users connect to a server. This string is displayed before the user authenticates. For example, the following banner displays details about using the system: This system is for the use of authorized users only. Individuals using this computer system without authority, or in excess of their authority, are subject to having all of their activities on this system monitored and recorded by system personnel. Type: String Length Constraints: Minimum length of 0. Maximum length of 4096. Pattern: [\x09-\x0D\x20-\x7E]* Required: No ProtocolDetails The protocol settings that are configured for your server. Contents 384 AWS Transfer Family API Reference • To indicate passive mode (for FTP and FTPS protocols), use the PassiveIp parameter. Enter a single dotted-quad IPv4 address, such as the external IP address of a firewall, router, or load balancer. • To ignore the error that is generated when the client attempts to use the SETSTAT command on a file that you are uploading to an Amazon S3 bucket, use the SetStatOption parameter. To have the AWS Transfer Family server ignore the SETSTAT command and upload files without needing to make any changes to your SFTP client, set the value to ENABLE_NO_OP. If you set the SetStatOption parameter to ENABLE_NO_OP, Transfer Family generates a log entry to Amazon CloudWatch Logs, so that you can determine when the client is making a SETSTAT call. • To determine whether your AWS Transfer Family server resumes recent, negotiated sessions through a unique session ID, use the TlsSessionResumptionMode parameter. • As2Transports indicates the transport method for the AS2 messages. Currently, only HTTP is supported. Type: ProtocolDetails object Required: No Protocols Specifies the file transfer protocol or protocols over which your file transfer protocol client can connect to your server's endpoint. The available protocols are: • SFTP (Secure Shell (SSH) File Transfer Protocol): File transfer over SSH • FTPS (File Transfer Protocol Secure): File transfer with TLS encryption • FTP (File Transfer Protocol): Unencrypted file transfer • AS2 (Applicability Statement 2): used for transporting structured business-to-business data Note • If you select FTPS, you must choose a certificate stored in AWS Certificate Manager (ACM) which is used to identify your server when clients connect to it over
transferfamily-api-078
transferfamily-api.pdf
78
object Required: No Protocols Specifies the file transfer protocol or protocols over which your file transfer protocol client can connect to your server's endpoint. The available protocols are: • SFTP (Secure Shell (SSH) File Transfer Protocol): File transfer over SSH • FTPS (File Transfer Protocol Secure): File transfer with TLS encryption • FTP (File Transfer Protocol): Unencrypted file transfer • AS2 (Applicability Statement 2): used for transporting structured business-to-business data Note • If you select FTPS, you must choose a certificate stored in AWS Certificate Manager (ACM) which is used to identify your server when clients connect to it over FTPS. • If Protocol includes either FTP or FTPS, then the EndpointType must be VPC and the IdentityProviderType must be either AWS_DIRECTORY_SERVICE, AWS_LAMBDA, or API_GATEWAY. • If Protocol includes FTP, then AddressAllocationIds cannot be associated. Contents 385 AWS Transfer Family API Reference • If Protocol is set only to SFTP, the EndpointType can be set to PUBLIC and the IdentityProviderType can be set any of the supported identity types: SERVICE_MANAGED, AWS_DIRECTORY_SERVICE, AWS_LAMBDA, or API_GATEWAY. • If Protocol includes AS2, then the EndpointType must be VPC, and domain must be Amazon S3. Type: Array of strings Array Members: Minimum number of 1 item. Maximum number of 4 items. Valid Values: SFTP | FTP | FTPS | AS2 Required: No S3StorageOptions Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default. By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry Type to FILE if you want a mapping to have a file target. Type: S3StorageOptions object Required: No SecurityPolicyName Specifies the name of the security policy for the server. Type: String Length Constraints: Minimum length of 0. Maximum length of 100. Pattern: Transfer[A-Za-z0-9]*SecurityPolicy-[A-Za-z0-9-]+ Required: No ServerId Specifies the unique system-assigned identifier for a server that you instantiate. Contents 386 AWS Transfer Family Type: String Length Constraints: Fixed length of 19. Pattern: s-([0-9a-f]{17}) Required: No State API Reference The condition of the server that was described. A value of ONLINE indicates that the server can accept jobs and transfer files. A State value of OFFLINE means that the server cannot perform file transfer operations. The states of STARTING and STOPPING indicate that the server is in an intermediate state, either not fully able to respond, or not fully offline. The values of START_FAILED or STOP_FAILED can indicate an error condition. Type: String Valid Values: OFFLINE | ONLINE | STARTING | STOPPING | START_FAILED | STOP_FAILED Required: No StructuredLogDestinations Specifies the log groups to which your server logs are sent. To specify a log group, you must provide the ARN for an existing log group. In this case, the format of the log group is as follows: arn:aws:logs:region-name:amazon-account-id:log-group:log-group-name:* For example, arn:aws:logs:us-east-1:111122223333:log-group:mytestgroup:* If you have previously specified a log group for a server, you can clear it, and in effect turn off structured logging, by providing an empty value for this parameter in an update-server call. For example: update-server --server-id s-1234567890abcdef0 --structured-log- destinations Type: Array of strings Contents 387 AWS Transfer Family API Reference Array Members: Minimum number of 0 items. Maximum number of 1 item. Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: No Tags Specifies the key-value pairs that you can use to search for and group servers that were assigned to the server that was described. Type: Array of Tag objects Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No UserCount Specifies the number of users that are assigned to a server you specified with the ServerId. Type: Integer Required: No WorkflowDetails Specifies the workflow ID for the workflow to assign and the execution role that's used for executing the workflow. In addition to a workflow to execute when a file is uploaded completely, WorkflowDetails can also contain a workflow ID (and execution role) for a workflow to execute on partial upload. A partial upload occurs when the server session disconnects while the file is still being uploaded. Type: WorkflowDetails object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: See Also 388 AWS Transfer Family • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also 389 AWS Transfer Family DescribedUser Describes the properties of a user that was specified. Contents Arn API Reference Specifies the unique Amazon Resource Name (ARN) for the user that was requested to be described. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes HomeDirectory The landing directory (folder) for a user when they log in to the server using the client. A HomeDirectory example
transferfamily-api-079
transferfamily-api.pdf
79
the following: See Also 388 AWS Transfer Family • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also 389 AWS Transfer Family DescribedUser Describes the properties of a user that was specified. Contents Arn API Reference Specifies the unique Amazon Resource Name (ARN) for the user that was requested to be described. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes HomeDirectory The landing directory (folder) for a user when they log in to the server using the client. A HomeDirectory example is /bucket_name/home/mydirectory. Note The HomeDirectory parameter is only used if HomeDirectoryType is set to PATH. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Pattern: (|/.*) Required: No HomeDirectoryMappings Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your user and how you want to make them visible. You must specify the Entry and Target pair, where Entry shows how the path is made visible and Target is the actual DescribedUser 390 AWS Transfer Family API Reference Amazon S3 or Amazon EFS path. If you only specify a target, it is displayed as is. You also must ensure that your AWS Identity and Access Management (IAM) role provides access to paths in Target. This value can be set only when HomeDirectoryType is set to LOGICAL. In most cases, you can use this value instead of the session policy to lock your user down to the designated home directory ("chroot"). To do this, you can set Entry to '/' and set Target to the HomeDirectory parameter value. Type: Array of HomeDirectoryMapEntry objects Array Members: Minimum number of 1 item. Maximum number of 50000 items. Required: No HomeDirectoryType The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer protocol clients. If you set it to LOGICAL, you need to provide mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths visible to your users. Note If HomeDirectoryType is LOGICAL, you must provide mappings, using the HomeDirectoryMappings parameter. If, on the other hand, HomeDirectoryType is PATH, you provide an absolute path using the HomeDirectory parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your template. Type: String Valid Values: PATH | LOGICAL Required: No Policy A session policy for your user so that you can use the same AWS Identity and Access Management (IAM) role across multiple users. This policy scopes down a user's access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include ${Transfer:UserName}, ${Transfer:HomeDirectory}, and ${Transfer:HomeBucket}. Contents 391 AWS Transfer Family Type: String API Reference Length Constraints: Minimum length of 0. Maximum length of 2048. Required: No PosixProfile Specifies the full POSIX identity, including user ID (Uid), group ID (Gid), and any secondary groups IDs (SecondaryGids), that controls your users' access to your Amazon Elastic File System (Amazon EFS) file systems. The POSIX permissions that are set on files and directories in your file system determine the level of access your users get when transferring files into and out of your Amazon EFS file systems. Type: PosixProfile object Required: No Role The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: No SshPublicKeys Specifies the public key portion of the Secure Shell (SSH) keys stored for the described user. Note To delete the public key body, set its value to zero keys, as shown here: SshPublicKeys: [] Contents 392 AWS Transfer Family API Reference Type: Array of SshPublicKey objects Array Members: Minimum number of 0 items. Maximum number of 5 items. Required: No Tags Specifies the key-value pairs for the user requested. Tag can be used to search for and group users for a variety of purposes. Type: Array of Tag objects Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No UserName Specifies the name of the user that was requested to be described. User names are used for authentication purposes. This is
transferfamily-api-080
transferfamily-api.pdf
80
value to zero keys, as shown here: SshPublicKeys: [] Contents 392 AWS Transfer Family API Reference Type: Array of SshPublicKey objects Array Members: Minimum number of 0 items. Maximum number of 5 items. Required: No Tags Specifies the key-value pairs for the user requested. Tag can be used to search for and group users for a variety of purposes. Type: Array of Tag objects Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No UserName Specifies the name of the user that was requested to be described. User names are used for authentication purposes. This is the string that will be used by your user when they log in to your server. Type: String Length Constraints: Minimum length of 3. Maximum length of 100. Pattern: [\w][\[email protected]]{2,99} Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 393 AWS Transfer Family DescribedWebApp API Reference A structure that describes the parameters for the web app, as identified by the WebAppId. Contents Arn The Amazon Resource Name (ARN) of the web app. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes WebAppId The unique identifier for the web app. Type: String Length Constraints: Fixed length of 24. Pattern: webapp-[0-9a-f]{17} Required: Yes AccessEndpoint The AccessEndpoint is the URL that you provide to your users for them to interact with the Transfer Family web app. You can specify a custom URL or use the default value. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No DescribedIdentityProviderDetails A structure that contains the details for the identity provider used by the web app. DescribedWebApp 394 AWS Transfer Family API Reference Type: DescribedWebAppIdentityProviderDetails object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No Tags Key-value pairs that can be used to group and search for web apps. Tags are metadata attached to web apps for any purpose. Type: Array of Tag objects Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No WebAppEndpoint The WebAppEndpoint is the unique URL for your Transfer Family web app. This is the value that you use when you configure Origins on CloudFront. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No WebAppEndpointPolicy Setting for the type of endpoint policy for the web app. The default value is STANDARD. If your web app was created in an AWS GovCloud (US) Region, the value of this parameter can be FIPS, which indicates the web app endpoint is FIPS-compliant. Type: String Valid Values: FIPS | STANDARD Required: No WebAppUnits A union that contains the value for number of concurrent connections or the user sessions on your web app. Contents 395 AWS Transfer Family Type: WebAppUnits object API Reference Note: This object is a Union. Only one member of this object can be specified or returned. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 396 AWS Transfer Family API Reference DescribedWebAppCustomization A structure that contains the customization fields for the web app. You can provide a title, logo, and icon to customize the appearance of your web app. Contents Arn Returns the Amazon Resource Name (ARN) for the web app. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes WebAppId Returns the unique identifier for your web app. Type: String Length Constraints: Fixed length of 24. Pattern: webapp-[0-9a-f]{17} Required: Yes FaviconFile Returns an icon file data string (in base64 encoding). Type: Base64-encoded binary data object Length Constraints: Minimum length of 1. Maximum length of 20960. Required: No LogoFile Returns a logo file data string (in base64 encoding). DescribedWebAppCustomization 397 AWS Transfer Family API Reference Type: Base64-encoded binary data object Length Constraints: Minimum length of 1. Maximum length of 51200. Required: No Title Returns the page title that you defined for your web app. Type: String Length Constraints: Minimum length of 0. Maximum length of 100. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 398 AWS Transfer Family API Reference DescribedWebAppIdentityProviderDetails Returns a structure that contains the identity provider details for your web app. Contents Important This data type is a UNION, so only one of the following members can be
transferfamily-api-081
transferfamily-api.pdf
81
Returns the page title that you defined for your web app. Type: String Length Constraints: Minimum length of 0. Maximum length of 100. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 398 AWS Transfer Family API Reference DescribedWebAppIdentityProviderDetails Returns a structure that contains the identity provider details for your web app. Contents Important This data type is a UNION, so only one of the following members can be specified when used or returned. IdentityCenterConfig Returns a structure for your identity provider details. This structure contains the instance ARN and role being used for the web app. Type: DescribedIdentityCenterConfig object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 DescribedWebAppIdentityProviderDetails 399 API Reference AWS Transfer Family DescribedWorkflow Describes the properties of the specified workflow Contents Arn Specifies the unique Amazon Resource Name (ARN) for the workflow. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes Description Specifies the text description for the workflow. Type: String Length Constraints: Minimum length of 0. Maximum length of 256. Pattern: [\w- ]* Required: No OnExceptionSteps Specifies the steps (actions) to take if errors are encountered during execution of the workflow. Type: Array of WorkflowStep objects Array Members: Minimum number of 0 items. Maximum number of 8 items. Required: No Steps Specifies the details for the steps that are in the specified workflow. Type: Array of WorkflowStep objects DescribedWorkflow 400 AWS Transfer Family API Reference Array Members: Minimum number of 0 items. Maximum number of 8 items. Required: No Tags Key-value pairs that can be used to group and search for workflows. Tags are metadata attached to workflows for any purpose. Type: Array of Tag objects Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No WorkflowId A unique identifier for the workflow. Type: String Length Constraints: Fixed length of 19. Pattern: w-([a-z0-9]{17}) Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 401 AWS Transfer Family EfsFileLocation API Reference Specifies the details for the file location for the file that's being used in the workflow. Only applicable if you are using Amazon Elastic File Systems (Amazon EFS) for storage. Contents FileSystemId The identifier of the file system, assigned by Amazon EFS. Type: String Length Constraints: Minimum length of 0. Maximum length of 128. Pattern: (arn:aws[-a-z]*:elasticfilesystem:[0-9a-z-:]+:(access-point/fsap| file-system/fs)-[0-9a-f]{8,40}|fs(ap)?-[0-9a-f]{8,40}) Required: No Path The pathname for the folder being used by a workflow. Type: String Length Constraints: Minimum length of 1. Maximum length of 65536. Pattern: [^\x00]+ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 EfsFileLocation 402 AWS Transfer Family API Reference See Also 403 AWS Transfer Family EndpointDetails API Reference The virtual private cloud (VPC) endpoint settings that are configured for your file transfer protocol- enabled server. With a VPC endpoint, you can restrict access to your server and resources only within your VPC. To control incoming internet traffic, invoke the UpdateServer API and attach an Elastic IP address to your server's endpoint. Note After May 19, 2021, you won't be able to create a server using EndpointType=VPC_ENDPOINT in your AWS account if your account hasn't already done so before May 19, 2021. If you have already created servers with EndpointType=VPC_ENDPOINT in your AWS account on or before May 19, 2021, you will not be affected. After this date, use EndpointType=VPC. For more information, see Discontinuing the use of VPC_ENDPOINT. It is recommended that you use VPC as the EndpointType. With this endpoint type, you have the option to directly associate up to three Elastic IPv4 addresses (BYO IP included) with your server's endpoint and use VPC security groups to restrict traffic by the client's public IP address. This is not possible with EndpointType set to VPC_ENDPOINT. Contents AddressAllocationIds A list of address allocation IDs that are required to attach an Elastic IP address to your server's endpoint. An address allocation ID corresponds to the allocation ID of an Elastic IP address. This value can be retrieved from the allocationId field from the Amazon EC2 Address data type. One way to retrieve this value is by calling the EC2 DescribeAddresses API. This parameter is optional. Set
transferfamily-api-082
transferfamily-api.pdf
82
addresses (BYO IP included) with your server's endpoint and use VPC security groups to restrict traffic by the client's public IP address. This is not possible with EndpointType set to VPC_ENDPOINT. Contents AddressAllocationIds A list of address allocation IDs that are required to attach an Elastic IP address to your server's endpoint. An address allocation ID corresponds to the allocation ID of an Elastic IP address. This value can be retrieved from the allocationId field from the Amazon EC2 Address data type. One way to retrieve this value is by calling the EC2 DescribeAddresses API. This parameter is optional. Set this parameter if you want to make your VPC endpoint public- facing. For details, see Create an internet-facing endpoint for your server. Note This property can only be set as follows: EndpointDetails 404 AWS Transfer Family API Reference • EndpointType must be set to VPC • The Transfer Family server must be offline. • You cannot set this parameter for Transfer Family servers that use the FTP protocol. • The server must already have SubnetIds populated (SubnetIds and AddressAllocationIds cannot be updated simultaneously). • AddressAllocationIds can't contain duplicates, and must be equal in length to SubnetIds. For example, if you have three subnet IDs, you must also specify three address allocation IDs. • Call the UpdateServer API to set or change this parameter. Type: Array of strings Required: No SecurityGroupIds A list of security groups IDs that are available to attach to your server's endpoint. Note This property can only be set when EndpointType is set to VPC. You can edit the SecurityGroupIds property in the UpdateServer API only if you are changing the EndpointType from PUBLIC or VPC_ENDPOINT to VPC. To change security groups associated with your server's VPC endpoint after creation, use the Amazon EC2 ModifyVpcEndpoint API. Type: Array of strings Length Constraints: Minimum length of 11. Maximum length of 20. Pattern: sg-[0-9a-f]{8,17} Required: No SubnetIds A list of subnet IDs that are required to host your server endpoint in your VPC. Contents 405 AWS Transfer Family Note This property can only be set when EndpointType is set to VPC. API Reference Type: Array of strings Required: No VpcEndpointId The identifier of the VPC endpoint. Note This property can only be set when EndpointType is set to VPC_ENDPOINT. For more information, see Discontinuing the use of VPC_ENDPOINT. Type: String Length Constraints: Fixed length of 22. Pattern: vpce-[0-9a-f]{17} Required: No VpcId The VPC identifier of the VPC in which a server's endpoint will be hosted. Note This property can only be set when EndpointType is set to VPC. Type: String Required: No Contents 406 AWS Transfer Family See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 407 AWS Transfer Family ExecutionError API Reference Specifies the error message and type, for an error that occurs during the execution of the workflow. Contents Message Specifies the descriptive message that corresponds to the ErrorType. Type: String Required: Yes Type Specifies the error type. • ALREADY_EXISTS: occurs for a copy step, if the overwrite option is not selected and a file with the same name already exists in the target location. • BAD_REQUEST: a general bad request: for example, a step that attempts to tag an EFS file returns BAD_REQUEST, as only S3 files can be tagged. • CUSTOM_STEP_FAILED: occurs when the custom step provided a callback that indicates failure. • INTERNAL_SERVER_ERROR: a catch-all error that can occur for a variety of reasons. • NOT_FOUND: occurs when a requested entity, for example a source file for a copy step, does not exist. • PERMISSION_DENIED: occurs if your policy does not contain the correct permissions to complete one or more of the steps in the workflow. • TIMEOUT: occurs when the execution times out. Note You can set the TimeoutSeconds for a custom step, anywhere from 1 second to 1800 seconds (30 minutes). • THROTTLED: occurs if you exceed the new execution refill rate of one workflow per second. Type: String ExecutionError 408 AWS Transfer Family API Reference Valid Values: PERMISSION_DENIED | CUSTOM_STEP_FAILED | THROTTLED | ALREADY_EXISTS | NOT_FOUND | BAD_REQUEST | TIMEOUT | INTERNAL_SERVER_ERROR Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 409 AWS Transfer Family ExecutionResults API Reference Specifies the steps in the workflow, as well as the steps to execute in case of any errors during workflow execution. Contents OnExceptionSteps Specifies the steps (actions) to take if errors are encountered during execution of the workflow. Type: Array of
transferfamily-api-083
transferfamily-api.pdf
83
| THROTTLED | ALREADY_EXISTS | NOT_FOUND | BAD_REQUEST | TIMEOUT | INTERNAL_SERVER_ERROR Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 409 AWS Transfer Family ExecutionResults API Reference Specifies the steps in the workflow, as well as the steps to execute in case of any errors during workflow execution. Contents OnExceptionSteps Specifies the steps (actions) to take if errors are encountered during execution of the workflow. Type: Array of ExecutionStepResult objects Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No Steps Specifies the details for the steps that are in the specified workflow. Type: Array of ExecutionStepResult objects Array Members: Minimum number of 1 item. Maximum number of 50 items. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 ExecutionResults 410 AWS Transfer Family API Reference ExecutionStepResult Specifies the following details for the step: error (if any), outputs (if any), and the step type. Contents Error Specifies the details for an error, if it occurred during execution of the specified workflow step. Type: ExecutionError object Required: No Outputs The values for the key/value pair applied as a tag to the file. Only applicable if the step type is TAG. Type: String Length Constraints: Minimum length of 0. Maximum length of 65536. Required: No StepType One of the available step types. • COPY - Copy the file to another location. • CUSTOM - Perform a custom step with an AWS Lambda function target. • DECRYPT - Decrypt a file that was encrypted before it was uploaded. • DELETE - Delete the file. • TAG - Add a tag to the file. Type: String Valid Values: COPY | CUSTOM | TAG | DELETE | DECRYPT Required: No ExecutionStepResult 411 AWS Transfer Family See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 412 AWS Transfer Family FileLocation Specifies the Amazon S3 or EFS file details to be used in the step. API Reference Contents EfsFileLocation Specifies the Amazon EFS identifier and the path for the file being used. Type: EfsFileLocation object Required: No S3FileLocation Specifies the S3 details for the file being used, such as bucket, ETag, and so forth. Type: S3FileLocation object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 FileLocation 413 AWS Transfer Family API Reference HomeDirectoryMapEntry Represents an object that contains entries and targets for HomeDirectoryMappings. The following is an Entry and Target pair example for chroot. [ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ] Contents Entry Represents an entry for HomeDirectoryMappings. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Pattern: /.* Required: Yes Target Represents the map target that is used in a HomeDirectoryMapEntry. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Pattern: /.* Required: Yes Type Specifies the type of mapping. Set the type to FILE if you want the mapping to point to a file, or DIRECTORY for the directory to point to a directory. Note By default, home directory mappings have a Type of DIRECTORY when you create a Transfer Family server. You would need to explicitly set Type to FILE if you want a mapping to have a file target. HomeDirectoryMapEntry 414 AWS Transfer Family Type: String Valid Values: FILE | DIRECTORY Required: No See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 415 AWS Transfer Family API Reference IdentityCenterConfig A structure that describes the values to use for the IAM Identity Center settings when you create or update a web app. Contents InstanceArn The Amazon Resource Name (ARN) for the IAM Identity Center used for the web app. Type: String Length Constraints: Minimum length of 10. Maximum length of 1224. Pattern: arn:[\w-]+:sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16} Required: No Role The IAM role in IAM Identity Center used for the web app. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs,
transferfamily-api-084
transferfamily-api.pdf
84
A structure that describes the values to use for the IAM Identity Center settings when you create or update a web app. Contents InstanceArn The Amazon Resource Name (ARN) for the IAM Identity Center used for the web app. Type: String Length Constraints: Minimum length of 10. Maximum length of 1224. Pattern: arn:[\w-]+:sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16} Required: No Role The IAM role in IAM Identity Center used for the web app. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 IdentityCenterConfig 416 AWS Transfer Family API Reference IdentityProviderDetails Returns information related to the type of user authentication that is in use for a file transfer protocol-enabled server's users. A server can have only one method of authentication. Contents DirectoryId The identifier of the AWS Directory Service directory that you want to use as your identity provider. Type: String Length Constraints: Fixed length of 12. Pattern: d-[0-9a-f]{10} Required: No Function The ARN for a Lambda function to use for the Identity provider. Type: String Length Constraints: Minimum length of 1. Maximum length of 170. Pattern: arn:[a-z-]+:lambda:.* Required: No InvocationRole This parameter is only applicable if your IdentityProviderType is API_GATEWAY. Provides the type of InvocationRole used to authenticate the user account. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: No IdentityProviderDetails 417 AWS Transfer Family SftpAuthenticationMethods API Reference For SFTP-enabled servers, and for custom identity providers only, you can specify whether to authenticate using a password, SSH key pair, or both. • PASSWORD - users must provide their password to connect. • PUBLIC_KEY - users must provide their private key to connect. • PUBLIC_KEY_OR_PASSWORD - users can authenticate with either their password or their key. This is the default value. • PUBLIC_KEY_AND_PASSWORD - users must provide both their private key and their password to connect. The server checks the key first, and then if the key is valid, the system prompts for a password. If the private key provided does not match the public key that is stored, authentication fails. Type: String Valid Values: PASSWORD | PUBLIC_KEY | PUBLIC_KEY_OR_PASSWORD | PUBLIC_KEY_AND_PASSWORD Required: No Url Provides the location of the service endpoint used to authenticate users. Type: String Length Constraints: Minimum length of 0. Maximum length of 255. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 418 AWS Transfer Family InputFileLocation Specifies the location for the file that's being processed. Contents EfsFileLocation API Reference Specifies the details for the Amazon Elastic File System (Amazon EFS) file that's being decrypted. Type: EfsFileLocation object Required: No S3FileLocation Specifies the details for the Amazon S3 file that's being copied or decrypted. Type: S3InputFileLocation object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 InputFileLocation 419 AWS Transfer Family ListedAccess Lists the properties for one or more specified associated accesses. API Reference Contents ExternalId A unique identifier that is required to identify specific groups within your directory. The users of the group that you associate have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using AWS Transfer Family. If you know the group name, you can view the SID values by running the following command using Windows PowerShell. Get-ADGroup -Filter {samAccountName -like "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid In that command, replace YourGroupName with the name of your Active Directory group. The regular expression used to validate this parameter is a string of characters consisting of uppercase and lowercase alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/- Type: String Length Constraints: Minimum length of 1. Maximum length of 256. Pattern: S-1-[\d-]+ Required: No HomeDirectory The landing directory (folder) for a user when they log in to the server using the client. A HomeDirectory example is /bucket_name/home/mydirectory. Note The HomeDirectory parameter is only used if HomeDirectoryType is set to PATH. Type: String ListedAccess 420 AWS Transfer Family API Reference Length Constraints: Minimum length of 0. Maximum length of 1024. Pattern: (|/.*) Required: No HomeDirectoryType The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or Amazon EFS path as
transferfamily-api-085
transferfamily-api.pdf
85
landing directory (folder) for a user when they log in to the server using the client. A HomeDirectory example is /bucket_name/home/mydirectory. Note The HomeDirectory parameter is only used if HomeDirectoryType is set to PATH. Type: String ListedAccess 420 AWS Transfer Family API Reference Length Constraints: Minimum length of 0. Maximum length of 1024. Pattern: (|/.*) Required: No HomeDirectoryType The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer protocol clients. If you set it to LOGICAL, you need to provide mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths visible to your users. Note If HomeDirectoryType is LOGICAL, you must provide mappings, using the HomeDirectoryMappings parameter. If, on the other hand, HomeDirectoryType is PATH, you provide an absolute path using the HomeDirectory parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your template. Type: String Valid Values: PATH | LOGICAL Required: No Role The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Contents 421 AWS Transfer Family Required: No See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 422 AWS Transfer Family ListedAgreement Describes the properties of an agreement. Contents AgreementId API Reference A unique identifier for the agreement. This identifier is returned when you create an agreement. Type: String Length Constraints: Fixed length of 19. Pattern: a-([0-9a-f]{17}) Required: No Arn The Amazon Resource Name (ARN) of the specified agreement. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: No Description The current description for the agreement. You can change it by calling the UpdateAgreement operation and providing a new description. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [\p{Graph}]+ Required: No LocalProfileId A unique identifier for the AS2 local profile. ListedAgreement 423 API Reference AWS Transfer Family Type: String Length Constraints: Fixed length of 19. Pattern: p-([0-9a-f]{17}) Required: No PartnerProfileId A unique identifier for the partner profile. Type: String Length Constraints: Fixed length of 19. Pattern: p-([0-9a-f]{17}) Required: No ServerId The unique identifier for the agreement. Type: String Length Constraints: Fixed length of 19. Pattern: s-([0-9a-f]{17}) Required: No Status The agreement can be either ACTIVE or INACTIVE. Type: String Valid Values: ACTIVE | INACTIVE Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: See Also 424 AWS Transfer Family • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also 425 AWS Transfer Family ListedCertificate Describes the properties of a certificate. Contents ActiveDate API Reference An optional date that specifies when the certificate becomes active. If you do not specify a value, ActiveDate takes the same value as NotBeforeDate, which is specified by the CA. Type: Timestamp Required: No Arn The Amazon Resource Name (ARN) of the specified certificate. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: No CertificateId An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles. Type: String Length Constraints: Fixed length of 22. Pattern: cert-([0-9a-f]{17}) Required: No Description The name or short description that's used to identify the certificate. Type: String ListedCertificate 426 AWS Transfer Family API Reference Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [\p{Graph}]+ Required: No InactiveDate An optional date that specifies when the certificate becomes inactive. If you do not specify a value, InactiveDate takes the same value as NotAfterDate, which is specified by the CA. Type: Timestamp Required: No Status The certificate can be either ACTIVE, PENDING_ROTATION, or INACTIVE. PENDING_ROTATION means that this certificate will replace the current certificate when it expires. Type: String Valid Values: ACTIVE | PENDING_ROTATION | INACTIVE Required: No Type The type for the certificate. If a private key has been specified for the certificate, its type is
transferfamily-api-086
transferfamily-api.pdf
86
Minimum length of 1. Maximum length of 200. Pattern: [\p{Graph}]+ Required: No InactiveDate An optional date that specifies when the certificate becomes inactive. If you do not specify a value, InactiveDate takes the same value as NotAfterDate, which is specified by the CA. Type: Timestamp Required: No Status The certificate can be either ACTIVE, PENDING_ROTATION, or INACTIVE. PENDING_ROTATION means that this certificate will replace the current certificate when it expires. Type: String Valid Values: ACTIVE | PENDING_ROTATION | INACTIVE Required: No Type The type for the certificate. If a private key has been specified for the certificate, its type is CERTIFICATE_WITH_PRIVATE_KEY. If there is no private key, the type is CERTIFICATE. Type: String Valid Values: CERTIFICATE | CERTIFICATE_WITH_PRIVATE_KEY Required: No Usage Specifies how this certificate is used. It can be used in the following ways: • SIGNING: For signing AS2 messages • ENCRYPTION: For encrypting AS2 messages • TLS: For securing AS2 communications sent over HTTPS Type: String Contents 427 AWS Transfer Family API Reference Valid Values: SIGNING | ENCRYPTION | TLS Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 428 API Reference AWS Transfer Family ListedConnector Returns details of the connector that is specified. Contents Arn The Amazon Resource Name (ARN) of the specified connector. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: No ConnectorId The unique identifier for the connector. Type: String Length Constraints: Fixed length of 19. Pattern: c-([0-9a-f]{17}) Required: No Url The URL of the partner's AS2 or SFTP endpoint. Type: String Length Constraints: Minimum length of 0. Maximum length of 255. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: ListedConnector 429 AWS Transfer Family • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also 430 API Reference AWS Transfer Family ListedExecution Returns properties of the execution that is specified. Contents ExecutionId A unique identifier for the execution of a workflow. Type: String Length Constraints: Fixed length of 36. Pattern: [0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\- [0-9a-fA-F]{12} Required: No InitialFileLocation A structure that describes the Amazon S3 or EFS file location. This is the file location when the execution begins: if the file is being copied, this is the initial (as opposed to destination) file location. Type: FileLocation object Required: No ServiceMetadata A container object for the session details that are associated with a workflow. Type: ServiceMetadata object Required: No Status The status is one of the execution. Can be in progress, completed, exception encountered, or handling the exception. Type: String ListedExecution 431 AWS Transfer Family API Reference Valid Values: IN_PROGRESS | COMPLETED | EXCEPTION | HANDLING_EXCEPTION Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 432 API Reference AWS Transfer Family ListedHostKey Returns properties of the host key that's specified. Contents Arn The unique Amazon Resource Name (ARN) of the host key. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes DateImported The date on which the host key was added to the server. Type: Timestamp Required: No Description The current description for the host key. You can change it by calling the UpdateHostKey operation and providing a new description. Type: String Length Constraints: Minimum length of 0. Maximum length of 200. Pattern: [\p{Print}]* Required: No Fingerprint The public key fingerprint, which is a short sequence of bytes used to identify the longer public key. Type: String ListedHostKey 433 API Reference AWS Transfer Family Required: No HostKeyId A unique identifier for the host key. Type: String Length Constraints: Fixed length of 25. Pattern: hostkey-[0-9a-f]{17} Required: No Type The encryption algorithm that is used for the host key. The Type parameter is specified by using one of the following values: • ssh-rsa • ssh-ed25519 • ecdsa-sha2-nistp256 • ecdsa-sha2-nistp384 • ecdsa-sha2-nistp521 Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 434 API Reference AWS Transfer Family ListedProfile Returns the properties of the profile that was specified. Contents Arn The Amazon Resource Name (ARN) of the specified profile. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: No As2Id The As2Id is the AS2-name, as defined in the RFC 4130. For inbound transfers,
transferfamily-api-087
transferfamily-api.pdf
87
Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 434 API Reference AWS Transfer Family ListedProfile Returns the properties of the profile that was specified. Contents Arn The Amazon Resource Name (ARN) of the specified profile. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: No As2Id The As2Id is the AS2-name, as defined in the RFC 4130. For inbound transfers, this is the AS2- From header for the AS2 messages sent from the partner. For outbound connectors, this is the AS2-To header for the AS2 messages sent to the partner using the StartFileTransfer API operation. This ID cannot include spaces. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [\p{Print}\s]* Required: No ProfileId A unique identifier for the local or partner AS2 profile. Type: String Length Constraints: Fixed length of 19. Pattern: p-([0-9a-f]{17}) Required: No ListedProfile 435 AWS Transfer Family ProfileType API Reference Indicates whether to list only LOCAL type profiles or only PARTNER type profiles. If not supplied in the request, the command lists all types of profiles. Type: String Valid Values: LOCAL | PARTNER Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 436 AWS Transfer Family ListedServer API Reference Returns properties of a file transfer protocol-enabled server that was specified. Contents Arn Specifies the unique Amazon Resource Name (ARN) for a server to be listed. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes Domain Specifies the domain of the storage system that is used for file transfers. There are two domains available: Amazon Simple Storage Service (Amazon S3) and Amazon Elastic File System (Amazon EFS). The default value is S3. Type: String Valid Values: S3 | EFS Required: No EndpointType Specifies the type of VPC endpoint that your server is connected to. If your server is connected to a VPC endpoint, your server isn't accessible over the public internet. Type: String Valid Values: PUBLIC | VPC | VPC_ENDPOINT Required: No IdentityProviderType The mode of authentication for a server. The default value is SERVICE_MANAGED, which allows you to store and access user credentials within the AWS Transfer Family service. ListedServer 437 AWS Transfer Family API Reference Use AWS_DIRECTORY_SERVICE to provide access to Active Directory groups in AWS Directory Service for Microsoft Active Directory or Microsoft Active Directory in your on-premises environment or in AWS using AD Connector. This option also requires you to provide a Directory ID by using the IdentityProviderDetails parameter. Use the API_GATEWAY value to integrate with an identity provider of your choosing. The API_GATEWAY setting requires you to provide an Amazon API Gateway endpoint URL to call for authentication by using the IdentityProviderDetails parameter. Use the AWS_LAMBDA value to directly use an AWS Lambda function as your identity provider. If you choose this value, you must specify the ARN for the Lambda function in the Function parameter for the IdentityProviderDetails data type. Type: String Valid Values: SERVICE_MANAGED | API_GATEWAY | AWS_DIRECTORY_SERVICE | AWS_LAMBDA Required: No LoggingRole The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows a server to turn on Amazon CloudWatch logging for Amazon S3 or Amazon EFS events. When set, you can view user activity in your CloudWatch logs. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: No ServerId Specifies the unique system assigned identifier for the servers that were listed. Type: String Length Constraints: Fixed length of 19. Pattern: s-([0-9a-f]{17}) Contents 438 AWS Transfer Family Required: No State API Reference The condition of the server that was described. A value of ONLINE indicates that the server can accept jobs and transfer files. A State value of OFFLINE means that the server cannot perform file transfer operations. The states of STARTING and STOPPING indicate that the server is in an intermediate state, either not fully able to respond, or not fully offline. The values of START_FAILED or STOP_FAILED can indicate an error condition. Type: String Valid Values: OFFLINE | ONLINE | STARTING | STOPPING | START_FAILED | STOP_FAILED Required: No UserCount Specifies the number of users that are assigned to a server you specified with the ServerId. Type: Integer Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby
transferfamily-api-088
transferfamily-api.pdf
88
server is in an intermediate state, either not fully able to respond, or not fully offline. The values of START_FAILED or STOP_FAILED can indicate an error condition. Type: String Valid Values: OFFLINE | ONLINE | STARTING | STOPPING | START_FAILED | STOP_FAILED Required: No UserCount Specifies the number of users that are assigned to a server you specified with the ServerId. Type: Integer Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 439 AWS Transfer Family ListedUser Returns properties of the user that you specify. Contents Arn API Reference Provides the unique Amazon Resource Name (ARN) for the user that you want to learn about. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes HomeDirectory The landing directory (folder) for a user when they log in to the server using the client. A HomeDirectory example is /bucket_name/home/mydirectory. Note The HomeDirectory parameter is only used if HomeDirectoryType is set to PATH. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Pattern: (|/.*) Required: No HomeDirectoryType The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer protocol clients. If you set it to LOGICAL, you need ListedUser 440 AWS Transfer Family API Reference to provide mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or Amazon EFS paths visible to your users. Note If HomeDirectoryType is LOGICAL, you must provide mappings, using the HomeDirectoryMappings parameter. If, on the other hand, HomeDirectoryType is PATH, you provide an absolute path using the HomeDirectory parameter. You cannot have both HomeDirectory and HomeDirectoryMappings in your template. Type: String Valid Values: PATH | LOGICAL Required: No Role The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests. Note The IAM role that controls your users' access to your Amazon S3 bucket for servers with Domain=S3, or your EFS file system for servers with Domain=EFS. The policies attached to this role determine the level of access you want to provide your users when transferring files into and out of your S3 buckets or EFS file systems. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: No Contents 441 AWS Transfer Family SshPublicKeyCount API Reference Specifies the number of SSH public keys stored for the user you specified. Type: Integer Required: No UserName Specifies the name of the user whose ARN was specified. User names are used for authentication purposes. Type: String Length Constraints: Minimum length of 3. Maximum length of 100. Pattern: [\w][\[email protected]]{2,99} Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 442 API Reference AWS Transfer Family ListedWebApp a structure that contains details for the web app. Contents Arn The Amazon Resource Name (ARN) for the web app. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: Yes WebAppId The unique identifier for the web app. Type: String Length Constraints: Fixed length of 24. Pattern: webapp-[0-9a-f]{17} Required: Yes AccessEndpoint The AccessEndpoint is the URL that you provide to your users for them to interact with the Transfer Family web app. You can specify a custom URL or use the default value. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No WebAppEndpoint The WebAppEndpoint is the unique URL for your Transfer Family web app. This is the value that you use when you configure Origins on CloudFront. ListedWebApp 443 AWS Transfer Family Type: String API Reference Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 444 AWS Transfer Family ListedWorkflow API Reference
transferfamily-api-089
transferfamily-api.pdf
89
of 1. Maximum length of 1024. Required: No WebAppEndpoint The WebAppEndpoint is the unique URL for your Transfer Family web app. This is the value that you use when you configure Origins on CloudFront. ListedWebApp 443 AWS Transfer Family Type: String API Reference Length Constraints: Minimum length of 1. Maximum length of 1024. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 444 AWS Transfer Family ListedWorkflow API Reference Contains the identifier, text description, and Amazon Resource Name (ARN) for the workflow. Contents Arn Specifies the unique Amazon Resource Name (ARN) for the workflow. Type: String Length Constraints: Minimum length of 20. Maximum length of 1600. Pattern: arn:\S+ Required: No Description Specifies the text description for the workflow. Type: String Length Constraints: Minimum length of 0. Maximum length of 256. Pattern: [\w- ]* Required: No WorkflowId A unique identifier for the workflow. Type: String Length Constraints: Fixed length of 19. Pattern: w-([a-z0-9]{17}) Required: No ListedWorkflow 445 AWS Transfer Family See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 446 AWS Transfer Family API Reference LoggingConfiguration Consists of the logging role and the log group name. Contents LoggingRole The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows a server to turn on Amazon CloudWatch logging for Amazon S3 or Amazon EFS events. When set, you can view user activity in your CloudWatch logs. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: No LogGroupName The name of the CloudWatch logging group for the AWS Transfer Family server to which this workflow belongs. Type: String Length Constraints: Minimum length of 1. Maximum length of 512. Pattern: [\.\-_/#A-Za-z0-9]* Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 LoggingConfiguration 447 AWS Transfer Family API Reference See Also 448 AWS Transfer Family PosixProfile API Reference The full POSIX identity, including user ID (Uid), group ID (Gid), and any secondary groups IDs (SecondaryGids), that controls your users' access to your Amazon EFS file systems. The POSIX permissions that are set on files and directories in your file system determine the level of access your users get when transferring files into and out of your Amazon EFS file systems. Contents Gid The POSIX group ID used for all EFS operations by this user. Type: Long Valid Range: Minimum value of 0. Maximum value of 4294967295. Required: Yes Uid The POSIX user ID used for all EFS operations by this user. Type: Long Valid Range: Minimum value of 0. Maximum value of 4294967295. Required: Yes SecondaryGids The secondary POSIX group IDs used for all EFS operations by this user. Type: Array of longs Array Members: Minimum number of 0 items. Maximum number of 16 items. Valid Range: Minimum value of 0. Maximum value of 4294967295. Required: No PosixProfile 449 AWS Transfer Family See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 450 AWS Transfer Family ProtocolDetails The protocol settings that are configured for your server. API Reference Contents As2Transports Indicates the transport method for the AS2 messages. Currently, only HTTP is supported. Type: Array of strings Array Members: Fixed number of 1 item. Valid Values: HTTP Required: No PassiveIp Indicates passive mode, for FTP and FTPS protocols. Enter a single IPv4 address, such as the public IP address of a firewall, router, or load balancer. For example: aws transfer update-server --protocol-details PassiveIp=0.0.0.0 Replace 0.0.0.0 in the example above with the actual IP address you want to use. Note If you change the PassiveIp value, you must stop and then restart your Transfer Family server for the change to take effect. For details on using passive mode (PASV) in a NAT environment, see Configuring your FTPS server behind a firewall or NAT with AWS Transfer Family. Special values The AUTO and 0.0.0.0 are special values for the PassiveIp parameter. The value PassiveIp=AUTO is assigned by default to FTP and FTPS type servers. In this case, the server automatically responds with one of the endpoint IPs within the PASV response. PassiveIp=0.0.0.0 has a more unique application for its usage. For example, if you have a
transferfamily-api-090
transferfamily-api.pdf
90
value, you must stop and then restart your Transfer Family server for the change to take effect. For details on using passive mode (PASV) in a NAT environment, see Configuring your FTPS server behind a firewall or NAT with AWS Transfer Family. Special values The AUTO and 0.0.0.0 are special values for the PassiveIp parameter. The value PassiveIp=AUTO is assigned by default to FTP and FTPS type servers. In this case, the server automatically responds with one of the endpoint IPs within the PASV response. PassiveIp=0.0.0.0 has a more unique application for its usage. For example, if you have a High Availability (HA) Network Load Balancer (NLB) environment, where you have 3 subnets, ProtocolDetails 451 AWS Transfer Family API Reference you can only specify a single IP address using the PassiveIp parameter. This reduces the effectiveness of having High Availability. In this case, you can specify PassiveIp=0.0.0.0. This tells the client to use the same IP address as the Control connection and utilize all AZs for their connections. Note, however, that not all FTP clients support the PassiveIp=0.0.0.0 response. FileZilla and WinSCP do support it. If you are using other clients, check to see if your client supports the PassiveIp=0.0.0.0 response. Type: String Length Constraints: Minimum length of 0. Maximum length of 15. Required: No SetStatOption Use the SetStatOption to ignore the error that is generated when the client attempts to use SETSTAT on a file you are uploading to an S3 bucket. Some SFTP file transfer clients can attempt to change the attributes of remote files, including timestamp and permissions, using commands, such as SETSTAT when uploading the file. However, these commands are not compatible with object storage systems, such as Amazon S3. Due to this incompatibility, file uploads from these clients can result in errors even when the file is otherwise successfully uploaded. Set the value to ENABLE_NO_OP to have the Transfer Family server ignore the SETSTAT command, and upload files without needing to make any changes to your SFTP client. While the SetStatOption ENABLE_NO_OP setting ignores the error, it does generate a log entry in Amazon CloudWatch Logs, so you can determine when the client is making a SETSTAT call. Note If you want to preserve the original timestamp for your file, and modify other file attributes using SETSTAT, you can use Amazon EFS as backend storage with Transfer Family. Type: String Valid Values: DEFAULT | ENABLE_NO_OP Required: No Contents 452 AWS Transfer Family TlsSessionResumptionMode API Reference A property used with Transfer Family servers that use the FTPS protocol. TLS Session Resumption provides a mechanism to resume or share a negotiated secret key between the control and data connection for an FTPS session. TlsSessionResumptionMode determines whether or not the server resumes recent, negotiated sessions through a unique session ID. This property is available during CreateServer and UpdateServer calls. If a TlsSessionResumptionMode value is not specified during CreateServer, it is set to ENFORCED by default. • DISABLED: the server does not process TLS session resumption client requests and creates a new TLS session for each request. • ENABLED: the server processes and accepts clients that are performing TLS session resumption. The server doesn't reject client data connections that do not perform the TLS session resumption client processing. • ENFORCED: the server processes and accepts clients that are performing TLS session resumption. The server rejects client data connections that do not perform the TLS session resumption client processing. Before you set the value to ENFORCED, test your clients. Note Not all FTPS clients perform TLS session resumption. So, if you choose to enforce TLS session resumption, you prevent any connections from FTPS clients that don't perform the protocol negotiation. To determine whether or not you can use the ENFORCED value, you need to test your clients. Type: String Valid Values: DISABLED | ENABLED | ENFORCED Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ See Also 453 AWS Transfer Family • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also 454 AWS Transfer Family S3FileLocation API Reference Specifies the details for the file location for the file that's being used in the workflow. Only applicable if you are using S3 storage. Contents Bucket Specifies the S3 bucket that contains the file being used. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: [a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9] Required: No Etag The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. Type: String Length Constraints: Minimum length of 1. Maximum length of 65536. Pattern: .+ Required: No Key The name assigned to the file when it was created in Amazon S3. You use the
transferfamily-api-091
transferfamily-api.pdf
91
file that's being used in the workflow. Only applicable if you are using S3 storage. Contents Bucket Specifies the S3 bucket that contains the file being used. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: [a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9] Required: No Etag The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. Type: String Length Constraints: Minimum length of 1. Maximum length of 65536. Pattern: .+ Required: No Key The name assigned to the file when it was created in Amazon S3. You use the object key to retrieve the object. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Pattern: [\P{M}\p{M}]* Required: No S3FileLocation 455 AWS Transfer Family VersionId Specifies the file version. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. API Reference Pattern: .+ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 456 AWS Transfer Family API Reference S3InputFileLocation Specifies the customer input Amazon S3 file location. If it is used inside copyStepDetails.DestinationFileLocation, it should be the S3 copy destination. You need to provide the bucket and key. The key can represent either a path or a file. This is determined by whether or not you end the key value with the forward slash (/) character. If the final character is "/", then your file is copied to the folder, and its name does not change. If, rather, the final character is alphanumeric, your uploaded file is renamed to the path value. In this case, if a file with that name already exists, it is overwritten. For example, if your path is shared-files/bob/, your uploaded files are copied to the shared- files/bob/, folder. If your path is shared-files/today, each uploaded file is copied to the shared-files folder and named today: each upload overwrites the previous version of the bob file. Contents Bucket Specifies the S3 bucket for the customer input file. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: [a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9] Required: No Key The name assigned to the file when it was created in Amazon S3. You use the object key to retrieve the object. Type: String Length Constraints: Minimum length of 0. Maximum length of 1024. Pattern: [\P{M}\p{M}]* Required: No S3InputFileLocation 457 AWS Transfer Family See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 458 AWS Transfer Family S3StorageOptions API Reference The Amazon S3 storage options that are configured for your server. Contents DirectoryListingOptimization Specifies whether or not performance for your Amazon S3 directories is optimized. This is disabled by default. By default, home directory mappings have a TYPE of DIRECTORY. If you enable this option, you would then need to explicitly set the HomeDirectoryMapEntry Type to FILE if you want a mapping to have a file target. Type: String Valid Values: ENABLED | DISABLED Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 S3StorageOptions 459 AWS Transfer Family S3Tag API Reference Specifies the key-value pair that are assigned to a file during the execution of a Tagging step. Contents Key The name assigned to the tag that you create. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: ([\p{L}\p{Z}\p{N}_.:/=+\-@]*) Required: Yes Value The value that corresponds to the key. Type: String Length Constraints: Minimum length of 0. Maximum length of 256. Pattern: ([\p{L}\p{Z}\p{N}_.:/=+\-@]*) Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 S3Tag 460 AWS Transfer Family ServiceMetadata API Reference A container object for the session details that are associated with a workflow. Contents UserDetails The Server ID (ServerId), Session ID (SessionId) and user (UserName) make up the UserDetails. Type: UserDetails object Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 ServiceMetadata 461 AWS Transfer Family API Reference SftpConnectorConfig Contains the details for an SFTP connector object. The connector object is used for transferring files to and from a partner's SFTP server. Contents MaxConcurrentConnections Specify
transferfamily-api-092
transferfamily-api.pdf
92
the session details that are associated with a workflow. Contents UserDetails The Server ID (ServerId), Session ID (SessionId) and user (UserName) make up the UserDetails. Type: UserDetails object Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 ServiceMetadata 461 AWS Transfer Family API Reference SftpConnectorConfig Contains the details for an SFTP connector object. The connector object is used for transferring files to and from a partner's SFTP server. Contents MaxConcurrentConnections Specify the number of concurrent connections that your connector creates to the remote server. The default value is 5 (this is also the maximum value allowed). This parameter specifies the number of active connections that your connector can establish with the remote server at the same time. Increasing this value can enhance connector performance when transferring large file batches by enabling parallel operations. Type: Integer Valid Range: Minimum value of 1. Required: No TrustedHostKeys The public portion of the host key, or keys, that are used to identify the external server to which you are connecting. You can use the ssh-keyscan command against the SFTP server to retrieve the necessary key. Note TrustedHostKeys is optional for CreateConnector. If not provided, you can use TestConnection to retrieve the server host key during the initial connection attempt, and subsequently update the connector with the observed host key. The three standard SSH public key format elements are <key type>, <body base64>, and an optional <comment>, with spaces between each element. Specify only the <key type> and <body base64>: do not enter the <comment> portion of the key. For the trusted host key, AWS Transfer Family accepts RSA and ECDSA keys. SftpConnectorConfig 462 AWS Transfer Family API Reference • For RSA keys, the <key type> string is ssh-rsa. • For ECDSA keys, the <key type> string is either ecdsa-sha2-nistp256, ecdsa-sha2- nistp384, or ecdsa-sha2-nistp521, depending on the size of the key you generated. Run this command to retrieve the SFTP server host key, where your SFTP server name is ftp.host.com. ssh-keyscan ftp.host.com This prints the public host key to standard output. ftp.host.com ssh-rsa AAAAB3Nza...<long-string-for-public-key Copy and paste this string into the TrustedHostKeys field for the create-connector command or into the Trusted host keys field in the console. Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 10 items. Length Constraints: Minimum length of 1. Maximum length of 2048. Required: No UserSecretId The identifier for the secret (in AWS Secrets Manager) that contains the SFTP user's private key, password, or both. The identifier must be the Amazon Resource Name (ARN) of the secret. Note • Required when creating an SFTP connector • Optional when updating an existing SFTP connector Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Required: No Contents 463 AWS Transfer Family See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 464 AWS Transfer Family API Reference SftpConnectorConnectionDetails Contains the details for an SFTP connector connection. Contents HostKey The SSH public key of the remote SFTP server. This is returned during the initial connection attempt when you call TestConnection. It allows you to retrieve the valid server host key to update the connector when you are unable to obtain it in advance. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 SftpConnectorConnectionDetails 465 AWS Transfer Family SshPublicKey API Reference Provides information about the public Secure Shell (SSH) key that is associated with a Transfer Family user for the specific file transfer protocol-enabled server (as identified by ServerId). The information returned includes the date the key was imported, the public key contents, and the public key ID. A user can store more than one SSH public key associated with their user name on a specific server. Contents DateImported Specifies the date that the public key was added to the Transfer Family user. Type: Timestamp Required: Yes SshPublicKeyBody Specifies the content of the SSH public key as specified by the PublicKeyId. AWS Transfer Family accepts RSA, ECDSA, and ED25519 keys. Type: String Length Constraints: Minimum length of 0. Maximum length of 2048. Pattern: \s*(ssh|ecdsa)-[a-z0-9-]+[ \t]+(([A-Za-z0-9+/]{4})*([A-Za-z0-9+/] {1,3})?(={0,3})?)(\s*|[ \t]+[\S \t]*\s*) Required: Yes SshPublicKeyId Specifies the SshPublicKeyId parameter contains the identifier of the public key. Type: String Length Constraints: Fixed length of 21. Pattern: key-[0-9a-f]{17} Required: Yes SshPublicKey 466
transferfamily-api-093
transferfamily-api.pdf
93
public key associated with their user name on a specific server. Contents DateImported Specifies the date that the public key was added to the Transfer Family user. Type: Timestamp Required: Yes SshPublicKeyBody Specifies the content of the SSH public key as specified by the PublicKeyId. AWS Transfer Family accepts RSA, ECDSA, and ED25519 keys. Type: String Length Constraints: Minimum length of 0. Maximum length of 2048. Pattern: \s*(ssh|ecdsa)-[a-z0-9-]+[ \t]+(([A-Za-z0-9+/]{4})*([A-Za-z0-9+/] {1,3})?(={0,3})?)(\s*|[ \t]+[\S \t]*\s*) Required: Yes SshPublicKeyId Specifies the SshPublicKeyId parameter contains the identifier of the public key. Type: String Length Constraints: Fixed length of 21. Pattern: key-[0-9a-f]{17} Required: Yes SshPublicKey 466 AWS Transfer Family See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 467 AWS Transfer Family Tag API Reference Creates a key-value pair for a specific resource. Tags are metadata that you can use to search for and group a resource for various purposes. You can apply tags to servers, users, and roles. A tag key can take more than one value. For example, to group servers for accounting purposes, you might create a tag called Group and assign the values Research and Accounting to that group. Contents Key The name assigned to the tag that you create. Type: String Length Constraints: Minimum length of 0. Maximum length of 128. Required: Yes Value Contains one or more values that you assigned to the key name you create. Type: String Length Constraints: Minimum length of 0. Maximum length of 256. Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Tag 468 AWS Transfer Family TagStepDetails API Reference Each step type has its own StepDetails structure. The key/value pairs used to tag a file during the execution of a workflow step. Contents Name The name of the step, used as an identifier. Type: String Length Constraints: Minimum length of 0. Maximum length of 30. Pattern: [\w-]* Required: No SourceFileLocation Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow. • To use the previous file as the input, enter ${previous.file}. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value. • To use the originally uploaded file location as input for this step, enter ${original.file}. Type: String Length Constraints: Minimum length of 0. Maximum length of 256. Pattern: \$\{(\w+.)+\w+\} Required: No Tags Array that contains from 1 to 10 key/value pairs. Type: Array of S3Tag objects Array Members: Minimum number of 1 item. Maximum number of 10 items. TagStepDetails 469 AWS Transfer Family Required: No See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 470 AWS Transfer Family API Reference UpdateWebAppIdentityCenterConfig A structure that describes the values to use for the IAM Identity Center settings when you update a web app. Contents Role The IAM role used to access IAM Identity Center. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 UpdateWebAppIdentityCenterConfig 471 AWS Transfer Family API Reference UpdateWebAppIdentityProviderDetails A union that contains the UpdateWebAppIdentityCenterConfig object. Contents Important This data type is a UNION, so only one of the following members can be specified when used or returned. IdentityCenterConfig A structure that describes the values to use for the IAM Identity Center settings when you update a web app. Type: UpdateWebAppIdentityCenterConfig object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 UpdateWebAppIdentityProviderDetails 472 AWS Transfer Family UserDetails API Reference Specifies the user name, server ID, and session ID for a workflow. Contents ServerId The system-assigned unique identifier for a Transfer server instance. Type: String Length Constraints: Fixed length of 19. Pattern: s-([0-9a-f]{17}) Required: Yes UserName A unique string that identifies a Transfer Family user associated with a server. Type: String Length Constraints: Minimum length of 3. Maximum length of 100. Pattern: [\w][\[email protected]]{2,99} Required: Yes SessionId The system-assigned unique identifier for a
transferfamily-api-094
transferfamily-api.pdf
94
see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 UpdateWebAppIdentityProviderDetails 472 AWS Transfer Family UserDetails API Reference Specifies the user name, server ID, and session ID for a workflow. Contents ServerId The system-assigned unique identifier for a Transfer server instance. Type: String Length Constraints: Fixed length of 19. Pattern: s-([0-9a-f]{17}) Required: Yes UserName A unique string that identifies a Transfer Family user associated with a server. Type: String Length Constraints: Minimum length of 3. Maximum length of 100. Pattern: [\w][\[email protected]]{2,99} Required: Yes SessionId The system-assigned unique identifier for a session that corresponds to the workflow. Type: String Length Constraints: Minimum length of 3. Maximum length of 32. Pattern: [\w-]* Required: No UserDetails 473 AWS Transfer Family See Also API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 474 AWS Transfer Family API Reference WebAppIdentityProviderDetails A union that contains the IdentityCenterConfig object. Contents Important This data type is a UNION, so only one of the following members can be specified when used or returned. IdentityCenterConfig A structure that describes the values to use for the IAM Identity Center settings when you create a web app. Type: IdentityCenterConfig object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 WebAppIdentityProviderDetails 475 AWS Transfer Family WebAppUnits API Reference Contains an integer value that represents the value for number of concurrent connections or the user sessions on your web app. Contents Important This data type is a UNION, so only one of the following members can be specified when used or returned. Provisioned An integer that represents the number of units for your desired number of concurrent connections, or the number of user sessions on your web app at the same time. Each increment allows an additional 250 concurrent sessions: a value of 1 sets the number of concurrent sessions to 250; 2 sets a value of 500, and so on. Type: Integer Valid Range: Minimum value of 1. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 WebAppUnits 476 AWS Transfer Family WorkflowDetail API Reference Specifies the workflow ID for the workflow to assign and the execution role that's used for executing the workflow. In addition to a workflow to execute when a file is uploaded completely, WorkflowDetails can also contain a workflow ID (and execution role) for a workflow to execute on partial upload. A partial upload occurs when the server session disconnects while the file is still being uploaded. Contents ExecutionRole Includes the necessary permissions for S3, EFS, and Lambda operations that Transfer can assume, so that all workflow steps can operate on the required resources Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: arn:.*role/\S+ Required: Yes WorkflowId A unique identifier for the workflow. Type: String Length Constraints: Fixed length of 19. Pattern: w-([a-z0-9]{17}) Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ WorkflowDetail 477 AWS Transfer Family • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also 478 AWS Transfer Family WorkflowDetails API Reference Container for the WorkflowDetail data type. It is used by actions that trigger a workflow to begin execution. Contents OnPartialUpload A trigger that starts a workflow if a file is only partially uploaded. You can attach a workflow to a server that executes whenever there is a partial upload. A partial upload occurs when a file is open when the session disconnects. Note OnPartialUpload can contain a maximum of one WorkflowDetail object. Type: Array of WorkflowDetail objects Array Members: Minimum number of 0 items. Maximum number of 1 item. Required: No OnUpload A trigger that starts a workflow: the workflow begins to execute after a file is uploaded. To remove an associated workflow from a server, you can provide an empty OnUpload object, as in the following example. aws transfer update-server --server-id s-01234567890abcdef --workflow- details '{"OnUpload":[]}' Note OnUpload can contain a maximum of one WorkflowDetail object. Type: Array of WorkflowDetail objects WorkflowDetails 479 AWS Transfer Family API Reference Array Members: Minimum number of 0 items. Maximum number of 1 item. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following:
transferfamily-api-095
transferfamily-api.pdf
95
OnUpload A trigger that starts a workflow: the workflow begins to execute after a file is uploaded. To remove an associated workflow from a server, you can provide an empty OnUpload object, as in the following example. aws transfer update-server --server-id s-01234567890abcdef --workflow- details '{"OnUpload":[]}' Note OnUpload can contain a maximum of one WorkflowDetail object. Type: Array of WorkflowDetail objects WorkflowDetails 479 AWS Transfer Family API Reference Array Members: Minimum number of 0 items. Maximum number of 1 item. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 480 API Reference AWS Transfer Family WorkflowStep The basic building block of a workflow. Contents CopyStepDetails Details for a step that performs a file copy. Consists of the following values: • A description • An Amazon S3 location for the destination of the file copy. • A flag that indicates whether to overwrite an existing file of the same name. The default is FALSE. Type: CopyStepDetails object Required: No CustomStepDetails Details for a step that invokes an AWS Lambda function. Consists of the Lambda function's name, target, and timeout (in seconds). Type: CustomStepDetails object Required: No DecryptStepDetails Details for a step that decrypts an encrypted file. Consists of the following values: • A descriptive name • An Amazon S3 or Amazon Elastic File System (Amazon EFS) location for the source file to decrypt. • An S3 or Amazon EFS location for the destination of the file decryption. • A flag that indicates whether to overwrite an existing file of the same name. The default is FALSE. WorkflowStep 481 AWS Transfer Family API Reference • The type of encryption that's used. Currently, only PGP encryption is supported. Type: DecryptStepDetails object Required: No DeleteStepDetails Details for a step that deletes the file. Type: DeleteStepDetails object Required: No TagStepDetails Details for a step that creates one or more tags. You specify one or more tags. Each tag contains a key-value pair. Type: TagStepDetails object Required: No Type Currently, the following step types are supported. • COPY - Copy the file to another location. • CUSTOM - Perform a custom step with an AWS Lambda function target. • DECRYPT - Decrypt a file that was encrypted before it was uploaded. • DELETE - Delete the file. • TAG - Add a tag to the file. Type: String Valid Values: COPY | CUSTOM | TAG | DELETE | DECRYPT Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: See Also 482 AWS Transfer Family • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference See Also 483 AWS Transfer Family API Reference Making API requests In addition to using the console, you can use the AWS Transfer Family API to programmatically configure and manage your servers. This section describes the AWS Transfer Family operations, request signing for authentication and the error handling. For information about the regions and endpoints available for Transfer Family, see AWS Transfer Family endpoints and quotas in the AWS General Reference Note You can also use the AWS SDKs when developing applications with Transfer Family;. The AWS SDKs for Java, .NET, and PHP wrap the underlying Transfer Family API, simplifying your programming tasks. For information about downloading the SDK libraries, see Sample code libraries. Topics • Transfer Family required request headers • Transfer Family request inputs and signing • Error responses • Available libraries Transfer Family required request headers This section describes the required headers that you must send with every POST request to AWS Transfer Family. You include HTTP headers to identify key information about the request including the operation you want to invoke, the date of the request, and information that indicates the authorization of you as the sender of the request. Headers are case insensitive and the order of the headers is not important. The following example shows headers that are used in the ListServers operation. POST / HTTP/1.1 Host: transfer.us-east-1.amazonaws.com x-amz-target: TransferService.ListServers x-amz-date: 20220507T012034Z Transfer Family required request headers 484 AWS Transfer Family API Reference Authorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20220507/us-east-1/transfer/ aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=13550350a8681c84c861aac2e5b440161c2b33a3e4f302ac680ca5b686de48de Content-Type: application/x-amz-json-1.1 Content-Length: 17 {"MaxResults":10} The following are the headers that must include with your POST requests to Transfer Family. Headers shown below that begin with "x-amz" are specific for AWS. All other headers listed are common header used in HTTP transactions. Transfer Family request inputs and signing All request inputs must be sent as part of JSON payload in request body. For Actions in which all request fields are optional, for example ListServers, you still need to provide an empty JSON object in the request
transferfamily-api-096
transferfamily-api.pdf
96
request headers 484 AWS Transfer Family API Reference Authorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20220507/us-east-1/transfer/ aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=13550350a8681c84c861aac2e5b440161c2b33a3e4f302ac680ca5b686de48de Content-Type: application/x-amz-json-1.1 Content-Length: 17 {"MaxResults":10} The following are the headers that must include with your POST requests to Transfer Family. Headers shown below that begin with "x-amz" are specific for AWS. All other headers listed are common header used in HTTP transactions. Transfer Family request inputs and signing All request inputs must be sent as part of JSON payload in request body. For Actions in which all request fields are optional, for example ListServers, you still need to provide an empty JSON object in the request body, such as {}. The structure of Transfer Family payload request/response is documented in existing the API reference, for example DescribeServer. Transfer Family supports authentication using AWS Signature Version 4. For details, see Signing AWS API requests. Error responses When there is an error, the response header information contains: • Content-Type: application/x-amz-json-1.1 • An appropriate 4xx or 5xx HTTP status code The body of an error response contains information about the error that occurred. The following sample error response shows the output syntax of response elements common to all error responses. { "__type": "String", "Message": "String", <!-- Message is lowercase in some instances --> "Resource": String, "ResourceType": String Transfer Family request inputs and signing 485 AWS Transfer Family API Reference "RetryAfterSeconds": String } The following table explains the JSON error response fields shown in the preceding syntax. __type One of the exceptions from a Transfer Family API call. Type: String Message or message One of the operation error code messages. Note Some exceptions use message, and others use Message. You can check the code for your interface to determine the proper case. Alternatively, you can test each option to see which works. Type: String Resource The resource for which the error is invoked. For example, if you try to create a user that already exists, the Resource is the username for the existing user. Type: String ResourceType The resource type for which the error is invoked. For example, if you try to create a user that already exists, the ResourceType is User. Type: String RetryAfterSeconds The number of seconds to wait before retrying the command. Type: String Error responses 486 AWS Transfer Family API Reference Error response examples The following JSON body is returned if you call the DescribeServer API and specify a server that does not exist. { "__type": "ResourceNotFoundException", "Message": "Unknown server", "Resource": "s-11112222333344444", "ResourceType": "Server" } The following JSON body is returned if executing an API causes throttling to occur. { "__type":"ThrottlingException", "RetryAfterSeconds":"1" } The following JSON body is returned if you use the CreateServer API and you do not have sufficient permissions to create a Transfer Family server. { "__type": "AccessDeniedException", "Message": "You do not have sufficient access to perform this action." } The following JSON body is returned if you use the CreateUser API and specify a user that already exists. { "__type": "ResourceExistsException", "Message": "User already exists", "Resource": "Alejandro-Rosalez", "ResourceType": "User" } Error response examples 487 AWS Transfer Family Available libraries API Reference AWS provides libraries, sample code, tutorials, and other resources for software developers who prefer to build applications using language-specific APIs instead of the command-line tools and Query API. These libraries provide basic functions (not included in the APIs), such as request authentication, request retries, and error handling so that it is easier to get started. See Tools to build on AWS For libraries and sample code in all languages, see Sample code & libraries. Available libraries 488 AWS Transfer Family API Reference Common Parameters The following list contains the parameters that all actions use for signing Signature Version 4 requests with a query string. Any action-specific parameters are listed in the topic for that action. For more information about Signature Version 4, see Signing AWS API requests in the IAM User Guide. Action The action to be performed. Type: string Required: Yes Version The API version that the request is written for, expressed in the format YYYY-MM-DD. Type: string Required: Yes X-Amz-Algorithm The hash algorithm that you used to create the request signature. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Valid Values: AWS4-HMAC-SHA256 Required: Conditional X-Amz-Credential The credential scope value, which is a string that includes your access key, the date, the region you are targeting, the service you are requesting, and a termination string ("aws4_request"). The value is expressed in the following format: access_key/YYYYMMDD/region/service/ aws4_request. 489 AWS Transfer Family API Reference For more information, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional X-Amz-Date The date that is
transferfamily-api-097
transferfamily-api.pdf
97
authorization header. Type: string Valid Values: AWS4-HMAC-SHA256 Required: Conditional X-Amz-Credential The credential scope value, which is a string that includes your access key, the date, the region you are targeting, the service you are requesting, and a termination string ("aws4_request"). The value is expressed in the following format: access_key/YYYYMMDD/region/service/ aws4_request. 489 AWS Transfer Family API Reference For more information, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional X-Amz-Date The date that is used to create the signature. The format must be ISO 8601 basic format (YYYYMMDD'T'HHMMSS'Z'). For example, the following date time is a valid X-Amz-Date value: 20120325T120000Z. Condition: X-Amz-Date is optional for all requests; it can be used to override the date used for signing requests. If the Date header is specified in the ISO 8601 basic format, X-Amz-Date is not required. When X-Amz-Date is used, it always overrides the value of the Date header. For more information, see Elements of an AWS API request signature in the IAM User Guide. Type: string Required: Conditional X-Amz-Security-Token The temporary security token that was obtained through a call to AWS Security Token Service (AWS STS). For a list of services that support temporary security credentials from AWS STS, see AWS services that work with IAM in the IAM User Guide. Condition: If you're using temporary security credentials from AWS STS, you must include the security token. Type: string Required: Conditional X-Amz-Signature Specifies the hex-encoded signature that was calculated from the string to sign and the derived signing key. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. 490 AWS Transfer Family Type: string Required: Conditional X-Amz-SignedHeaders API Reference Specifies all the HTTP headers that were included as part of the canonical request. For more information about specifying signed headers, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional 491 AWS Transfer Family API Reference Common Errors This section lists the errors common to the API actions of all AWS services. For errors specific to an API action for this service, see the topic for that API action. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 400 IncompleteSignature The request signature does not conform to AWS standards. HTTP Status Code: 400 InternalFailure The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 InvalidAction The action or operation requested is invalid. Verify that the action is typed correctly. HTTP Status Code: 400 InvalidClientTokenId The X.509 certificate or AWS access key ID provided does not exist in our records. HTTP Status Code: 403 NotAuthorized You do not have permission to perform this action. HTTP Status Code: 400 OptInRequired The AWS access key ID needs a subscription for the service. HTTP Status Code: 403 492 AWS Transfer Family RequestExpired API Reference The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date (such as for pre-signed URLs), or the date stamp on the request is more than 15 minutes in the future. HTTP Status Code: 400 ServiceUnavailable The request has failed due to a temporary failure of the server. HTTP Status Code: 503 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 400 ValidationError The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 493
transferfamily-ug-001
transferfamily-ug.pdf
1
User Guide AWS Transfer Family Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. AWS Transfer Family User Guide AWS Transfer Family: User Guide Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. AWS Transfer Family Table of Contents User Guide What is AWS Transfer Family? ........................................................................................................ 1 How AWS Transfer Family works .............................................................................................................. 4 Blog posts relevant for Transfer Family .................................................................................................. 5 Prerequisites ..................................................................................................................................... 8 Regions, endpoints and quotas ................................................................................................................. 8 Sign up for AWS ........................................................................................................................................... 8 Configure storage ......................................................................................................................................... 9 Configure an Amazon S3 bucket ....................................................................................................... 10 Configure an Amazon EFS file system ............................................................................................. 14 Create an IAM role and policy ................................................................................................................. 18 Create a user role ................................................................................................................................. 19 How session policies work .................................................................................................................. 22 Example read/write access policy ..................................................................................................... 25 Transfer Family tutorials ............................................................................................................... 29 Get started with server endpoints ......................................................................................................... 30 Prerequisites ........................................................................................................................................... 30 Step 1: Sign in to the AWS Transfer Family console ..................................................................... 31 Step 2: Create an SFTP-enabled server ........................................................................................... 31 Step 3: Add a service managed user ................................................................................................ 32 Step 4: Transfer a file using a client ................................................................................................ 33 Create a decryption Workflow ................................................................................................................ 35 Step 1: Configure an execution role ................................................................................................. 36 Step 2: Create a managed workflow ................................................................................................ 37 Step 3: Add the workflow to a server and create a user .............................................................. 38 Step 4: Create a PGP key pair ............................................................................................................ 40 Step 5: Store the PGP private key in AWS Secrets Manager ....................................................... 41 Step 6: Encrypt a file ........................................................................................................................... 42 Step 7: Run the workflow and view the results ............................................................................. 42 Create and use SFTP connectors ............................................................................................................ 43 Step 1: Create the necessary supporting resources ....................................................................... 44 Step 2: Create and test an SFTP connector .................................................................................... 49 Step 3: Send and retrieve files using the SFTP connector ........................................................... 53 Procedures to create a Transfer Family server to use as your remote SFTP server .................. 56 Use a custom identity provider ............................................................................................................... 59 iii AWS Transfer Family User Guide Prerequisites ........................................................................................................................................... 59 Step 1: Create a CloudFormation stack ........................................................................................... 60 Step 2: Check the API Gateway method configuration for your server ..................................... 61 Step 3: View the Transfer Family server details ............................................................................. 61 Step 4: Test that your user can connect to the server .................................................................. 63 Step 5: Test the SFTP connection and file transfer ....................................................................... 63 Step 6: Limit access to the bucket .................................................................................................... 64 Update Lambda if using Amazon EFS .............................................................................................. 66 Set up an AS2 configuration ................................................................................................................... 67 Step 1: Create certificates for AS2 .................................................................................................... 69 Step 3: Import certificates as Transfer Family certificate resources ........................................... 72 Step 3: Create profiles for you and your trading partner ............................................................ 74 Step 4: Create a Transfer Family server that uses the AS2 protocol .......................................... 74 Step 5: Create an agreement between you and your partner ..................................................... 78 Step 6: Create a connector between you and your partner ......................................................... 79 Step 7: Test exchanging files over AS2 by using Transfer Family ............................................... 80 Set up a web app ....................................................................................................................................... 82 Prerequisites ........................................................................................................................................... 83 Step 1: Create the necessary supporting resources ....................................................................... 83 Step 2: Create a Transfer Family web app ...................................................................................... 84 Step 3: Configure Cross-origin resource sharing (CORS) for your bucket .................................. 85 Step 4: Add a user to your Transfer Family web app .................................................................... 86 Step 5: Register a location in Amazon S3 and create an access grant ....................................... 87 Step 6: Access your Transfer Family web app as a user ................................................................ 89 Integrate Okta as your identity provider for web apps ................................................................ 91 Transfer Family for SFTP, FTPS, FTP ............................................................................................ 95 Identity provider options .......................................................................................................................... 95 AWS Transfer Family endpoint type matrix .......................................................................................... 97 Configure a Transfer Family server endpoint .................................................................................... 101 Create an SFTP-enabled server ....................................................................................................... 103 Create an FTPS-enabled server ....................................................................................................... 111 Create an FTP-enabled server ......................................................................................................... 119 Create a server in a VPC ................................................................................................................... 127 Working with custom hostnames ................................................................................................... 148 Transfer files over server endpoint ...................................................................................................... 151 Available SFTP/FTPS/FTP Commands ........................................................................................... 154 iv AWS Transfer Family User Guide Find your Amazon VPC endpoint .................................................................................................... 155 Avoid setstat errors ....................................................................................................................... 157 Use OpenSSH ......................................................................................................................................... 34 Use WinSCP ......................................................................................................................................... 159 Use Cyberduck ....................................................................................................................................... 34 Use FileZilla .......................................................................................................................................... 162 Use a Perl client .................................................................................................................................. 163 Use LFTP ............................................................................................................................................... 164 Post upload processing ..................................................................................................................... 164 SFTP messages .................................................................................................................................... 165 Manage users ............................................................................................................................................ 167 Amazon EFS vs. Amazon S3 ............................................................................................................. 168 Logical directories .............................................................................................................................. 168 Enhanced HomeDirectory for logical directories .........................................................................
transferfamily-ug-002
transferfamily-ug.pdf
2
Create a server in a VPC ................................................................................................................... 127 Working with custom hostnames ................................................................................................... 148 Transfer files over server endpoint ...................................................................................................... 151 Available SFTP/FTPS/FTP Commands ........................................................................................... 154 iv AWS Transfer Family User Guide Find your Amazon VPC endpoint .................................................................................................... 155 Avoid setstat errors ....................................................................................................................... 157 Use OpenSSH ......................................................................................................................................... 34 Use WinSCP ......................................................................................................................................... 159 Use Cyberduck ....................................................................................................................................... 34 Use FileZilla .......................................................................................................................................... 162 Use a Perl client .................................................................................................................................. 163 Use LFTP ............................................................................................................................................... 164 Post upload processing ..................................................................................................................... 164 SFTP messages .................................................................................................................................... 165 Manage users ............................................................................................................................................ 167 Amazon EFS vs. Amazon S3 ............................................................................................................. 168 Logical directories .............................................................................................................................. 168 Enhanced HomeDirectory for logical directories ......................................................................... 168 Active Directory group quotas ......................................................................................................... 170 Service-managed users ...................................................................................................................... 170 Custom identity provider .................................................................................................................. 180 Directory service for MS AD ............................................................................................................. 213 Directory service for Entra ID .......................................................................................................... 224 Use logical directories ............................................................................................................................. 231 Rules for using logical directories ................................................................................................... 233 Implementing logical directories and chroot ............................................................................. 234 Configure logical directories example ............................................................................................ 237 Configure logical directories for Amazon EFS .............................................................................. 238 Custom AWS Lambda response ....................................................................................................... 238 Transfer Family web apps ........................................................................................................... 240 AWS Regions for Transfer Family web apps ...................................................................................... 241 Browser compatibility for AWS Transfer Family web apps ............................................................. 241 How to create a Transfer Family web app ......................................................................................... 241 Configure your identity provider .......................................................................................................... 244 Configure IAM roles ................................................................................................................................. 246 Configure a Transfer Family web app ................................................................................................. 248 Create a Transfer Family web app .................................................................................................. 249 Assign or add users or groups to Transfer Family web app ....................................................... 251 Set up Cross-origin resource sharing (CORS) for your bucket ........................................................ 254 Configure Amazon S3 Access Grants ................................................................................................... 256 v AWS Transfer Family User Guide Use a custom URL ................................................................................................................................... 261 Logging for Transfer Family web apps ................................................................................................ 264 Troubleshooting your web apps ........................................................................................................... 264 Troubleshoot network errors ........................................................................................................... 264 Troubleshoot configured bucket not appearing ........................................................................... 265 Troubleshoot custom URL errors .................................................................................................... 265 Troubleshoot miscellaneous errors ................................................................................................. 266 End user instructions .............................................................................................................................. 267 Web app quotas .................................................................................................................................. 267 IAM Identity Center users ................................................................................................................. 268 Third-party end users ........................................................................................................................ 269 Transfer Family end user interface ................................................................................................. 269 Available actions ................................................................................................................................. 270 SFTP connectors .......................................................................................................................... 272 Creating SFTP connectors ...................................................................................................................... 272 Store credentials in Secrets Manager ............................................................................................. 273 Create an SFTP connector ................................................................................................................ 274 Test an SFTP connector .................................................................................................................... 284 Using SFTP connectors ........................................................................................................................... 285 Transfer files ........................................................................................................................................ 286 List contents of remote directories ................................................................................................ 288 Move and delete files on the remote server ................................................................................ 290 Monitoring SFTP connectors ................................................................................................................. 292 Use the connector API to query the status of file transfer requests ........................................ 292 View SFTP connector events in Amazon EventBridge ................................................................ 292 View SFTP connector logs in Amazon CloudWatch .................................................................... 293 Managing SFTP connectors ................................................................................................................... 293 Update SFTP connectors ................................................................................................................... 293 View SFTP connector details ............................................................................................................ 293 Quotas for SFTP connectors ................................................................................................................. 294 Quotas for SFTP connectors ............................................................................................................ 294 Scaling your SFTP connectors ......................................................................................................... 296 Reference architectures using SFTP connectors ................................................................................ 297 Blog posts ............................................................................................................................................ 297 Workshops ............................................................................................................................................ 297 Solutions ............................................................................................................................................... 298 vi AWS Transfer Family User Guide Transfer Family for AS2 .............................................................................................................. 299 AS2 use cases ........................................................................................................................................... 300 AS2 CloudFormation templates ............................................................................................................ 305 Customizing AS2 templates ............................................................................................................. 305 Testing your AS2 deployment ......................................................................................................... 305 Best practices for AS2 template deployment ............................................................................... 306 Configure AS2 ........................................................................................................................................... 307 AS2 configurations ............................................................................................................................. 308 AS2 quotas ........................................................................................................................................... 309 AS2 features and capabilities .......................................................................................................... 314 Manage AS2 certificates ......................................................................................................................... 315 Import AS2 certificates ..................................................................................................................... 316 AS2 certificate rotation ..................................................................................................................... 318 Create AS2 profiles .................................................................................................................................. 319 Create an AS2 server .............................................................................................................................. 320 Create an AS2 server using the Transfer Family console ........................................................... 321 Create an AS2 server using a template ......................................................................................... 324 Create an AS2 agreement ................................................................................................................ 327 Configure AS2 connectors ..................................................................................................................... 329 Create an AS2 connector .................................................................................................................. 330 AS2 connector algorithms ................................................................................................................ 332 Basic authentication for AS2 connectors ...................................................................................... 333 Enable Basic authentication for AS2 connectors ......................................................................... 335 View connector details ...................................................................................................................... 338 Transfer AS2 messages ........................................................................................................................... 341 Receive AS2 messages ....................................................................................................................... 342 Configure HTTPS for AS2 ................................................................................................................. 343 Transfer files with AS2 connectors ................................................................................................. 349 File names and locations .................................................................................................................. 351 Status codes ......................................................................................................................................... 354 Sample JSON files .............................................................................................................................. 355 Custom HTTP Headers for AS2 ............................................................................................................ 357 Template Overview ............................................................................................................................ 357 How It Works ....................................................................................................................................... 358 Key Features ........................................................................................................................................ 358 Implementation Details ..................................................................................................................... 358 vii AWS Transfer Family User Guide Deployment and Usage ..................................................................................................................... 359 Monitor AS2 .............................................................................................................................................. 360 AS2 Status codes ................................................................................................................................ 361 AS2 error codes .................................................................................................................................. 362 Managing file-processing workflows .......................................................................................... 375 Create a workflow ................................................................................................................................... 377 Configure and run a workflow ....................................................................................................... 378 View workflow details ....................................................................................................................... 380 Use predefined steps .............................................................................................................................. 383 Copy file ............................................................................................................................................... 383 Decrypt file .......................................................................................................................................... 388 Tag file .................................................................................................................................................. 394 Delete file ............................................................................................................................................. 395 Named variables for workflows ....................................................................................................... 396 Example tag and delete workflow .................................................................................................. 396 Use custom file-processing steps ......................................................................................................... 401 Using multiple Lambda functions consecutively ......................................................................... 402 Accessing a file after custom processing ....................................................................................... 403 Example events sent to
transferfamily-ug-003
transferfamily-ug.pdf
3
Deployment and Usage ..................................................................................................................... 359 Monitor AS2 .............................................................................................................................................. 360 AS2 Status codes ................................................................................................................................ 361 AS2 error codes .................................................................................................................................. 362 Managing file-processing workflows .......................................................................................... 375 Create a workflow ................................................................................................................................... 377 Configure and run a workflow ....................................................................................................... 378 View workflow details ....................................................................................................................... 380 Use predefined steps .............................................................................................................................. 383 Copy file ............................................................................................................................................... 383 Decrypt file .......................................................................................................................................... 388 Tag file .................................................................................................................................................. 394 Delete file ............................................................................................................................................. 395 Named variables for workflows ....................................................................................................... 396 Example tag and delete workflow .................................................................................................. 396 Use custom file-processing steps ......................................................................................................... 401 Using multiple Lambda functions consecutively ......................................................................... 402 Accessing a file after custom processing ....................................................................................... 403 Example events sent to AWS Lambda upon file upload ............................................................ 404 Example Lambda function for a custom workflow step ............................................................ 405 IAM permissions for a custom step ................................................................................................ 406 IAM policies for workflows .................................................................................................................... 406 Workflow trust relationships ............................................................................................................ 408 Example execution role: Decrypt, copy, and tag .......................................................................... 409 Example execution role: Run function and delete ....................................................................... 411 Exception handling for a workflow ...................................................................................................... 411 Monitor workflow execution ................................................................................................................. 412 CloudWatch logging for a workflow .............................................................................................. 412 CloudWatch metrics for workflows ................................................................................................ 415 Create workflow from template ........................................................................................................... 415 Remove a workflow from a Transfer Family server .......................................................................... 419 Restrictions and limits ............................................................................................................................ 420 Managing servers ........................................................................................................................ 423 View a list of servers .............................................................................................................................. 423 Delete a server ......................................................................................................................................... 423 View SFTP server details ........................................................................................................................ 425 viii AWS Transfer Family User Guide View AS2 server details .......................................................................................................................... 426 Edit server details .................................................................................................................................... 428 Edit the file transfer protocols ........................................................................................................ 430 Edit custom identity provider parameters .................................................................................... 432 Edit the server endpoint ................................................................................................................... 434 Edit logging ......................................................................................................................................... 436 Edit the security policy ...................................................................................................................... 437 Change the managed workflow ...................................................................................................... 438 Change the display banners for your server ................................................................................. 439 Put your server online or offline ..................................................................................................... 439 Manage server host keys ........................................................................................................................ 440 Add an additional server host key .................................................................................................. 441 Delete a server host key ................................................................................................................... 443 Rotate the server host keys ............................................................................................................. 444 Additional server host key information ......................................................................................... 445 Monitor usage within console ............................................................................................................... 446 Managing access controls ........................................................................................................... 453 Creating an S3 bucket access policy .................................................................................................... 454 Creating a session policy ........................................................................................................................ 455 Example session policy ...................................................................................................................... 456 Nested substitutions for session policies ...................................................................................... 458 CloudTrail logging ....................................................................................................................... 460 Enabling CloudTrail logging .................................................................................................................. 461 Example log entry for creating a server ............................................................................................. 462 CloudWatch logging .................................................................................................................... 464 Types of CloudWatch logging for Transfer Family ........................................................................... 464 Creating logging for servers .................................................................................................................. 466 Creating logging for servers ............................................................................................................ 469 Updating logging for a server ......................................................................................................... 469 Viewing the server configuration .................................................................................................... 472 Managing logging for workflows ......................................................................................................... 474 Configuring a role for CloudWatch ...................................................................................................... 477 Viewing Transfer Family log streams ................................................................................................... 479 Creating Amazon CloudWatch alarms ................................................................................................. 483 Logging S3 API calls to S3 access logs ............................................................................................... 484 Examples to limit confused deputy problem ..................................................................................... 484 ix AWS Transfer Family User Guide CloudWatch log structure for Transfer Family .................................................................................. 486 JSON structured logs for Transfer Family ..................................................................................... 486 Legacy logs for Transfer Family ...................................................................................................... 489 Example CloudWatch log entries ......................................................................................................... 492 Example transfer sessions log entries ............................................................................................ 493 Example log entries for SFTP connectors ..................................................................................... 494 Example log entries for Key exchange algorithm failures ......................................................... 496 Using CloudWatch metrics ..................................................................................................................... 497 Transfer Family dimensions .............................................................................................................. 502 User notifications ..................................................................................................................................... 502 CloudWatch queries ................................................................................................................................. 502 Managing events using EventBridge .......................................................................................... 505 Transfer Family events ............................................................................................................................ 506 SFTP, FTPS, and FTP server events ................................................................................................. 506 SFTP connector events ...................................................................................................................... 507 AS2 events ........................................................................................................................................... 508 Sending Transfer Family events ............................................................................................................ 509 Creating event patterns .................................................................................................................... 510 Testing event patterns for Transfer Family events ...................................................................... 511 Permissions ................................................................................................................................................ 511 Additional resources ................................................................................................................................ 512 Events detail reference ........................................................................................................................... 512 Server events ....................................................................................................................................... 513 Connector events ................................................................................................................................ 517 AS2 events ........................................................................................................................................... 524 Security ........................................................................................................................................ 530 Security policies for servers ................................................................................................................... 532 Cryptographic algorithms ................................................................................................................. 533 TransferSecurityPolicy-2024-01 ...................................................................................................... 541 TransferSecurityPolicy-SshAuditCompliant-2025-02 .................................................................. 542 TransferSecurityPolicy-2023-05 ...................................................................................................... 543 TransferSecurityPolicy-2022-03 ...................................................................................................... 544 TransferSecurityPolicy-2020-06 and TransferSecurityPolicy-Restricted-2020-06 ................ 545 TransferSecurityPolicy-2018-11 and TransferSecurityPolicy-Restricted-2018-11 ................ 546 TransferSecurityPolicy-FIPS-2024-01/TransferSecurityPolicy-FIPS-2024-05 ........................ 548 TransferSecurityPolicy-FIPS-2023-05 ............................................................................................. 549 x AWS Transfer Family User Guide TransferSecurityPolicy-FIPS-2020-06 ............................................................................................. 550 Post Quantum security policies ....................................................................................................... 551 Security policies for SFTP connectors ................................................................................................. 556 Post-Quantum security policies ............................................................................................................ 559 About post-quantum hybrid key exchange in SSH ...................................................................... 560 How to use it ....................................................................................................................................... 560 How to test it ...................................................................................................................................... 561 Data protection ........................................................................................................................................ 565 Key management ..................................................................................................................................... 567 Generate SSH keys ............................................................................................................................. 568 Rotate SSH keys .................................................................................................................................. 573 Generate PGP keys ............................................................................................................................. 576 Manage PGP keys ............................................................................................................................... 577 Supported PGP clients ...................................................................................................................... 581 Identity and access management ......................................................................................................... 582 Audience ............................................................................................................................................... 583 Authenticating with identities ......................................................................................................... 584 Managing access using policies ....................................................................................................... 587 How AWS Transfer Family works with IAM ................................................................................... 589 Identity-based policy examples ....................................................................................................... 594 Tag-based policy examples .............................................................................................................. 597 Troubleshooting identity and access .............................................................................................. 600 Compliance validation ............................................................................................................................ 602 Resilience ................................................................................................................................................... 603 Infrastructure security ............................................................................................................................. 604 Web application firewall ......................................................................................................................... 604 Cross-service confused deputy
transferfamily-ug-004
transferfamily-ug.pdf
4
it ...................................................................................................................................... 561 Data protection ........................................................................................................................................ 565 Key management ..................................................................................................................................... 567 Generate SSH keys ............................................................................................................................. 568 Rotate SSH keys .................................................................................................................................. 573 Generate PGP keys ............................................................................................................................. 576 Manage PGP keys ............................................................................................................................... 577 Supported PGP clients ...................................................................................................................... 581 Identity and access management ......................................................................................................... 582 Audience ............................................................................................................................................... 583 Authenticating with identities ......................................................................................................... 584 Managing access using policies ....................................................................................................... 587 How AWS Transfer Family works with IAM ................................................................................... 589 Identity-based policy examples ....................................................................................................... 594 Tag-based policy examples .............................................................................................................. 597 Troubleshooting identity and access .............................................................................................. 600 Compliance validation ............................................................................................................................ 602 Resilience ................................................................................................................................................... 603 Infrastructure security ............................................................................................................................. 604 Web application firewall ......................................................................................................................... 604 Cross-service confused deputy prevention ......................................................................................... 606 Transfer Family user roles ................................................................................................................ 607 Transfer Family workflow roles ....................................................................................................... 609 Transfer Family connector roles ...................................................................................................... 610 Transfer Family logging/invocation roles ...................................................................................... 611 AWS managed policies ........................................................................................................................... 613 AWSTransferConsoleFullAccess ........................................................................................................ 613 AWSTransferFullAccess ...................................................................................................................... 613 AWSTransferLoggingAccess .............................................................................................................. 614 AWSTransferReadOnlyAccess ........................................................................................................... 614 xi AWS Transfer Family User Guide Policy updates ..................................................................................................................................... 614 Terraform module ....................................................................................................................... 615 Troubleshooting Transfer Family ................................................................................................ 616 Authentication issues .............................................................................................................................. 616 Authentication failures—SSH/SFTP .............................................................................................. 617 Managed AD mismatched realms issue ......................................................................................... 617 Active Directory group limits exceeded ......................................................................................... 618 Miscellaneous authentication issues ............................................................................................... 618 Troubleshoot Amazon API Gateway issues ................................................................................... 619 Troubleshoot testing your identity provider ................................................................................. 621 SFTP connectivity issues ........................................................................................................................ 621 Troubleshoot SFTP connectivity issues .......................................................................................... 622 Troubleshoot SFTP client issues ...................................................................................................... 622 Troubleshoot file upload issues ....................................................................................................... 622 Custom identity provider issues ........................................................................................................... 623 Troubleshoot API Gateway integration errors .............................................................................. 624 Troubleshoot Lambda function timeouts ...................................................................................... 625 Troubleshoot consistent Lambda timeout issues ......................................................................... 626 Troubleshoot KeyError exceptions ............................................................................................... 626 Workflow issues ........................................................................................................................................ 627 Troubleshoot managed workflows issues ...................................................................................... 627 Troubleshoot workflow decryption issues ..................................................................................... 630 SFTP connector issues ............................................................................................................................ 633 Troubleshoot adding trusted host keys for your SFTP connector ............................................ 633 Key negotiation fails .......................................................................................................................... 634 SFTP connector throttling ................................................................................................................ 634 Optimizing SFTP connector performance ..................................................................................... 635 Miscellaneous SFTP connector issues ............................................................................................. 636 EFS issues .................................................................................................................................................. 636 Troubleshoot Amazon EFS issues .................................................................................................... 636 Storage and encryption issues .............................................................................................................. 639 Troubleshoot policies for encrypted Amazon S3 buckets .......................................................... 639 Troubleshoot ResourceNotFound exception ............................................................................. 639 Monitoring and alerting issues ............................................................................................................. 640 Troubleshoot missing or incomplete CloudWatch metrics ........................................................ 640 Troubleshoot missing EventBridge events .................................................................................... 641 xii AWS Transfer Family User Guide Cross-region transfer issues ................................................................................................................... 642 Troubleshoot cross-region transfer permission issues ................................................................ 643 Troubleshoot cross-region transfer performance issues ............................................................ 644 WAF integration issues ........................................................................................................................... 645 Troubleshoot WAF blocking legitimate traffic .............................................................................. 645 Troubleshoot WAF integration with custom identity providers ................................................ 646 Service-managed user issues ................................................................................................................. 647 Troubleshoot service-managed users ............................................................................................. 647 AS2 issues .................................................................................................................................................. 648 Troubleshoot AS2 issues ................................................................................................................... 648 AS2 certificate issues ......................................................................................................................... 649 AS2 MDN receipt issues .................................................................................................................... 649 API refererence ............................................................................................................................ 651 Document history ........................................................................................................................ 653 xiii AWS Transfer Family User Guide What is AWS Transfer Family? AWS Transfer Family is a secure transfer service that enables you to transfer files into and out of AWS storage services. Transfer Family is part of the AWS Cloud platform. AWS Transfer Family offers fully managed support for the transfer of files over SFTP, AS2, FTPS, FTP, and web browser-based transfers directly into and out of AWS storage services. You can seamlessly migrate, automate, and monitor your file transfer workflows by maintaining existing client-side configurations for authentication, access, and firewalls—so nothing changes for your customers, partners, and internal teams, or their applications. See Getting started with AWS to learn more and to start building cloud applications with Amazon Web Services. AWS Transfer Family supports transferring data from or to the following AWS storage services. • Amazon Simple Storage Service (Amazon S3) storage. For information about Amazon S3, see Getting started with Amazon Simple Storage Service. • Amazon Elastic File System (Amazon EFS) Network File System (NFS) file systems. For information about Amazon EFS, see What is Amazon Elastic File System? AWS Transfer Family supports transferring data over the following protocols: • Secure File Transfer Protocol (SFTP): version 3 The official IETF document is here: SSH File Transfer Protocol draft-ietf-secsh-filexfer-02.txt. • File Transfer Protocol Secure (FTPS) • File Transfer Protocol (FTP) • Applicability Statement 2 (AS2) • Browser-based transfers Note For FTP and FTPS data connections, the port range that Transfer Family uses to establish the data channel is 8192–8200. 1 AWS Transfer Family User Guide File transfer protocols are used in data exchange workflows across different industries such as financial services, healthcare, advertising, and retail, among others. Transfer Family simplifies the migration of file transfer workflows to AWS. The following are some common use cases for using Transfer Family with Amazon S3: • Data lakes in AWS for uploads from third parties such as vendors and partners. • Subscription-based data distribution with your customers. • Internal transfers within your organization. The following are some common use cases for using Transfer Family with Amazon EFS: • Data distribution • Supply chain • Content management
transferfamily-ug-005
transferfamily-ug.pdf
5
User Guide File transfer protocols are used in data exchange workflows across different industries such as financial services, healthcare, advertising, and retail, among others. Transfer Family simplifies the migration of file transfer workflows to AWS. The following are some common use cases for using Transfer Family with Amazon S3: • Data lakes in AWS for uploads from third parties such as vendors and partners. • Subscription-based data distribution with your customers. • Internal transfers within your organization. The following are some common use cases for using Transfer Family with Amazon EFS: • Data distribution • Supply chain • Content management • Web serving applications The following are some common use cases for using Transfer Family with AS2: • Workflows with compliance requirements that rely on having data protection and security features built into the protocol • Supply chain logistics • Payments workflows • Business-to-business (B2B) transactions • Integrations with enterprise resource planning (ERP) and customer relationship management (CRM) systems The following are some common use cases for using Transfer Family web apps: • Simplified access to data in Amazon S3 to a wider and diverse range of business users • Centralized data access management for your workforce • Visualization of Amazon S3 Access Grants through a managed interface With Transfer Family, you get access to a file transfer protocol-enabled server in AWS (or a managed file transfer web interface), without the need to run any server infrastructure. You can 2 AWS Transfer Family User Guide use this service to migrate your file transfer-based workflows to AWS while maintaining your end users' clients and configurations as is. For servers, you first associate your hostname with the server endpoint, then add your users and provision them with the right level of access. After you do this, your users' transfer requests are serviced directly out of your Transfer Family server endpoint. For Transfer Family web apps, determine your configuration settings and apply optional customizations. After you do this, your users can log in and directly transfer data to and from Amazon S3. Transfer Family provides the following benefits: • A fully managed service that scales in real time to meet your needs. • You don't need to modify your applications or run any file transfer protocol infrastructure. • With your data in durable Amazon S3 storage, you can use native AWS services for processing, analytics, reporting, auditing, and archival functions. • With Amazon EFS as your data store, you get a fully managed elastic file system for use with AWS Cloud services and on-premises resources. Amazon EFS is built to scale on demand to petabytes without disrupting applications, growing and shrinking automatically as you add and remove files. This helps eliminate the need to provision and manage capacity to accommodate growth. • A fully managed, serverless File Transfer Workflow service that makes it easy to set up, run, automate, and monitor processing of files uploaded using AWS Transfer Family. • There are no upfront costs, and you pay only for the use of the service. In the following sections, you can find a description of the different features of Transfer Family, a getting started tutorial, detailed instructions on how to set up the different protocol enabled servers, how to use different types of identity providers, and the service's API reference. To get started with Transfer Family, see the following: • How AWS Transfer Family works • Prerequisites • Getting started with AWS Transfer Family server endpoints • Transfer Family web apps 3 AWS Transfer Family User Guide How AWS Transfer Family works AWS Transfer Family is a fully managed AWS service that you can use to transfer files into and out of Amazon Simple Storage Service (Amazon S3) storage or Amazon Elastic File System (Amazon EFS) file systems over the following protocols or web browser: • Secure File Transfer Protocol (SFTP): version 3 The official IETF document is here: SSH File Transfer Protocol draft-ietf-secsh-filexfer-02.txt. • File Transfer Protocol Secure (FTPS) • File Transfer Protocol (FTP) • Applicability Statement 2 (AS2) • Browser-based transfers AWS Transfer Family supports up to 3 Availability Zones and is backed by an auto scaling, redundant fleet for your connection and transfer requests. For an example on how to build for higher redundancy and minimize network latency by using Latency-based routing, see the blog post Minimize network latency with your AWS transfer for SFTP servers. Transfer Family Managed File Transfer Workflows (MFTW) is a fully managed, serverless File Transfer Workflow service that makes it easy to set up, run, automate, and monitor processing of files uploaded using AWS Transfer Family. Customers can use MFTW to automate various processing steps such as copying, tagging, scanning, filtering, compressing/decompressing, and encrypting/decrypting the data that's transferred using Transfer Family. This provides end to end visibility for tracking and auditability. For more details, see
transferfamily-ug-006
transferfamily-ug.pdf
6
build for higher redundancy and minimize network latency by using Latency-based routing, see the blog post Minimize network latency with your AWS transfer for SFTP servers. Transfer Family Managed File Transfer Workflows (MFTW) is a fully managed, serverless File Transfer Workflow service that makes it easy to set up, run, automate, and monitor processing of files uploaded using AWS Transfer Family. Customers can use MFTW to automate various processing steps such as copying, tagging, scanning, filtering, compressing/decompressing, and encrypting/decrypting the data that's transferred using Transfer Family. This provides end to end visibility for tracking and auditability. For more details, see AWS Transfer Family managed workflows. AWS Transfer Family supports any standard file transfer protocol client. Some commonly used clients are the following: • OpenSSH – A Macintosh and Linux command line utility. • WinSCP – A Windows-only graphical client. • Cyberduck – A Linux, Macintosh, and Microsoft Windows graphical client. • FileZilla – A Linux, Macintosh, and Windows graphical client. AWS offers the following Transfer Family workshops. How AWS Transfer Family works 4 AWS Transfer Family User Guide • Build a file transfer solution that leverages AWS Transfer Family for managed SFTP/FTPS endpoints and Amazon Cognito and DynamoDB for user management. You can view the details for this workshop here. • Build a Transfer Family endpoint with AS2 enabled, and a Transfer Family AS2 connector You can view the details for this workshop here. • Build a solution that provides prescriptive guidance and a hands on lab on how you can build a scalable and secure file transfer architecture on AWS without needing to modify existing applications or manage server infrastructure. You can view the details for this workshop here. Blog posts relevant for Transfer Family The following table lists the blog posts that contain useful information for Transfer Family customers. The table is in reverse chronological order, so that the most recent posts are at the beginning of the table. Blog post title and link Date How FICO modernizes file transfers with ETL automation using AWS Transfer Family April 24, 2025 Announcing AWS Transfer Family web apps for fully managed Amazon S3 file transfers December 1, 2024 Six tips to improve the security of your AWS Transfer Family server September 24, 2024 Simplify Active Directory authentication with a custom identity provider for AWS Transfer Family August 12, 2024 Architecting secure and compliant managed file transfers with AWS Transfer Family SFTP connectors and PGP encryption May 16, 2024 Using Amazon Cognito as an identity provider with AWS Transfer Family and Amazon S3 May 14, 2024 Blog posts relevant for Transfer Family 5 AWS Transfer Family User Guide Blog post title and link Date How Transfer Family can help you build a secure, compliant managed file transfer January 3, 2024 solution Detect malware threats using AWS Transfer Family July 20, 2023 Extending SAP workloads with AWS Transfer Family July 13, 2023 Encrypt and decrypt files with PGP and AWS Transfer Family June 21, 2023 Authenticating to AWS Transfer Family with Azure Active Directory and AWS Lambda December 15, 2022 Customize file delivery notifications using AWS Transfer Family managed workflows October 14, 2022 Building a cloud-native file transfer platform using AWS Transfer Family workflows January 5, 2022 Enabling user self-service key management with AAWS Transfer Family and AWS Lambda. December 17, 2021 Enhance data access control with AWS Transfer Family and Amazon S3 October 5, 2021 Improve throughput for internet facing file transfers using AWS Global Accelerator and AWS Transfer Family services June 7, 2021 Securing AWS Transfer Family with AWS Web Application Firewall and Amazon API Gateway May 5, 2021 Securing AWS Transfer Family with AWS Web Application Firewall and Amazon API Gateway January 15, 2021 Blog posts relevant for Transfer Family 6 AWS Transfer Family User Guide Blog post title and link Date AWS Transfer Family support for Amazon Elastic File System January 7, 2021 Enable password authentication for AWS Transfer Family using AWS Secrets Manager November 5, 2020 Centralize data access using AWS Transfer Family and AWS Storage Gateway June 22, 2020 Using Amazon EFS for AWS Lambda in your serverless applications June 18, 2020 Use IP allow list to secure your AWS Transfer Family servers April 8, 2020 Minimize network latency with your AWS transfer for SFTP servers February 19, 2020 Lift and Shift migration of SFTP servers to AWS February 12, 2020 Simplify your AWS SFTP Structure with chroot and logical directories September 26, 2019 Using Okta as an identity provider with AWS Transfer Family May 30, 2019 Blog posts relevant for Transfer Family 7 AWS Transfer Family User Guide Prerequisites The following sections describe the prerequisites required to use the AWS Transfer Family service. At a minimum, you need to create an Amazon Simple Storage Service (Amazon S3) bucket and provide access to that bucket through
transferfamily-ug-007
transferfamily-ug.pdf
7
Minimize network latency with your AWS transfer for SFTP servers February 19, 2020 Lift and Shift migration of SFTP servers to AWS February 12, 2020 Simplify your AWS SFTP Structure with chroot and logical directories September 26, 2019 Using Okta as an identity provider with AWS Transfer Family May 30, 2019 Blog posts relevant for Transfer Family 7 AWS Transfer Family User Guide Prerequisites The following sections describe the prerequisites required to use the AWS Transfer Family service. At a minimum, you need to create an Amazon Simple Storage Service (Amazon S3) bucket and provide access to that bucket through an AWS Identity and Access Management (IAM) role. Your role also needs to establish a trust relationship. This trust relationship allows Transfer Family to assume the IAM role to access your bucket so that it can service your users' file transfer requests. Topics • Supported AWS Regions, endpoints and quotas for Transfer Family servers • Sign up for AWS • Configure storage to use with AWS Transfer Family servers • Create an IAM role and policy Supported AWS Regions, endpoints and quotas for Transfer Family servers To connect programmatically to an AWS service, you use an endpoint. For example, the endpoint for customers in US East (Ohio) region (us-east-2), is transfer.us-east-2.amazonaws.com. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your AWS account. In this guide, you can find quotas in AS2 quotas and Quotas for SFTP connectors. For more information about supported AWS Regions, endpoints, and service quotas, see AWS Transfer Family endpoints and quotas in the Amazon Web Services General Reference. For Transfer Family web apps, the supported regions are listed in AWS Regions for Transfer Family web apps. For quotas that pertain to Transfer Family web apps, see Web app quotas. Sign up for AWS When you sign up for Amazon Web Services (AWS), your AWS account is automatically signed up for all services in AWS, including AWS Transfer Family. You are charged only for the services that you use. Regions, endpoints and quotas 8 AWS Transfer Family User Guide If you have an AWS account already, skip to the next task. If you don't have an AWS account, use the following procedure to create one. If you do not have an AWS account, complete the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. For information about pricing and to use AWS Pricing Calculator to get an estimate of the cost to use Transfer Family, see AWS Transfer Family pricing. For information about AWS Region availability, see the AWS Transfer Family endpoints and quotas in the AWS General Reference. Configure storage to use with AWS Transfer Family servers This topic describes the storage options that you can use with AWS Transfer Family. You can use either Amazon S3 or Amazon EFS as storage for your Transfer Family servers. Contents • Configure an Amazon S3 bucket • Amazon S3 access points • Amazon S3 HeadObject behavior • Grant ability to only write and list files • Large number of zero-byte objects causing latency issues • Configure an Amazon EFS file system • Amazon EFS file ownership Configure storage 9 AWS Transfer Family User Guide • Set up Amazon EFS users for Transfer Family • Configure Transfer Family users on Amazon EFS • Create an Amazon EFS root user • Supported Amazon EFS commands Configure an Amazon S3 bucket AWS Transfer Family accesses your Amazon S3 bucket to service your users' transfer requests, so you need to provide an Amazon S3 bucket as part of setting up your file transfer protocol-enabled server. You can use an existing bucket, or you can create a new one. Note You don't have to use a server and Amazon S3 bucket that are in the same AWS Region, but we recommend this as a best practice. When you set up your users, you assign them each an IAM role. This role determines the level of access that they have to your Amazon S3 bucket. For information on creating a new bucket, see How do I create an S3 bucket? in the Amazon Simple Storage Service User Guide. Note You can use Amazon S3 Object Lock to prevent objects from being overwritten for a fixed amount of time or indefinitely. This
transferfamily-ug-008
transferfamily-ug.pdf
8
You don't have to use a server and Amazon S3 bucket that are in the same AWS Region, but we recommend this as a best practice. When you set up your users, you assign them each an IAM role. This role determines the level of access that they have to your Amazon S3 bucket. For information on creating a new bucket, see How do I create an S3 bucket? in the Amazon Simple Storage Service User Guide. Note You can use Amazon S3 Object Lock to prevent objects from being overwritten for a fixed amount of time or indefinitely. This works the same way with Transfer Family as with other services. If an object exists and is protected, writing to that file or deleting it is not allowed. For more details on Amazon S3 Object Lock, see Using Amazon S3 Object Lock in the Amazon Simple Storage Service User Guide. Amazon S3 access points AWS Transfer Family supports Amazon S3 Access Points, a feature of Amazon S3 that allows you to easily manage granular access to shared data sets. You can use S3 Access Point aliases anywhere Configure an Amazon S3 bucket 10 AWS Transfer Family User Guide you use an S3 bucket name. You can create hundreds of access points in Amazon S3 for users who have different permissions to access shared data in an Amazon S3 bucket. For example, you can use access points to allow three different teams to have access to the same shared dataset where one team can read data from S3, a second team can write data to S3, and the third team can read, write, and delete data from S3. To implement a granular access control as mentioned above, you can create an S3 access point that contains a policy that gives asymmetrical access to different teams. You can use S3 access points with your Transfer Family server to achieve a fine-grained access control, without creating a complex S3 bucket policy that spans hundreds of use cases. To learn more about how to use S3 access points with a Transfer Family server, refer to the Enhance data access control with AWS Transfer Family and Amazon S3 blog post. Note AWS Transfer Family does not currently support Amazon S3 Multi-Region Access Points. Amazon S3 HeadObject behavior Note When you create or update a Transfer Family server, you can optimize performance for your Amazon S3 directories, which eliminates HeadObject calls. In Amazon S3, buckets and objects are the primary resources, and objects are stored in buckets. Amazon S3 can mimic a hierarchical file system, but can sometimes behave differently than a typical file system. For example, directories are not a first-class concept in Amazon S3 but instead are based on object keys. AWS Transfer Family infers a directory path by splitting an object's key by the forward slash character (/), treating the last element as the file name, then grouping file names which have the same prefix together under the same path. Zero-byte objects are created to represent a folder's path when you create an empty directory using mkdir or by using the Amazon S3 console. The key for these objects ends in a trailing forward slash. These zero-byte objects are described in Organizing objects in the Amazon S3 console using folders in the Amazon S3 User Guide. When you run an ls command, and some results are Amazon S3 zero-byte objects (these objects have keys that end in the forward slash character), Transfer Family issues a HeadObject request Configure an Amazon S3 bucket 11 AWS Transfer Family User Guide for each of these objects (see HeadObject in the Amazon Simple Storage Service API Reference for details). This can result in the following problems when using Amazon S3 as your storage with Transfer Family. Grant ability to only write and list files In some cases, you might want to offer only write access to your Amazon S3 objects. For example, you might want to provide access to write (or upload) and list objects in a bucket, but not to read (download) objects. To perform ls and mkdir commands by using file transfer clients, you must have the Amazon S3 ListObjects and PutObject permissions. However, when Transfer Family needs to make a HeadObject call to either write or list files, the call fails with an error of Access denied, because this call requires the GetObject permission. Note When you create or update a Transfer Family server, you can optimize performance for your Amazon S3 directories, which eliminates HeadObject calls. In this case, you can grant access by adding an AWS Identity and Access Management (IAM) policy condition that adds the GetObject permission only for objects that end in a slash (/). This condition prevents GetObject calls on files (so that they can't be read), but allows
transferfamily-ug-009
transferfamily-ug.pdf
9
Transfer Family needs to make a HeadObject call to either write or list files, the call fails with an error of Access denied, because this call requires the GetObject permission. Note When you create or update a Transfer Family server, you can optimize performance for your Amazon S3 directories, which eliminates HeadObject calls. In this case, you can grant access by adding an AWS Identity and Access Management (IAM) policy condition that adds the GetObject permission only for objects that end in a slash (/). This condition prevents GetObject calls on files (so that they can't be read), but allows the user to list and traverse folders. The following example policy offers only write and list access to your Amazon S3 buckets. To use this policy, replace amzn-s3-demo-bucket with the name of your bucket. Note To address WinSCP's upload behavior, make sure to add the "arn:aws:s3:::amzn- s3-demo-bucket/*.filepart" line as listed in the following example policy. This line ensures proper handling of .filepart objects to prevent failures. { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowListing", "Effect": "Allow", Configure an Amazon S3 bucket 12 AWS Transfer Family User Guide "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::amzn-s3-demo-bucket" }, { "Sid": "AllowReadWrite", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:GetObjectVersion" ], "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket/*" ] }, { "Sid": "DenyIfNotFolder", "Effect": "Deny", "Action": [ "s3:GetObject", "s3:GetObjectVersion" ], "NotResource": [ "arn:aws:s3:::amzn-s3-demo-bucket/*/", "arn:aws:s3:::amzn-s3-demo-bucket/*.filepart" ] } ] } Note This policy doesn't allow users to append files. In other words, a user who is assigned this policy can't open files to add content to them, or to modify them. Additionally, if your use case requires a HeadObject call before uploading a file, this policy won't work for you. Large number of zero-byte objects causing latency issues If your Amazon S3 buckets contain a large number of these zero-byte objects, Transfer Family issues a lot of HeadObject calls, which can result in processing delays. The recommended solution for this issue is to enable Optimized Directories to reduce latency. Configure an Amazon S3 bucket 13 AWS Transfer Family User Guide For example, suppose that you go into your home directory, and you have 10,000 subdirectories. In other words, your Amazon S3 bucket has 10,000 folders. In this scenario, if you run the ls (list) command, the list operation takes between six and eight minutes. However, if you optimize your directories, this operation takes only a few seconds. You set this option in the Configure additional details screen during the server creation or update procedure. These procedures are detailed under the Configuring an SFTP, FTPS, or FTP server endpoint topic. Note GUI clients may issue an ls command outside your control, so it is important to enable this setting if you can. If you don't or can't optimize your directories, an alternate solution to this problem is to delete all of your zero-byte objects. Note the following: • Empty directories will no longer exist. Directories only exist as a result of their names being in the key of an object. • Doesn’t prevent someone from calling mkdir and breaking things all over again. You could mitigate this by crafting a policy which prevents directory creation. • Some scenarios make use of these 0-byte objects. For example, you have a structure like / inboxes/customer1000 and the inbox directory gets cleaned every day. Finally, one more possible solution is to limit the number of objects visible through a policy condition to reduce the number of HeadObject calls. For this to be a workable solution, you need to accept that you might only be able to view a limited set of all of your sub-directories. Configure an Amazon EFS file system AWS Transfer Family accesses Amazon Elastic File System (Amazon EFS) to service your users' transfer requests. So you must provide an Amazon EFS file system as part of setting up your file transfer protocol-enabled server. You can use an existing file system, or you can create a new one. Note the following: • When you use a Transfer Family server and an Amazon EFS file system, the server and the file system must be in the same AWS Region. Configure an Amazon EFS file system 14 AWS Transfer Family User Guide • The server and the file system don't need to be in the same account. If the server and file system are not in the same account, the file system policy must give explicit permission to the user role. For information about how to set up multiple accounts, see Managing the AWS accounts in your organization in the AWS Organizations User Guide. • When you set up your users, you assign them each an IAM role. This role determines the level of access that they have to your Amazon EFS file system. • For details on mounting an Amazon EFS file system, see Mounting Amazon EFS
transferfamily-ug-010
transferfamily-ug.pdf
10
system don't need to be in the same account. If the server and file system are not in the same account, the file system policy must give explicit permission to the user role. For information about how to set up multiple accounts, see Managing the AWS accounts in your organization in the AWS Organizations User Guide. • When you set up your users, you assign them each an IAM role. This role determines the level of access that they have to your Amazon EFS file system. • For details on mounting an Amazon EFS file system, see Mounting Amazon EFS file systems. For more details on how AWS Transfer Family and Amazon EFS work together, see Using AWS Transfer Family to access files in your Amazon EFS file system in the Amazon Elastic File System User Guide. Amazon EFS file ownership Amazon EFS uses the Portable Operating System Interface (POSIX) file permission model to represent file ownership. In POSIX, users in the system are categorized into three distinct permission classes: When you allow a user to access files stored in an Amazon EFS file system using AWS Transfer Family, you must assign them a “POSIX profile.” This profile is used to determine their access to files and directories in the Amazon EFS file system. • User (u): Owner of the file or directory. Usually, the creator of a file or directory is also the owner. • Group (g): Set of users that need identical access to files and directories that they share. • Others (o): All other users that have access to the system except for the owner and group members. This permission class is also referred to as "Public." In the POSIX permission model, every file system object (files, directories, symbolic links, named pipes, and sockets) is associated with the previously mentioned three sets of permissions. Amazon EFS objects have a Unix-style mode associated with them. This mode value defines the permissions for performing actions on that object. Additionally, on Unix-style systems, users and groups are mapped to numeric identifiers, which Amazon EFS uses to represent file ownership. For Amazon EFS, objects are owned by a single owner and a single group. Amazon EFS uses the mapped numeric IDs to check permissions when a user attempts to access a file system object. Configure an Amazon EFS file system 15 AWS Transfer Family User Guide Set up Amazon EFS users for Transfer Family Before you set up your Amazon EFS users, you can do either of the following: • You can create users and set up their home folders in Amazon EFS. See Configure Transfer Family users on Amazon EFS for details. • If you are comfortable adding a root user, you can Create an Amazon EFS root user. Note Transfer Family servers do not support Amazon EFS access points to set POSIX permissions. Transfer Family users' POSIX profiles (described in the preceding section) offer the ability to set POSIX permissions. These permissions are set at a user level, for granular access, based on UID, GID, and secondary GIDs. Configure Transfer Family users on Amazon EFS Transfer Family maps the users to the UID/GID and directories you specify. If the UID/GID/ directories do not already exist in EFS, then you should create them before assigning them in Transfer to a user. The details for creating Amazon EFS users is described in Working with users, groups, and permissions at the Network File System (NFS) Level in the Amazon Elastic File System User Guide. Steps to set up Amazon EFS users in Transfer Family 1. Map the EFS UID and GID for your user in Transfer Family using the PosixProfile fields. 2. If you want the user to start in a specific folder upon login, you can specify the EFS directory under the HomeDirectory field. You can automate the process, by using a CloudWatch rule and Lambda function. For an example Lambda function that interacts with EFS, see Using Amazon EFS for AWS Lambda in your serverless applications. Additionally, you can configure logical directories for your Transfer Family users. For details, see the Configure logical directories for Amazon EFS section in the Using logical directories to simplify your Transfer Family directory structures topic. Configure an Amazon EFS file system 16 AWS Transfer Family Create an Amazon EFS root user User Guide If your organization is comfortable for you to enable root user access via SFTP/FTPS for the configuration of your users, you can create a user who's UID and GID are 0 (root user), then use that root user to create folders and assign POSIX ID owners for rest of the users. The advantage of this option is that there is no need to mount the Amazon EFS file system. Perform the steps described in Adding Amazon EFS service-managed users, and for
transferfamily-ug-011
transferfamily-ug.pdf
11
topic. Configure an Amazon EFS file system 16 AWS Transfer Family Create an Amazon EFS root user User Guide If your organization is comfortable for you to enable root user access via SFTP/FTPS for the configuration of your users, you can create a user who's UID and GID are 0 (root user), then use that root user to create folders and assign POSIX ID owners for rest of the users. The advantage of this option is that there is no need to mount the Amazon EFS file system. Perform the steps described in Adding Amazon EFS service-managed users, and for both the User ID and Group ID, enter 0 (zero). Tip Don't let this superuser account exist for longer than necessary. Or, if you do keep the root user account, make sure that you keep it well protected. Supported Amazon EFS commands The following commands are supported for Amazon EFS for AWS Transfer Family. • cd • ls/dir • pwd • put • get • rename • chown: Only root (that is, users with uid=0) can change ownership and permissions of files and directories. • chmod: Only root can change ownership and permissions of files and directories. • chgrp: Supported either for root or for the file's owner who can only change a file's group to be one of their secondary groups. • ln -s/symlink • mkdir • rm/delete • rmdir • chmtime Configure an Amazon EFS file system 17 AWS Transfer Family User Guide Create an IAM role and policy This topic describes the types of policies and roles that can be used with AWS Transfer Family, and walks through the process of creating a user role. It also describes how session policies work and provides an example user role. AWS Transfer Family uses the following types of roles: • User role – Allows service-managed users to access the necessary Transfer Family resources. AWS Transfer Family assumes this role in the context of a Transfer Family user ARN. • Access role – Provides access to only the Amazon S3 files that are being transferred. For inbound AS2 transfers, the access role uses the Amazon Resource Name (ARN) for the agreement. For outbound AS2 transfers, the access role uses the ARN for the connector. • Invocation role – For use with Amazon API Gateway as the server's custom identity provider. Transfer Family assumes this role in the context of a Transfer Family server ARN. • Logging role – Used to log entries into Amazon CloudWatch. Transfer Family uses this role to log success and failure details along with information about file transfers. Transfer Family assumes this role in the context of a Transfer Family server ARN. For outbound AS2 transfers, the logging role uses the connector ARN. • Execution role – Allows a Transfer Family user to call and launch workflows. Transfer Family assumes this role in the context of a Transfer Family workflow ARN. In addition to these roles, you can also use session policies. A session policy is used to limit access when necessary. Note that these policies are stand-alone: that is, you don't add these polices to a role. Rather, you add a session policy directly to a Transfer Family user. Note When you are creating a service-managed Transfer Family user, you can select Auto- generate policy based on home folder. This is a useful shortcut if you want to limit user access to their own folders. Also, you can view details about session policies and an example in How session policies work. You can also find more information about session policies in Session policies in the IAM User Guide. Topics Create an IAM role and policy 18 AWS Transfer Family • Create a user role • How session policies work • Example read/write access policy Create a user role User Guide When you create a user, you make a number of decisions about user access. These decisions include which Amazon S3 buckets or Amazon EFS file systems that the user can access, what portions of each Amazon S3 bucket and which files in the file system are accessible, and what permissions the user has (for example, PUT or GET). To set access, you create an identity-based AWS Identity and Access Management (IAM) policy and role that provide that access information. As part of this process, you provide access for your user to the Amazon S3 bucket or Amazon EFS file system that is the target or source for file operations. To do this, take the following high-level steps, described in detail later: Create a user role 1. Create an IAM policy for AWS Transfer Family. This is described in To create an IAM policy for AWS Transfer Family. 2. Create an IAM role and attach the new IAM policy. For an example, see Example read/write access
transferfamily-ug-012
transferfamily-ug.pdf
12
AWS Identity and Access Management (IAM) policy and role that provide that access information. As part of this process, you provide access for your user to the Amazon S3 bucket or Amazon EFS file system that is the target or source for file operations. To do this, take the following high-level steps, described in detail later: Create a user role 1. Create an IAM policy for AWS Transfer Family. This is described in To create an IAM policy for AWS Transfer Family. 2. Create an IAM role and attach the new IAM policy. For an example, see Example read/write access policy. 3. Establish a trust relationship between AWS Transfer Family and the IAM role. This is described in To establish a trust relationship. The following procedures describe how to create an IAM policy and role. To create an IAM policy for AWS Transfer Family 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. In the navigation pane, choose Policies, and then choose Create policy. 3. On the Create Policy page, choose the JSON tab. 4. In the editor that appears, replace the contents of the editor with the IAM policy that you want attach to the IAM role. You can grant read/write access or restrict users to their home directory. For more information, see Example read/write access policy. Create a user role 19 AWS Transfer Family User Guide 5. Choose Review policy and provide a name and description for your policy, and then choose Create policy. Next, you create an IAM role and attach the new IAM policy to it. To create an IAM role for AWS Transfer Family 1. In the navigation pane, choose Roles, and then choose Create role. On the Create role page, make sure that AWS service is chosen. 2. Choose Transfer from the service list, and then choose Next: Permissions. This establishes a trust relationship between AWS Transfer Family and AWS. 3. In the Attach permissions policies section, locate and choose the policy that you just created, and choose Next: Tags. 4. (Optional) Enter a key and value for a tag, and choose Next: Review. 5. On the Review page, enter a name and description for your new role, and then choose Create role. Next, you establish a trust relationship between AWS Transfer Family and AWS. To establish a trust relationship Note In our examples, we use both ArnLike and ArnEquals. They are functionally identical, and therefore you may use either when you construct your policies. Transfer Family documentation uses ArnLike when the condition contains a wildcard character, and ArnEquals to indicate an exact match condition. 1. In the IAM console, choose the role that you just created. 2. On the Summary page, choose Trust relationships, and then choose Edit trust relationship. 3. In the Edit Trust Relationship editor, make sure service is "transfer.amazonaws.com". The access policy is shown following. { "Version": "2012-10-17", Create a user role 20 AWS Transfer Family User Guide "Statement": [ { "Effect": "Allow", "Principal": { "Service": "transfer.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } We recommend that you use the aws:SourceAccount and aws:SourceArn condition keys to protect yourself against the confused deputy problem. The source account is the owner of the server and the source ARN is the ARN of the user. For example: "Condition": { "StringEquals": { "aws:SourceAccount": "account_id" }, "ArnLike": { "aws:SourceArn": "arn:aws:transfer:region:account_id:user/*" } } You can also use the ArnLike condition if you are looking to restrict to a particular server instead of any server in the user account. For example: "Condition": { "ArnLike": { "aws:SourceArn": "arn:aws:transfer:region:account-id:user/server-id/*" } } Note In the examples above, replace each user input placeholder with your own information. Create a user role 21 AWS Transfer Family User Guide For details on the confused deputy problem and more examples, see Cross-service confused deputy prevention. 4. Choose Update Trust Policy to update the access policy. You have now created an IAM role that allows AWS Transfer Family to call AWS services on your behalf. You attached to the role the IAM policy that you created to give access to your user. In the Getting started with AWS Transfer Family server endpoints section, this role and policy are assigned to your user or users. See also • For more general information about IAM roles, see Creating a role to delegate permissions to an AWS service in the IAM User Guide. • To learn more about identity-based policies for Amazon S3 resources, see Identity and access management in Amazon S3 in the Amazon Simple Storage Service User Guide. • To learn more about identity-based policies for Amazon EFS resources, see Using IAM to control file system data access in the Amazon Elastic File System User Guide. How session policies work When an administrator creates a role, the role often includes broad permissions to cover multiple use cases or
transferfamily-ug-013
transferfamily-ug.pdf
13
For more general information about IAM roles, see Creating a role to delegate permissions to an AWS service in the IAM User Guide. • To learn more about identity-based policies for Amazon S3 resources, see Identity and access management in Amazon S3 in the Amazon Simple Storage Service User Guide. • To learn more about identity-based policies for Amazon EFS resources, see Using IAM to control file system data access in the Amazon Elastic File System User Guide. How session policies work When an administrator creates a role, the role often includes broad permissions to cover multiple use cases or team members. If an administrator configures a console URL, they can reduce permissions for the resulting session by using a session policy. For example, if you create a role with read/write access, you can set up a URL that limits users’ access to only their home directories. Session policies are advanced policies that you pass as a parameter when you programmatically create a temporary session for a role or user. Session policies are useful for locking down users so that they have access only to portions of your bucket where object prefixes contain their username. The following diagram shows that the session policy's permissions are the intersection of the session policies and the resource-based policies plus the intersection of the session policies and identity-based policies. How session policies work 22 AWS Transfer Family User Guide For more details, see Session policies in the IAM User Guide. In AWS Transfer Family, a session policy is supported only when you are transferring to or from Amazon S3. The following example policy is a session policy that limits users' access to their home directories only. Note the following: • The GetObjectACL and PutObjectACL statements are only required if you need to enable Cross Account Access. That is, your Transfer Family server needs to access a bucket in a different account. • The maximum length of a session policy is 2048 characters. For more details, see the Policy request parameter for the CreateUser action in the API reference. • If your Amazon S3 bucket is encrypted using AWS Key Management Service (AWS KMS), you must specify additional permissions in your policy. For details, see Data protection and encryption. { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowListingOfUserFolder", "Action": [ "s3:ListBucket" ], How session policies work 23 AWS Transfer Family User Guide "Effect": "Allow", "Resource": [ "arn:aws:s3:::${transfer:HomeBucket}" ], "Condition": { "StringLike": { "s3:prefix": [ "${transfer:HomeFolder}/*", "${transfer:HomeFolder}" ] } } }, { "Sid": "HomeDirObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObjectVersion", "s3:GetObjectACL", "s3:PutObjectACL" ], "Resource": "arn:aws:s3:::${transfer:HomeDirectory}/*" } ] } Note The preceding policy example assumes that users have their home directories set to include a trailing slash, to signify that it is a directory. If, on the other hand, you set a user's HomeDirectory without the trailing slash, then you should include it as part of your policy. In the previous example policy, note the use of the transfer:HomeFolder, transfer:HomeBucket, and transfer:HomeDirectory policy parameters. These parameters How session policies work 24 AWS Transfer Family User Guide are set for the HomeDirectory that is configured for the user, as described in HomeDirectory and Implementing your API Gateway method. These parameters have the following definitions: • The transfer:HomeBucket parameter is replaced with the first component of HomeDirectory. • The transfer:HomeFolder parameter is replaced with the remaining portions of the HomeDirectory parameter. • The transfer:HomeDirectory parameter has the leading forward slash (/) removed so that it can be used as part of an S3 Amazon Resource Name (ARN) in a Resource statement. Note If you are using logical directories—that is, the user's homeDirectoryType is LOGICAL— these policy parameters (HomeBucket, HomeDirectory, and HomeFolder) are not supported. For example, assume that the HomeDirectory parameter that is configured for the Transfer Family user is /home/bob/amazon/stuff/. • transfer:HomeBucket is set to /home. • transfer:HomeFolder is set to /bob/amazon/stuff/. • transfer:HomeDirectory becomes home/bob/amazon/stuff/. The first "Sid" allows the user to list all directories starting from /home/bob/amazon/stuff/. The second "Sid" limits the user'put and get access to that same path, /home/bob/amazon/ stuff/. Example read/write access policy Grant read/write access to Amazon S3 bucket The following example policy for AWS Transfer Family grants read/write access to objects in your Amazon S3 bucket. Note the following: Example read/write access policy 25 AWS Transfer Family User Guide • Replace amzn-s3-demo-bucket with the name of your Amazon S3 bucket. • The GetObjectACL and PutObjectACL statements are only required if you need to enable Cross Account Access. That is, your Transfer Family server needs to access a bucket in a different account. • The GetObjectVersion and DeleteObjectVersion statements are only required if versioning is enabled on the Amazon S3 bucket that is being accessed. Note If you have ever enabled versioning for your bucket, then you need these permissions,
transferfamily-ug-014
transferfamily-ug.pdf
14
to objects in your Amazon S3 bucket. Note the following: Example read/write access policy 25 AWS Transfer Family User Guide • Replace amzn-s3-demo-bucket with the name of your Amazon S3 bucket. • The GetObjectACL and PutObjectACL statements are only required if you need to enable Cross Account Access. That is, your Transfer Family server needs to access a bucket in a different account. • The GetObjectVersion and DeleteObjectVersion statements are only required if versioning is enabled on the Amazon S3 bucket that is being accessed. Note If you have ever enabled versioning for your bucket, then you need these permissions, as you can only suspend versioning in Amazon S3, and not turn it off completely. For details, see Unversioned, versioning-enabled, and versioning-suspended buckets. { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowListingOfUserFolder", "Action": [ "s3:ListBucket", "s3:GetBucketLocation" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket" ] }, { "Sid": "HomeDirObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObjectVersion", "s3:GetObjectACL", "s3:PutObjectACL" ], Example read/write access policy 26 AWS Transfer Family User Guide "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*" } ] } Grant file system access to files in Amazon EFS file system Note In addition to the policy, you must also make sure your POSIX file permissions are granting the appropriate access. For more information, see Working with users, groups, and permissions at the Network File System (NFS) Level in the Amazon Elastic File System User Guide. The following example policy grants root file system access to files in your Amazon EFS file system. Note In the following examples, replace region with your region, account-id with the account the file is in, and file-system-id with the ID of your Amazon Elastic File System (Amazon EFS). { "Version": "2012-10-17", "Statement": [ { "Sid": "RootFileSystemAccess", "Effect": "Allow", "Action": [ "elasticfilesystem:ClientRootAccess", "elasticfilesystem:ClientMount", "elasticfilesystem:ClientWrite" ], "Resource": "arn:aws:elasticfilesystem:region:account-id:file-system/file- system-id" } ] Example read/write access policy 27 AWS Transfer Family } User Guide The following example policy grants user file system access to files in your Amazon EFS file system. { "Version": "2012-10-17", "Statement": [ { "Sid": "UserFileSystemAccess", "Effect": "Allow", "Action": [ "elasticfilesystem:ClientMount", "elasticfilesystem:ClientWrite" ], "Resource": "arn:aws:elasticfilesystem:region:account-id:file-system/file- system-id" } ] } Example read/write access policy 28 AWS Transfer Family User Guide Transfer Family tutorials The AWS Transfer Family user guide provides detailed walkthroughs for several use cases. • Getting started with AWS Transfer Family server endpoints: this tutorial walks you through creating an SFTP Transfer Family server and service-managed user, then shows how to transfer a file using a client. • Setting up and using SFTP connectors: this tutorial illustrates how to set up an SFTP connector, and then transfer files between Amazon S3 storage and an SFTP server. • Setting up an Amazon API Gateway method as a custom identity provider : this tutorial illustrates how to set up an Amazon API Gateway method and use it as a custom identity provider to upload files to an AWS Transfer Family server. • Setting up a managed workflow for decrypting a file: this tutorial illustrates how to set up a managed workflow that contains a decrypt step, and how to upload an encrypted file to an Amazon S3 bucket and then view the decrypted file. • Setting up an AS2 configuration: this tutorial walks through the steps needed to configure an AS2 Transfer Family server. There are instructions for importing certificates, creating profiles and agreements, optionally creating an AS2 connector, and then testing the configuration. • Setting up a Transfer Family web app: this tutorial walks through the steps needed to create and configure a Transfer Family web app. Topics • Getting started with AWS Transfer Family server endpoints • Setting up a managed workflow for decrypting a file • Setting up and using SFTP connectors • Setting up an Amazon API Gateway method as a custom identity provider • Setting up an AS2 configuration • Setting up a Transfer Family web app 29 AWS Transfer Family User Guide Getting started with AWS Transfer Family server endpoints Use this tutorial to get started with AWS Transfer Family (Transfer Family). You'll learn how to create an SFTP-enabled server with publicly accessible endpoint using Amazon S3 storage, add a user with service-managed authentication, and transfer a file with Cyberduck. Topics • Prerequisites • Step 1: Sign in to the AWS Transfer Family console • Step 2: Create an SFTP-enabled server • Step 3: Add a service managed user • Step 4: Transfer a file using a client Prerequisites Before you begin, be sure to complete the requirements in Prerequisites. As part of this setup, you create an Amazon Simple Storage Service (Amazon S3) bucket and an AWS Identity and Access Management (IAM) user role. There are permissions required for using the AWS Transfer Family console, and there are permissions required for configuring other AWS services that Transfer Family uses, such as Amazon Simple Storage Service, AWS
transferfamily-ug-015
transferfamily-ug.pdf
15
in to the AWS Transfer Family console • Step 2: Create an SFTP-enabled server • Step 3: Add a service managed user • Step 4: Transfer a file using a client Prerequisites Before you begin, be sure to complete the requirements in Prerequisites. As part of this setup, you create an Amazon Simple Storage Service (Amazon S3) bucket and an AWS Identity and Access Management (IAM) user role. There are permissions required for using the AWS Transfer Family console, and there are permissions required for configuring other AWS services that Transfer Family uses, such as Amazon Simple Storage Service, AWS Certificate Manager, Amazon Elastic File System, and Amazon Route 53. For example, for users that are transferring files into and out of AWS using Transfer Family, AmazonS3FullAccess grants permissions to setup and use an Amazon S3 bucket. Some of the permissions in this policy are needed to create Amazon S3 buckets. To use the Transfer Family console, you require the following: • AWSTransferConsoleFullAccess grants permissions for your SFTP user to create Transfer Family resources. • IAMFullAccess (or specifically a policy that allows creation of IAM roles) is only needed if you want Transfer Family to automatically create a logging role for your server in Amazon CloudWatch Logs or a user role for a user logging into a server. • To create and delete VPC server types, you need to add the actions ec2:CreateVpcEndpoint and ec2:DeleteVpcEndpoints to your policy. Get started with server endpoints 30 AWS Transfer Family Note User Guide The AmazonS3FullAccess and IAMFullAccess polices are, themselves, not needed for general usage of AWS Transfer Family. They are presented here as a simple way to make sure that all of the permissions that you need are covered. Additionally, these are AWS managed policies, which are standard policies that are available to all AWS customers. You can view the individual permissions in these policies and determine a minimal set that you need for your purposes. Step 1: Sign in to the AWS Transfer Family console To sign in to Transfer Family 1. Sign in to the AWS Management Console and open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. For Account ID or alias, enter the ID for your AWS account. For IAM user name, enter the name of the user role that you created for Transfer Family. For Password, enter your AWS account password. 2. 3. 4. 5. Choose Sign in. Step 2: Create an SFTP-enabled server Secure Shell (SSH) File Transfer Protocol (SFTP) is a network protocol used for secure transfer of data over the internet. The protocol supports the full security and authentication functionality of SSH. It is widely used to exchange data, including sensitive information between business partners in a variety of industries such as financial services, healthcare, retail, and advertising. To create an SFTP-enabled server 1. 2. 3. Select Servers from the Navigation pane then choose Create server. In Choose protocols, select SFTP, and then choose Next. In Choose an identity provider, choose Service managed to store user identities and keys in Transfer Family, and then choose Next. 4. In Choose an endpoint, do the following: Step 1: Sign in to the AWS Transfer Family console 31 AWS Transfer Family User Guide a. b. c. For Endpoint type, choose the Publicly accessible endpoint type. For Custom hostname, choose None. Choose Next. 5. 6. In Choose a domain, choose Amazon S3. In Configure additional details, for Cryptographic algorithm options, choose a security policy that contains the cryptographic algorithms enabled for use by your server. Our latest security policy is the default: for details, see Security policies for AWS Transfer Family servers. Note Only if you are adding a managed workflow for your server, choose Create a new role for CloudWatch logging. To log server events, you do not need to create an IAM role. 7. In Review and create, choose Create server. You are taken to the Servers page. It can take a couple of minutes before the status for your new server changes to Online. At that point, your server can perform file operations, but you'll need to create a user first. For details on creating users, see Managing users for server endpoints. Step 3: Add a service managed user To add a user to the SFTP-enabled server 1. On the Servers page, select the server that you want to add a user to. 2. Choose Add user. 3. In the User configuration section, for Username, enter the username. This username must be a minimum of 3 and a maximum of 100 characters. You can use the following characters in the username: a–z, A-Z, 0–9, underscore '_', hyphen '-', period '.' and at sign '@'. The username can't start with a hyphen '-', period '.' or at sign '@'. 4. For Access, choose the IAM role that
transferfamily-ug-016
transferfamily-ug.pdf
16
service managed user To add a user to the SFTP-enabled server 1. On the Servers page, select the server that you want to add a user to. 2. Choose Add user. 3. In the User configuration section, for Username, enter the username. This username must be a minimum of 3 and a maximum of 100 characters. You can use the following characters in the username: a–z, A-Z, 0–9, underscore '_', hyphen '-', period '.' and at sign '@'. The username can't start with a hyphen '-', period '.' or at sign '@'. 4. For Access, choose the IAM role that you created in Create an IAM role and policy. This IAM role includes an IAM policy that contains permissions to access your Amazon S3 bucket, as well as a trust relationship with the AWS Transfer Family service. The procedure outlined in To establish a trust relationship shows how to establish the proper trust relationship. 5. For Policy, choose None. Step 3: Add a service managed user 32 AWS Transfer Family User Guide 6. For Home directory, choose the Amazon S3 bucket where you want to store the data that you transfer using AWS Transfer Family. Enter the path to the home directory. This is the directory that your users see when they log in using their client. We recommend using a directory path that contains the username so that you have the option to use a session policy. A session policy limits a user's access in the Amazon S3 bucket to that user's home directory. For more information about using session policies, see How session policies work. If you prefer, you can keep this parameter blank to use your Amazon S3 bucket's root directory. If you choose this option, make sure that your IAM role provides access to theroot directory. 7. Select the Restricted check box to prevent your users from accessing anything outside of their home directory. This also prevents users from seeing the Amazon S3 bucket name or folder name. 8. For SSH public key, enter the public SSH key portion of the SSH key pair in ssh-rsa <string> format. Your key must be validated by the service before you can add your new user. For more information about how to generate an SSH key pair, see Generate SSH keys for service- managed users. 9. (Optional) For Key and Value, enter one or more tags as key-value pairs, and choose Add tag. 10. Choose Add to add your new user to the server that you chose. The new user appears in the Users section of the Server details page. Step 4: Transfer a file using a client You transfer files over the AWS Transfer Family service by specifying the transfer operation in a client. AWS Transfer Family supports several clients. For details, see Transferring files over a server endpoint using a client This section contains procedures for using Cyberduck and OpenSSH. Topics • Use Cyberduck • Use OpenSSH Step 4: Transfer a file using a client 33 AWS Transfer Family Use Cyberduck To transfer files over AWS Transfer Family using Cyberduck 1. Open the Cyberduck client. 2. Choose Open Connection. User Guide 3. 4. 5. 6. In the Open Connection dialog box, choose SFTP (SSH File Transfer Protocol). For Server, enter your server endpoint. The server endpoint is located on the Server details page, see View SFTP, FTPS, and FTP server details. For Port number, enter 22 for SFTP. For Username, enter the name for the user that you created in Managing users for server endpoints. 7. For SSH Private Key, choose or enter the SSH private key. 8. Choose Connect. 9. Perform your file transfer. Depending on where your files are, do one of the following: • In your local directory (the source), choose the files that you want to transfer, and drag and drop them into the Amazon S3 directory (the target). • In the Amazon S3 directory (the source), choose the files that you want to transfer, and drag and drop them into your local directory (the target). Use OpenSSH Use the instructions that follow to transfer files from the command line using OpenSSH. Note This client works only with an SFTP-enabled server. To transfer files over AWS Transfer Family using the OpenSSH command line utility 1. On Linux or Macintosh, open a command terminal. Step 4: Transfer a file using a client 34 AWS Transfer Family User Guide 2. At the prompt, enter the following command: % sftp -i transfer-key sftp_user@service_endpoint In the preceding command, sftp_user is the username and transfer-key is the SSH private key. Here, service_endpoint is the server's endpoint as shown in the AWS Transfer Family console for the selected server. An sftp prompt should appear. 3. (Optional) To view the user's home directory, enter the following command at the sftp
transferfamily-ug-017
transferfamily-ug.pdf
17
files over AWS Transfer Family using the OpenSSH command line utility 1. On Linux or Macintosh, open a command terminal. Step 4: Transfer a file using a client 34 AWS Transfer Family User Guide 2. At the prompt, enter the following command: % sftp -i transfer-key sftp_user@service_endpoint In the preceding command, sftp_user is the username and transfer-key is the SSH private key. Here, service_endpoint is the server's endpoint as shown in the AWS Transfer Family console for the selected server. An sftp prompt should appear. 3. (Optional) To view the user's home directory, enter the following command at the sftp prompt: sftp> pwd 4. On the next line, enter the following text: sftp> cd /amzn-s3-demo-bucket/home/ sftp_user In this getting-started exercise, this Amazon S3 bucket is the target of the file transfer. 5. On the next line, enter the following command: sftp> put filename.txt The put command transfers the file into the Amazon S3 bucket. A message like the following appears, indicating that the file transfer is in progress, or complete. Uploading filename.txt to /amzn-s3-demo-bucket/home/sftp_user/ filename.txt some-file.txt 100% 127 0.1KB/s 00:00 Setting up a managed workflow for decrypting a file This tutorial illustrates how to set up a managed workflow that contains a decrypt step. The tutorial also shows how to upload an encrypted file to an Amazon S3 bucket and then view the decrypted file in that same bucket. Note The AWS storage blog has a post that describes how to simply decrypt files without writing any code using Transfer Family Managed workflows, Encrypt and decrypt files with PGP and AWS Transfer Family. Create a decryption Workflow 35 User Guide AWS Transfer Family Topics • Step 1: Configure an execution role • Step 2: Create a managed workflow • Step 3: Add the workflow to a server and create a user • Step 4: Create a PGP key pair • Step 5: Store the PGP private key in AWS Secrets Manager • Step 6: Encrypt a file • Step 7: Run the workflow and view the results Step 1: Configure an execution role Create an AWS Identity and Access Management (IAM) execution role that Transfer Family can use to launch a workflow. The process of creating an execution role is described in IAM policies for workflows. Note As part of creating an execution role, make sure to establish a trust relationship between the execution role and Transfer Family, as described in To establish a trust relationship. The following execution role policy contains all the required permissions to start the workflow that you create in this tutorial. To use this example policy, replace the user input placeholders with your own information. Replace amzn-s3-demo-bucket with the name of the Amazon S3 bucket where you upload your encrypted files. Note Not every workflow requires every permission that's listed in this example. You can restrict permissions based on the types of steps in your specific workflow. The permissions needed for each predefined step type are described in Use predefined steps. The permissions needed for a custom step are described in IAM permissions for a custom step. { Step 1: Configure an execution role 36 AWS Transfer Family User Guide "Version": "2012-10-17", "Statement": [{ "Sid": "WorkflowsS3Permissions", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:GetObjectTagging", "s3:GetObjectVersion", "s3:PutObject", "s3:PutObjectTagging", "s3:ListBucket", "s3:PutObjectTagging", "s3:PutObjectVersionTagging", "s3:DeleteObjectVersion", "s3:DeleteObject" ], "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket/*", "arn:aws:s3:::amzn-s3-demo-bucket" ] }, { "Sid": "DecryptSecret", "Effect": "Allow", "Action": ["secretsmanager:GetSecretValue"], "Resource": "arn:aws:secretsmanager:region:account-id:secret:aws/transfer/ *" } ] } Step 2: Create a managed workflow Now you need to create a workflow that contains a decrypt step. To create a workflow that contains a decrypt step 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. 3. In the left navigation pane, choose Workflows, and then choose Create workflow. Enter the following details: • Enter a description, for example Decrypt workflow example. Step 2: Create a managed workflow 37 AWS Transfer Family User Guide • In the Nominal steps section, choose Add step. 4. 5. For Choose step type, choose Decrypt file, and then choose Next. In the Configure parameters dialog box, specify the following: • Enter a descriptive step name, for example, decrypt-step. Spaces are not allowed in step names. • For the Destination for decrypted files, choose Amazon S3. • For the Destination bucket name, choose the same Amazon S3 bucket that you specified as the amzn-s3-demo-bucket in the IAM policy that you created in Step 1. • For the Destination key prefix, enter the name of the prefix (folder) where you want to store your decrypted files in your destination bucket, for example, decrypted-files/. Note Make sure to add a trailing slash (/) to your prefix. • For this tutorial, leave Overwrite existing cleared. When this setting is cleared, if you try to decrypt a file with the identical name of an existing file, the workflow processing stops, and the new
transferfamily-ug-018
transferfamily-ug.pdf
18
Destination bucket name, choose the same Amazon S3 bucket that you specified as the amzn-s3-demo-bucket in the IAM policy that you created in Step 1. • For the Destination key prefix, enter the name of the prefix (folder) where you want to store your decrypted files in your destination bucket, for example, decrypted-files/. Note Make sure to add a trailing slash (/) to your prefix. • For this tutorial, leave Overwrite existing cleared. When this setting is cleared, if you try to decrypt a file with the identical name of an existing file, the workflow processing stops, and the new file is not processed. Choose Next to move to the review screen. 6. Review the details for the step. If everything is correct, choose Create step. 7. Your workflow needs only the single decrypt step, so there are no additional steps to configure. Choose Create workflow to create the new workflow. Note the workflow ID for your new workflow. You will need this ID for the next step. This tutorial uses w-1234abcd5678efghi as the example workflow ID. Step 3: Add the workflow to a server and create a user Now that you have a workflow with a decrypt step, you must associate it with a Transfer Family server. This tutorial shows how to attach the workflow to an existing Transfer Family server. Alternatively, you can create a new server to use with your workflow. After you attach the workflow to a server, you must create a user that can SFTP into the server and trigger the workflow to run. Step 3: Add the workflow to a server and create a user 38 AWS Transfer Family User Guide To configure a Transfer Family server to run a workflow 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. In the left navigation pane, choose Servers, and then choose a server from the list. Make sure that this server supports the SFTP protocol. 3. On the details page for the server, scroll down to the Additional details section, and then choose Edit. 4. On the Edit additional details page, in the Managed workflows section, choose your workflow, and choose a corresponding execution role. • For Workflow for complete file uploads, choose the workflow that you created in Step 2: Create a managed workflow, for example, w-1234abcd5678efghi. • For Managed workflows execution role, choose the IAM role that you created in Step 1: Configure an execution role. 5. Scroll to the bottom of the page, and choose Save to save your changes. Note the ID for the server that you are using. The name of the AWS Secrets Manager secret that you use to store your PGP keys is based in part on the server ID. To add a user that can trigger the workflow 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. In the left navigation pane, choose Servers, and then choose the server that you're using for the decrypt workflow. 3. On the server details page, scroll down to the Users section, and choose Add user. 4. For your new user, enter the following details: • For Username, enter decrypt-user. • For Role, choose a user role that can access your server. • For Home directory, choose the Amazon S3 bucket that you used earlier, for example, amzn-s3-demo-bucket. • For SSH public keys, paste in a public key that corresponds to a private key that you have. For details, see Generate SSH keys for service-managed users. 5. Choose Add to save your new user. Step 3: Add the workflow to a server and create a user 39 AWS Transfer Family User Guide Note the name of your Transfer Family user for this server. The secret is partially based on the name of the user. For simplicity, this tutorial uses a default secret that can be used by any user of the server. Step 4: Create a PGP key pair Use one of the supported PGP clients to generate a PGP key pair. This process is described in detail in Generate PGP keys. To generate a PGP key pair 1. For this tutorial, you can use gpg (GnuPG) version 2.0.22 client to generate a PGP key pair that uses RSA as the encryption algorithm. For this client, run the following command, and provide an email address and a passphrase. You can use any name or email address that you like. Make sure that you remember the values that you use, because you will need to enter them later in the tutorial. gpg --gen-key Note If you're using GnuPG version 2.3.0 or newer, you must run gpg --full-gen-key. When prompted for the type of key to create, choose RSA or ECC. However, if you choose ECC, make sure to choose either NIST or BrainPool for the elliptic curve. Do not choose
transferfamily-ug-019
transferfamily-ug.pdf
19
as the encryption algorithm. For this client, run the following command, and provide an email address and a passphrase. You can use any name or email address that you like. Make sure that you remember the values that you use, because you will need to enter them later in the tutorial. gpg --gen-key Note If you're using GnuPG version 2.3.0 or newer, you must run gpg --full-gen-key. When prompted for the type of key to create, choose RSA or ECC. However, if you choose ECC, make sure to choose either NIST or BrainPool for the elliptic curve. Do not choose Curve 25519. 2. Export the private key by running the following command. Replace [email protected] with the email address that you used when you generated the key. gpg --output workflow-tutorial-key.pgp --armor --export-secret-key [email protected] This command exports the private key to the workflow-tutorial-key.pgp file. You can name the output file anything that you like. You can also delete the private key file after you have added it to AWS Secrets Manager. Step 4: Create a PGP key pair 40 AWS Transfer Family User Guide Step 5: Store the PGP private key in AWS Secrets Manager You need to store the private key in Secrets Manager, in a very specific way, so that the workflow can find the private key when the workflow runs a decrypt step on an uploaded file. Note When you store secrets in Secrets Manager, your AWS account incurs charges. For information about pricing, see AWS Secrets Manager Pricing. To store a PGP private key in Secrets Manager 1. Sign in to the AWS Management Console and open the AWS Secrets Manager console at https://console.aws.amazon.com/secretsmanager/. 2. In the left navigation pane, choose Secrets. 3. On the Secrets page, choose Store a new secret. 4. On the Choose secret type page, for Secret type, choose Other type of secret. 5. In the Key/value pairs section, choose the Key/value tab. • Key – Enter PGPPrivateKey. • value – Paste the text of your private key into the value field. 6. Choose Add row, and in the Key/value pairs section, choose the Key/value tab. • Key – Enter PGPPassphrase. • value – Enter the passphrase that you used when you generated your PGP key pair in Step 4: Create a PGP key pair. 7. Choose Next. 8. On the Configure secret page, enter a name and description for your secret. You can create a secret for a specific user or one that can be used by all users. If your server ID is s-11112222333344445, you name the secret as follows. • To create a default secret for all users, name the secret aws/ transfer/s-11112222333344445/@pgp-default. • To create a secret only for the user that you created earlier, name the secret aws/ transfer/s-11112222333344445/decrypt-user. Step 5: Store the PGP private key in AWS Secrets Manager 41 AWS Transfer Family User Guide 9. Choose Next, and then accept the defaults on the Configure rotation page. Then choose Next. 10. On the Review page, choose Store to create and store the secret. For more information about adding your PGP private key to Secrets Manager, see Use AWS Secrets Manager to store your PGP key. Step 6: Encrypt a file Use the gpg program to encrypt a file for use in your workflow. Run the following command to encrypt a file: gpg -e -r [email protected] --openpgp testfile.txt Before running this command, note the following: • For the -r argument, replace [email protected] with the email address that you used when you created the PGP key pair. • The --openpgp flag is optional. This flag makes the encrypted file conform to the OpenPGP RFC4880 standard. • This command creates a file named testfile.txt.gpg in the same location as testfile.txt. Step 7: Run the workflow and view the results To run the workflow, you connect to the Transfer Family server with the user that you created in Step 3. Then you can look in the Amazon S3 bucket that you specified in Step 2.5, configure destination parameters to see the decrypted file. To run the decrypt workflow 1. Open a command terminal. 2. Run the following command, replacing your-endpoint with your actual endpoint, and transfer-key with your user's SSH private key: sftp -i transfer-key decrypt-user@your-endpoint Step 6: Encrypt a file 42 AWS Transfer Family User Guide For example, if the private key is stored in ~/.ssh/decrypt-user, and your endpoint is s-11112222333344445.server.transfer.us-east-2.amazonaws.com, the command is as follows: sftp -i ~/.ssh/decrypt-user [email protected] east-2.amazonaws.com 3. Run the pwd command. If successful, this command will return the following: Remote working directory: /amzn-s3-demo-bucket/decrypt-user Your directory reflects the name of your Amazon S3 bucket. 4. Run the following command to upload the file and trigger the workflow to run: put testfile.txt.gpg 5. For the destination of the decrypted files, you specified the decrypted-files/ folder when you
transferfamily-ug-020
transferfamily-ug.pdf
20
key: sftp -i transfer-key decrypt-user@your-endpoint Step 6: Encrypt a file 42 AWS Transfer Family User Guide For example, if the private key is stored in ~/.ssh/decrypt-user, and your endpoint is s-11112222333344445.server.transfer.us-east-2.amazonaws.com, the command is as follows: sftp -i ~/.ssh/decrypt-user [email protected] east-2.amazonaws.com 3. Run the pwd command. If successful, this command will return the following: Remote working directory: /amzn-s3-demo-bucket/decrypt-user Your directory reflects the name of your Amazon S3 bucket. 4. Run the following command to upload the file and trigger the workflow to run: put testfile.txt.gpg 5. For the destination of the decrypted files, you specified the decrypted-files/ folder when you created the workflow. Now, you can navigate to that folder and list the contents. cd ../decrypted-files/ ls If successful, the ls command lists the testfile.txt file. You can download this file and verify that it is the same as the original file that you encrypted earlier. Setting up and using SFTP connectors The purpose of a connector is to establish a relationship between your AWS storage and a partner's SFTP server. You can send files from Amazon S3 to an external, partner-owned destination. You can also use an SFTP connector to retrieve files from a partner's SFTP server. This tutorial illustrates how to set up an SFTP connector, and then transfer files between Amazon S3 storage and an SFTP server. An SFTP connector retrieves SFTP credentials from AWS Secrets Manager to authenticate into a remote SFTP server and establish a connection. The connector sends files to or retrieves files from the remote server, and stores the files in Amazon S3. An IAM role is used to allow access to the Create and use SFTP connectors 43 AWS Transfer Family User Guide Amazon S3 bucket and to the credentials stored in Secrets Manager. And you can log to Amazon CloudWatch. The following blog post provides a reference architecture to build an MFT workflow using SFTP connectors, including encryption of files using PGP before sending them to a remote SFTP server using SFTP connectors: Architecting secure and compliant managed file transfers with AWS Transfer Family SFTP connectors and PGP encryption. Topics • Step 1: Create the necessary supporting resources • Step 2: Create and test an SFTP connector • Step 3: Send and retrieve files using the SFTP connector • Procedures to create a Transfer Family server to use as your remote SFTP server Step 1: Create the necessary supporting resources You can use SFTP connectors to copy files between Amazon S3 and any remote SFTP server. For this tutorial, we are using an AWS Transfer Family server as our remote SFTP server. We need to create and configure the following resources: Step 1: Create the necessary supporting resources 44 AWS Transfer Family User Guide • Create Amazon S3 buckets to store files in your AWS environment, and to send and retrieve files from the remote SFTP server: Create Amazon S3 buckets. • Create an AWS Identity and Access Management role for accessing Amazon S3 storage and our secret in Secrets Manager: Create an IAM role with the necessary permissions. • Create a Transfer Family server that uses the SFTP protocol, and a service-managed user that uses the SFTP connector to transfer files to or from the SFTP server: Create a Transfer Family SFTP server and a user. • Create an AWS Secrets Manager secret that stores the credentials used by the SFTP connector to log in to the remote SFTP server: Create and store a secret in AWS Secrets Manager. Create Amazon S3 buckets To create an Amazon S3 bucket 1. Sign in to the AWS Transfer Family console at https://console.aws.amazon.com/s3/. 2. Choose a Region and enter a name. For this tutorial, our bucket is in US East (N. Virginia) us-east-1, and the name is sftp-server-storage-east. 3. Accept the defaults and choose Create bucket. For complete details about creating Amazon S3 buckets, see How do I create an S3 bucket? in the Amazon Simple Storage Service User Guide. Create an IAM role with the necessary permissions For the access role, create a policy with the following permissions. The following example grants the necessary permissions to access the amzn-s3-demo-bucket in Amazon S3, and the specified secret stored in Secrets Manager. { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowListingOfUserFolder", "Action": [ "s3:ListBucket", Step 1: Create the necessary supporting resources 45 AWS Transfer Family User Guide "s3:GetBucketLocation" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket" ] }, { "Sid": "HomeDirObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObjectVersion", "s3:GetObjectACL", "s3:PutObjectACL" ], "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*" }, { "Sid": "GetConnectorSecretValue", "Effect": "Allow", "Action": [ "secretsmanager:GetSecretValue" ], "Resource": "arn:aws:secretsmanager:region:account-id:secret:aws/ transfer/SecretName-6RandomCharacters" } ] } Replace items as follows: • For amzn-s3-demo-bucket, the tutorial uses sftp-server-storage-east. • For region, the tutorial uses us-east-1. • For account-id, use your AWS account ID. • For SecretName-6RandomCharacters, we are using sftp-connector1 for the name
transferfamily-ug-021
transferfamily-ug.pdf
21
"2012-10-17", "Statement": [ { "Sid": "AllowListingOfUserFolder", "Action": [ "s3:ListBucket", Step 1: Create the necessary supporting resources 45 AWS Transfer Family User Guide "s3:GetBucketLocation" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket" ] }, { "Sid": "HomeDirObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObjectVersion", "s3:GetObjectACL", "s3:PutObjectACL" ], "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*" }, { "Sid": "GetConnectorSecretValue", "Effect": "Allow", "Action": [ "secretsmanager:GetSecretValue" ], "Resource": "arn:aws:secretsmanager:region:account-id:secret:aws/ transfer/SecretName-6RandomCharacters" } ] } Replace items as follows: • For amzn-s3-demo-bucket, the tutorial uses sftp-server-storage-east. • For region, the tutorial uses us-east-1. • For account-id, use your AWS account ID. • For SecretName-6RandomCharacters, we are using sftp-connector1 for the name (you will have your own six random characters for your secret). Step 1: Create the necessary supporting resources 46 AWS Transfer Family User Guide You must also make sure that this role contains a trust relationship that allows the connector to access your resources when servicing your users' transfer requests. For details on establishing a trust relationship, see To establish a trust relationship. Note To see the details for the role that we are using for the tutorial, see Combined user and access role. Create and store a secret in AWS Secrets Manager We need to store a secret in Secrets Manager to store user credentials for your SFTP connector. You can use a password, SSH private key, or both. For the tutorial, we are using a private key. Note When you store secrets in Secrets Manager, your AWS account incurs charges. For information about pricing, see AWS Secrets Manager Pricing. Before you begin the procedure to store the secret, retrieve and format your private key. The private key must correspond to the public key that is configured for the user on the remote SFTP server. For our tutorial, the private key must correspond to the public key that is stored for our test user on the Transfer Family SFTP server that we are using as remote server. To do this, run the following command: jq -sR . path-to-private-key-file For example, if your private key file is located in ~/.ssh/sftp-testuser-privatekey, the command is as follows. jq -sR . ~/.ssh/sftp-testuser-privatekey This outputs the key in the correct format (with embedded newline characters) to standard output. Copy this text somewhere, as you need to paste it in the following procedure (in step 6). Step 1: Create the necessary supporting resources 47 AWS Transfer Family User Guide To store user credentials in Secrets Manager for an SFTP connector 1. Sign in to the AWS Management Console and open the AWS Secrets Manager console at https://console.aws.amazon.com/secretsmanager/. 2. In the left navigation pane, choose Secrets. 3. On the Secrets page, choose Store a new secret. 4. On the Choose secret type page, for Secret type, choose Other type of secret. 5. In the Key/value pairs section, choose the Key/value tab. • Key – Enter Username. • value – Enter the name of our user, sftp-testuser. 6. To enter the key, we recommend that you use the Plaintext tab. a. Choose Add row, then enter PrivateKey. b. Choose the Plaintext tab. The field now contains the following text: {"Username":"sftp-testuser","PrivateKey":""} c. Paste in the text for your private key (saved earlier) between the empty double quotes (""). Your screen should look as follows (key data is grayed out). 7. Choose Next. Step 1: Create the necessary supporting resources 48 AWS Transfer Family User Guide 8. On the Configure secret page, enter a name for your secret. For this tutorial, we name the secret aws/transfer/sftp-connector1. 9. Choose Next, and then accept the defaults on the Configure rotation page. Then choose Next. 10. On the Review page, choose Store to create and store the secret. Step 2: Create and test an SFTP connector In this section, we create an SFTP connector that uses all of the resources that we created earlier. For more details, see Creating SFTP connectors. To create an SFTP connector 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. 3. In the left navigation pane, choose SFTP Connectors, then choose Create SFTP connector. In the Connector configuration section, provide the following information: • For the URL, enter the URL of the remote SFTP server. For the tutorial, we enter the URL of the Transfer Family server that we are using as the remote SFTP server. sftp://s-1111aaaa2222bbbb3.server.transfer.us-east-1.amazonaws.com Replace 1111aaaa2222bbbb3 with your Transfer Family server ID. • For the Access role, enter the role we created earlier, sftp-connector-role. • For the Logging role, choose a role that includes a trust policy with transfer.amazonaws.com in the Principal element. Tip: In addition to adding Transfer Family as a trusted entity, you can add the AWSTransferLoggingAccess AWS managed policy to the role. This policy is described in detail in AWSTransferLoggingAccess. Step 2: Create and test an SFTP connector 49 AWS Transfer Family User Guide 4. In the SFTP Configuration section,
transferfamily-ug-022
transferfamily-ug.pdf
22
server that we are using as the remote SFTP server. sftp://s-1111aaaa2222bbbb3.server.transfer.us-east-1.amazonaws.com Replace 1111aaaa2222bbbb3 with your Transfer Family server ID. • For the Access role, enter the role we created earlier, sftp-connector-role. • For the Logging role, choose a role that includes a trust policy with transfer.amazonaws.com in the Principal element. Tip: In addition to adding Transfer Family as a trusted entity, you can add the AWSTransferLoggingAccess AWS managed policy to the role. This policy is described in detail in AWSTransferLoggingAccess. Step 2: Create and test an SFTP connector 49 AWS Transfer Family User Guide 4. In the SFTP Configuration section, provide the following information: • For Connector credentials, choose the name of your Secrets Manager resource that contains SFTP credentials. For the tutorial, choose aws/transfer/sftp-connector1. • For Trusted host keys , paste in the public portion of the host key. You can retrieve this key by running ssh-keyscan for your SFTP server. For details on how to format and store the trusted host key, see the SftpConnectorConfig data type documentation. • For Maximum concurrent connections, select an integer value from 1 to 5: the default value is 5. Step 2: Create and test an SFTP connector 50 AWS Transfer Family User Guide 5. After you have confirmed all of your settings, choose Create connector to create the SFTP connector. After you create an SFTP connector, we recommend that you test it before you attempt to transfer any files using your new connector. Test a connector using the console To test an SFTP connector 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. 3. In the left navigation pane, choose SFTP Connectors, and select a connector. From the Actions menu, choose Test connection. Step 2: Create and test an SFTP connector 51 AWS Transfer Family User Guide The system returns a message, indicating whether the test passes or fails. If the test fails, the system provides an error message based on the reason the test failed. Test a connector using the CLI To test a connector using the AWS Command Line Interface, run the following command at a command prompt (replace connector-id with your actual connector ID): aws transfer test-connection --connector-id c-connector-id If the test is successful, the following lines are returned: { "Status": "OK", "StatusMessage": "Connection succeeded" } Step 2: Create and test an SFTP connector 52 AWS Transfer Family User Guide If the test is unsuccessful, you receive a descriptive error message, for example: { "Status": "ERROR", "StatusMessage": "Unable to assume the configured access role" } Step 3: Send and retrieve files using the SFTP connector For simplicity, we assume that you already have files in your Amazon S3 bucket. Note The tutorial is using Amazon S3 buckets for both source and destination storage locations. If your SFTP server doesn't use Amazon S3 storage, then wherever you see sftp-server- storage-east in the following commands, you can replace the path with a path to file locations accessible from your SFTP server. • We send a file named SEND-to-SERVER.txt from Amazon S3 storage to the SFTP server. • We retrieve a file named RETRIEVE-to-S3.txt from the SFTP server to Amazon S3 storage. Note In the following commands, replace connector-id with your connector ID. First, we send a file from our Amazon S3 bucket to the remote SFTP server. From a command prompt, run the following command: aws transfer start-file-transfer --connector-id c-connector-id --send-file-paths "/ sftp-server-storage-east/SEND-to-SERVER.txt" / --remote-directory-path "/sftp-server-storage-east/incoming" Your sftp-server-storage-east bucket should now look like this. Step 3: Send and retrieve files using the SFTP connector 53 AWS Transfer Family User Guide If you don't see the file as expected, check your CloudWatch logs. To check your CloudWatch logs 1. Open the Amazon CloudWatch console at https://console.aws.amazon.com/cloudwatch/ 2. 3. 4. 5. Select Log groups from the left navigation menu. Enter your connector ID in the search bar to find your logs. Select the Log stream that is returned from the search. Expand the most recent log entry. If successful, the log entry looks like the following: { "operation": "SEND", "timestamp": "2023-12-18T15:26:57.346283Z", "connector-id": "connector-id", "transfer-id": "transfer-id", "file-transfer-id": "transfer-id/file-transfer-id", "url": "sftp://server-id.server.transfer.us-east-1.amazonaws.com", "file-path": "/sftp-server-storage-east/SEND-to-SERVER.txt", Step 3: Send and retrieve files using the SFTP connector 54 AWS Transfer Family User Guide "status-code": "COMPLETED", "start-time": "2023-12-18T15:26:56.915864Z", "end-time": "2023-12-18T15:26:57.298122Z", "account-id": "account-id", "connector-arn": "arn:aws:transfer:us-east-1:account-id:connector/connector-id", "remote-directory-path": "/sftp-server-storage-east/incoming" } If the file transfer failed, the log entry contains an error message that specifies the issue. Common causes for errors are problems with the IAM permissions and incorrect file paths. Next, we retrieve a file from the SFTP server into an Amazon S3 bucket. From a command prompt, run the following command: aws transfer start-file-transfer --connector-id c-connector-id --retrieve-file-paths "/sftp-server-storage-east/RETRIEVE-to-S3.txt" --local-directory-path "/sftp-server- storage-east/incoming" If the transfer succeeds, your Amazon S3 bucket contains the transferred file, as shown here. If successful, the log entry looks like the following: { Step 3: Send and
transferfamily-ug-023
transferfamily-ug.pdf
23
"end-time": "2023-12-18T15:26:57.298122Z", "account-id": "account-id", "connector-arn": "arn:aws:transfer:us-east-1:account-id:connector/connector-id", "remote-directory-path": "/sftp-server-storage-east/incoming" } If the file transfer failed, the log entry contains an error message that specifies the issue. Common causes for errors are problems with the IAM permissions and incorrect file paths. Next, we retrieve a file from the SFTP server into an Amazon S3 bucket. From a command prompt, run the following command: aws transfer start-file-transfer --connector-id c-connector-id --retrieve-file-paths "/sftp-server-storage-east/RETRIEVE-to-S3.txt" --local-directory-path "/sftp-server- storage-east/incoming" If the transfer succeeds, your Amazon S3 bucket contains the transferred file, as shown here. If successful, the log entry looks like the following: { Step 3: Send and retrieve files using the SFTP connector 55 AWS Transfer Family User Guide "operation": "RETRIEVE", "timestamp": "2023-12-18T15:36:40.017800Z", "connector-id": "c-connector-id", "transfer-id": "transfer-id", "file-transfer-id": "transfer-id/file-transfer-id", "url": "sftp://s-server-id.server.transfer.us-east-1.amazonaws.com", "file-path": "/sftp-server-storage-east/RETRIEVE-to-S3.txt", "status-code": "COMPLETED", "start-time": "2023-12-18T15:36:39.727626Z", "end-time": "2023-12-18T15:36:39.895726Z", "account-id": "account-id", "connector-arn": "arn:aws:transfer:us-east-1:account-id:connector/c-connector-id", "local-directory-path": "/sftp-server-storage-east/incoming" } Procedures to create a Transfer Family server to use as your remote SFTP server Following, we outline the steps to create a Transfer Family server that serves as your remote SFTP server for this tutorial. Note the following: • We use a Transfer Family server to represent a remote SFTP server. Typical SFTP connector users have their own remote SFTP server. See Create a Transfer Family SFTP server and a user. • Because we're using a Transfer Family server, we're also using a service-managed SFTP user. And, for simplicity, we combined the permissions that this user needs to access the Transfer Family server with permissions they need to use our connector. Again, most SFTP connector use cases have a separate SFTP user that is not associated with a Transfer Family server. See Create a Transfer Family SFTP server and a user. • For the tutorial, because we are using Amazon S3 storage for our remote SFTP server, we need to create a second bucket, sftp-server-storage-east, so that we can transfer files from one bucket to another. Create a Transfer Family SFTP server and a user Most users won't need to create a Transfer Family SFTP server and a user, as you already have an SFTP server with users, and you can use this server to transfer files to and from. However, for this tutorial, for simplicity, we are using a Transfer Family server to function as the remote SFTP server. Procedures to create a Transfer Family server to use as your remote SFTP server 56 AWS Transfer Family User Guide Follow the procedure described in Create an SFTP-enabled server to create a server, and Step 3: Add a service managed user to add a user. These are the user details that we are using for the tutorial: • Create your service-managed user, sftp-testuser. • Set the home directory to /sftp-server-storage-east/sftp-testuser • When you create the user, you store a public key. Later, when you create the secret in Secrets Manager, you need to provide the corresponding private key. • Role: sftp-connector-role. For the tutorial, we are using the same IAM role for both our SFTP user and for accessing the SFTP connector. When you create connectors for your organization, you might have separate user and access roles. • Server host key: You need to use the server host key when you create the connector. You can retrieve this key by running ssh-keyscan for your server. For example, if your server ID is s-1111aaaa2222bbbb3, and its endpoint is in us-east-1, the following command retrieves the server host key: ssh-keyscan s-1111aaaa2222bbbb3.server.transfer.us-east-1.amazonaws.com Copy this text somewhere, as you need to paste it in the Step 2: Create and test an SFTP connector procedure. Combined user and access role For the tutorial, we are using a single, combined role. We use this role both for our SFTP user, as well as for access to the connector. The following example contains the details for this role, in case you want to perform the tasks in the tutorial. The following example grants the necessary permissions to access our two buckets in Amazon S3, and the secret named aws/transfer/sftp-connector1 stored in Secrets Manager. For the tutorial, this role is named sftp-connector-role. { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowListingOfUserFolder", "Action": [ Procedures to create a Transfer Family server to use as your remote SFTP server 57 AWS Transfer Family User Guide "s3:ListBucket", "s3:GetBucketLocation" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::sftp-server-storage-east", "arn:aws:s3:::sftp-server-storage-east" ] }, { "Sid": "HomeDirObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObjectVersion", "s3:GetObjectACL", "s3:PutObjectACL" ], "Resource": [ "arn:aws:s3:::sftp-server-storage-east/*", "arn:aws:s3:::sftp-server-storage-east/*" ] }, { "Sid": "GetConnectorSecretValue", "Effect": "Allow", "Action": [ "secretsmanager:GetSecretValue" ], "Resource": "arn:aws:secretsmanager:us-east-1:account-id:secret:aws/ transfer/sftp-connector1-6RandomCharacters" } ] } For complete details about creating roles for Transfer Family, follow the procedure described in Create a user role to create a role. Procedures to create a Transfer Family server to use as your remote SFTP server 58 AWS Transfer Family User Guide Setting up an Amazon API Gateway method as
transferfamily-ug-024
transferfamily-ug.pdf
24
Family User Guide "s3:ListBucket", "s3:GetBucketLocation" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::sftp-server-storage-east", "arn:aws:s3:::sftp-server-storage-east" ] }, { "Sid": "HomeDirObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObjectVersion", "s3:GetObjectACL", "s3:PutObjectACL" ], "Resource": [ "arn:aws:s3:::sftp-server-storage-east/*", "arn:aws:s3:::sftp-server-storage-east/*" ] }, { "Sid": "GetConnectorSecretValue", "Effect": "Allow", "Action": [ "secretsmanager:GetSecretValue" ], "Resource": "arn:aws:secretsmanager:us-east-1:account-id:secret:aws/ transfer/sftp-connector1-6RandomCharacters" } ] } For complete details about creating roles for Transfer Family, follow the procedure described in Create a user role to create a role. Procedures to create a Transfer Family server to use as your remote SFTP server 58 AWS Transfer Family User Guide Setting up an Amazon API Gateway method as a custom identity provider This tutorial illustrates how to set up an Amazon API Gateway method and use it as a custom identity provider to upload files to an AWS Transfer Family server. This tutorial uses the Basic stack template, and other basic functionality as an example only. Topics • Prerequisites • Step 1: Create a CloudFormation stack • Step 2: Check the API Gateway method configuration for your server • Step 3: View the Transfer Family server details • Step 4: Test that your user can connect to the server • Step 5: Test the SFTP connection and file transfer • Step 6: Limit access to the bucket • Update Lambda if using Amazon EFS Prerequisites Before you create the Transfer Family resources in AWS CloudFormation, create your storage and your user role. To specify storage and create a user role 1. Depending on which storage you are using, see the following documentation: • To create an Amazon S3 bucket, see How do I create an S3 bucket? in the Amazon Simple Storage Service User Guide. • To create an Amazon EFS file system, see Configure an Amazon EFS file system. 2. To create a user role, see Create an IAM role and policy You enter the details for your storage and your user role when you create your AWS CloudFormation stack in the next section. Use a custom identity provider 59 AWS Transfer Family User Guide Step 1: Create a CloudFormation stack To create an AWS CloudFormation stack from the provided template 1. Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation. 2. 3. Select Create stack, and choose With new resources (standard). In the Prerequisite - Prepare template pane, choose Choose an existing template. 4. Copy this link, Basic stack template, and paste it into the Amazon S3 URL field. 5. Click Next. 6. Specify parameters, including a name for your stack. Be sure to do the following: • Replace the default values for UserName and UserPassword. • For UserHomeDirectory, enter the details for the storage (either an Amazon S3 bucket or an Amazon EFS filesystem) that you created earlier. • Replace the default UserRoleArn with the user role that you created earlier. The AWS Identity and Access Management (IAM) role must have the appropriate permissions. For an example IAM role and bucket policy, see Step 6: Limit access to the bucket. • If you want to authenticate using a public key instead of a password, enter your public key in the UserPublicKey1 field. The first time that you connect to the server using SFTP, you then provide the private key instead of a password. 7. Choose Next, and then choose Next again on the Configure stack options page. 8. Review the details for the stack that you are creating, and then choose Create stack. Note At the bottom of the page, under Capabilities, you must acknowledge that AWS CloudFormation might create IAM resources. Step 1: Create a CloudFormation stack 60 AWS Transfer Family User Guide Step 2: Check the API Gateway method configuration for your server Note To improve security, you can configure a web application firewall. AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to an Amazon API Gateway. For details, see Add a web application firewall. To check the API Gateway method configuration for your server and deploy it 1. Open the API Gateway console at https://console.aws.amazon.com/apigateway/. 2. Choose the Transfer Custom Identity Provider basic template API that the AWS CloudFormation template generated. 3. 4. In the Resources pane, choose GET, and then choose Method Request. For Actions, choose Deploy API. For Deployment stage, choose prod, and then choose Deploy. After the API Gateway method is successfully deployed, view its performance in the Stage Editor section. Note Copy the Invoke URL address that appears at the top of the page. You will need it for the next step. Step 3: View the Transfer Family server details When you use the template to create an AWS CloudFormation stack, a Transfer Family server is automatically created. To view your Transfer Family server details 1. Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation. 2. Choose the stack that you
transferfamily-ug-025
transferfamily-ug.pdf
25
Request. For Actions, choose Deploy API. For Deployment stage, choose prod, and then choose Deploy. After the API Gateway method is successfully deployed, view its performance in the Stage Editor section. Note Copy the Invoke URL address that appears at the top of the page. You will need it for the next step. Step 3: View the Transfer Family server details When you use the template to create an AWS CloudFormation stack, a Transfer Family server is automatically created. To view your Transfer Family server details 1. Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation. 2. Choose the stack that you created. 3. Choose the Resources tab. Step 2: Check the API Gateway method configuration for your server 61 AWS Transfer Family User Guide The server ARN is shown in the Physical ID column for the TransferServer row. The server ID is contained in the ARN, for example s-11112222333344445. 4. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/, and on the Servers page, choose the new server. The server ID matches the ID displayed for the TransferServer resource in AWS CloudFormation. Step 3: View the Transfer Family server details 62 AWS Transfer Family User Guide Step 4: Test that your user can connect to the server To test that your user can connect to the server, using the Transfer Family console 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. On the Servers page, choose your new server, choose Actions, and then choose Test. 3. Enter the text for your sign-in credentials into the Username field, and into the Password field. These are the values that you set when you deployed the AWS CloudFormation stack. 4. For Server Protocol, select SFTP, and for Source IP, enter 127.0.0.1. 5. Choose Test. If user authentication succeeds, the test returns a StatusCode: 200 HTML response and a JSON object containing the details of the user's roles and permissions. For example: { "Response": "{\"Role\": \"arn:aws:iam::123456789012:role/my-user-role\", \"HomeDirectory\": \"/${transfer:HomeBucket}/\"}", "StatusCode": 200, "Message": "", "Url": "https://1a2b3c4d5e.execute-api.us-east-2.amazonaws.com/prod/servers/ s-1234abcd5678efgh0/users/myuser/config" } If the test fails, add one of the API Gateway AWS managed policies to the role that you are using for your API. Step 5: Test the SFTP connection and file transfer To test the SFTP connection 1. On a Linux or macOS device, open a command terminal. 2. Enter one of the following commands, depending on whether you are using a password or a key pair for authentication. • If you are using a password, enter this command: sftp -o PubkeyAuthentication=no myuser@server- ID.server.transfer.region-code.amazonaws.com Step 4: Test that your user can connect to the server 63 AWS Transfer Family User Guide When prompted, enter your password. • If you are using a key pair, enter this command: sftp -i private-key-file [email protected] code.amazonaws.com Note For these sftp commands, insert the code for the AWS Region where your Transfer Family server is located. For example, if your server is in US East (Ohio), enter us- east-2. 3. At the sftp> prompt, make sure that you can upload (put), download (get), and view directories and files (pwd and ls). Step 6: Limit access to the bucket You can limit who can access a specific Amazon S3 bucket. The following example shows the settings to use in your CloudFormation stack and in the policy that you select for your user. In this example, we set the following parameters for the AWS CloudFormation stack: • CreateServer: true • UserHomeDirectory: /amzn-s3-demo-bucket1 • UserName: myuser • UserPassword: MySuperSecretPassword Important This is an example password. When you configure your API Gateway method, make sure that you enter a strong password. • UserPublicKey1: your-public-key • UserRoleArn: arn:aws:iam::role-id:role/myuser-api-gateway-role The UserPublicKey1 is a public key that you have generated as part of a public/private key pair. Step 6: Limit access to the bucket 64 AWS Transfer Family User Guide The role-id is unique to the user role that you create. The policy attached to the myuser-api- gateway-role is the following: { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::amzn-s3-demo-bucket1" }, { "Sid": "VisualEditor1", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObjectAcl", "s3:GetObject", "s3:DeleteObjectVersion", "s3:DeleteObject", "s3:PutObjectAcl", "s3:GetObjectVersion" ], "Resource": "arn:aws:s3:::amzn-s3-demo-bucket1/*" } ] } To connect to the server using SFTP, enter one of the following commands at the prompt. • If you are using a password to authenticate, run the following command: sftp -o PubkeyAuthentication=no myuser@transfer-server- ID.server.transfer.region-id.amazonaws.com When prompted, enter your password. • If you are using a key pair to authenticate, run the following command: sftp -i private-key-file myuser@transfer-server- ID.server.transfer.region-id.amazonaws.com Step 6: Limit access to the bucket 65 AWS Transfer Family Note User Guide For these sftp commands, use the ID for the AWS Region where your Transfer Family server is located. For example, if your server is in US East (Ohio), use us-east-2. At the sftp prompt, you are directed to your home directory, which you
transferfamily-ug-026
transferfamily-ug.pdf
26
prompt. • If you are using a password to authenticate, run the following command: sftp -o PubkeyAuthentication=no myuser@transfer-server- ID.server.transfer.region-id.amazonaws.com When prompted, enter your password. • If you are using a key pair to authenticate, run the following command: sftp -i private-key-file myuser@transfer-server- ID.server.transfer.region-id.amazonaws.com Step 6: Limit access to the bucket 65 AWS Transfer Family Note User Guide For these sftp commands, use the ID for the AWS Region where your Transfer Family server is located. For example, if your server is in US East (Ohio), use us-east-2. At the sftp prompt, you are directed to your home directory, which you can view by running the pwd command. For example: sftp> pwd Remote working directory: /amzn-s3-demo-bucket1 The user cannot view any directories above the home directory. For example: sftp> pwd Remote working directory: /amzn-s3-demo-bucket1 sftp> cd .. sftp> ls Couldn't read directory: Permission denied Update Lambda if using Amazon EFS If you selected Amazon EFS as the storage option for your Transfer Family server, you need to edit the lambda function for your stack. To add a Posix profile to your Lambda function 1. Open the Lambda console at https://console.aws.amazon.com/lambda/. 2. 3. 4. Select the Lambda function that you created earlier. The Lambda function has the format of stack-name-GetUserConfigLambda-lambda-identifier, where stack-name is the CloudFormation stack name and lambda-identifier is the identifier for the function. In the Code tab, select index.js to display the code for the function. In the response, add the following line between Policy and HomeDirectory: PosixProfile: {"Uid": uid-value, "Gid": gid-value}, Where the uid-value and gid-value are integers, 0 or greater, that represent the User ID and Group ID respectively. Update Lambda if using Amazon EFS 66 AWS Transfer Family User Guide For example, after you add the Posix profile, the response field might look like the following: response = { Role: 'arn:aws:iam::123456789012:role/api-gateway-transfer-efs-role', // The user will be authenticated if and only if the Role field is not blank Policy: '', // Optional JSON blob to further restrict this user's permissions PosixProfile: {"Gid": 65534, "Uid": 65534}, HomeDirectory: '/fs-fab2c234' // Not required, defaults to '/' }; Setting up an AS2 configuration This tutorial walks through how to set up an Applicability Statement 2 (AS2) configuration with AWS Transfer Family. After you complete the steps described here, you will have an AS2-enabled server that's ready for accepting AS2 messages from a sample trading partner. You will also have a connector that can be used to send AS2 messages to the sample trading partner. Note Some portions of the example setup use the AWS Command Line Interface (AWS CLI). If you haven't already installed the AWS CLI, see Installing or updating the latest version of the AWS CLI in the AWS Command Line Interface User Guide. 1. Create certificates for yourself and your trading partner. If you have existing certificates that you can use, you can skip this section. This process is described in Step 1: Create certificates for AS2. 2. Import the certificates that you created in step 1. This process is described in Step 3: Import certificates as Transfer Family certificate resources. 3. To set up your trading partners, create a local profile and a partner profile. This process is described in Step 3: Create profiles for you and your trading partner. 4. Create an AWS Transfer Family server that uses the AS2 protocol. Optionally, you can add an Elastic IP address to the server to make it internet-facing. Set up an AS2 configuration 67 AWS Transfer Family User Guide This process is described in Step 4: Create a Transfer Family server that uses the AS2 protocol. Note You must create a Transfer Family server for inbound transfers only. If you're performing only outbound transfers, you don't need a Transfer Family server. 5. Create an agreement between you and your trading partner. This process is described in Step 5: Create an agreement between you and your partner. Note You must create an agreement for inbound transfers only. If you're performing only outbound transfers, you don't need an agreement. 6. Create a connector between you and your trading partner. This process is described in Step 6: Create a connector between you and your partner. Note You must create a connector for outbound transfers only. If you're performing only inbound transfers, you don't need a connector. 7. Test an AS2 file exchange. This process is described in Step 7: Test exchanging files over AS2 by using Transfer Family. After you complete these steps, you can do the following: • Send files to a remote AS2-enabled partner server with the Transfer Family start-file- transfer AWS Command Line Interface (AWS CLI) command. • Receive files from a remote AS2-enabled partner server on port 5080 through your virtual private cloud (VPC) endpoint. Set up an AS2 configuration 68 AWS Transfer Family User Guide Step 1:
transferfamily-ug-027
transferfamily-ug.pdf
27
outbound transfers only. If you're performing only inbound transfers, you don't need a connector. 7. Test an AS2 file exchange. This process is described in Step 7: Test exchanging files over AS2 by using Transfer Family. After you complete these steps, you can do the following: • Send files to a remote AS2-enabled partner server with the Transfer Family start-file- transfer AWS Command Line Interface (AWS CLI) command. • Receive files from a remote AS2-enabled partner server on port 5080 through your virtual private cloud (VPC) endpoint. Set up an AS2 configuration 68 AWS Transfer Family User Guide Step 1: Create certificates for AS2 Both parties in an AS2 exchange need X.509 certificates. You can create these certificates in any way that you like. This topic describes how to use OpenSSL from the command line to create a root certificate, and then sign subordinate certificates. Both parties must generate their own certificates. Note The key length for AS2 certificates must be at least 2048 bits, and at most 4096. To transfer files with a partner, take note of the following: • You can attach certificates to profiles. The certificates contain public or private keys. • Your trading partner sends you their public keys, and you send them yours. • Your trading partner encrypts messages with your public key and signs them with their private key. Conversely, you encrypt messages with your partner's public key and sign them with your private key. Note If you prefer to manage keys with a GUI, Portecle is one option that you can use. To generate example certificates Important Do not send your partner your private keys. In this example, you generate a set of self-signed public and private keys for one party. If you are going to act as both trading partners for testing purposes, you can repeat these instructions to generate two sets of keys: one for each trading partner. In this case, you do not need to generate two root certificate authorities (CAs). 1. Run the following command to generate an RSA private key with a 2048-bit-long modulus. Step 1: Create certificates for AS2 69 AWS Transfer Family User Guide /usr/bin/openssl genrsa -out root-ca-key.pem 2048 2. Run the following command to create a self-signed certificate with your root-ca-key.pem file. /usr/bin/openssl req \ -x509 -new -nodes -sha256 \ -days 1825 \ -subj "/C=US/ST=MA/L=Boston/O=TransferFamilyCustomer/OU=IT-dept/CN=ROOTCA" \ -key root-ca-key.pem \ -out root-ca.pem The -subj argument consists of the following values. C ST L O OU Name Description Country code State, region, or province Locality name Organization name Organizational unit name A two-letter code for the country in which your organization is located. The state, region, or province in which your organization is located. (In this case, region does not refer to your AWS Region.) The city in which your organization is located. The full legal name of your organization, including suffixes, such as LLC, Corp, and so on. The division in your organization that deals with this certificate. Step 1: Create certificates for AS2 70 AWS Transfer Family User Guide Name Description CN Common name or fully qualified domain name (FQDN) In this case, we're creating a root certificate, so the value is ROOTCA. In these examples, we are using CN to describe the purpose of the certificate. 3. Create a signing key and an encryption key for your local profile. /usr/bin/openssl genrsa -out signing-key.pem 2048 /usr/bin/openssl genrsa -out encryption-key.pem 2048 Note Some AS2-enabled servers, such as OpenAS2, require that you use the same certificate for both signing and encryption. In this case, you can import the same private key and certificate for both purposes. To do so, run this command instead of the two previous commands: /usr/bin/openssl genrsa -out signing-and-encryption-key.pem 2048 4. Run the following commands to create Certificate Signing Requests (CSRs) for the root key to sign. /usr/bin/openssl req -new -key signing-key.pem -subj \ "/C=US/ST=MA/L=Boston/O=TransferFamilyCustomer/OU=IT-dept/CN=Signer" -out signing- key-csr.pem /usr/bin/openssl req -new -key encryption-key.pem -subj \ "/C=US/ST=MA/L=Boston/O=TransferFamilyCustomer/OU=IT-dept/CN=Encrypter" -out encryption-key-csr.pem 5. Next, you must create a signing-cert.conf file and an encryption-cert.conf file. • Use a text editor to create the signing-cert.conf file with the following contents: Step 1: Create certificates for AS2 71 AWS Transfer Family User Guide authorityKeyIdentifier=keyid,issuer keyUsage = digitalSignature, nonRepudiation • Use a text editor to create the encryption-cert.conf file with the following contents: authorityKeyIdentifier=keyid,issuer keyUsage = dataEncipherment 6. Finally, you create the signed certificates by running the following commands. /usr/bin/openssl x509 -req -sha256 -CAcreateserial -days 1825 -in signing-key- csr.pem -out signing-cert.pem -CA \ root-ca.pem -CAkey root-ca-key.pem -extfile signing-cert.conf /usr/bin/openssl x509 -req -sha256 -CAcreateserial -days 1825 -in encryption-key- csr.pem -out encryption-cert.pem \ -CA root-ca.pem -CAkey root-ca-key.pem -extfile encryption-cert.conf Step 3: Import certificates as Transfer Family certificate resources This procedure explains how to import certificates by using the AWS CLI. If you want to use the Transfer Family console instead, see the section called
transferfamily-ug-028
transferfamily-ug.pdf
28
text editor to create the encryption-cert.conf file with the following contents: authorityKeyIdentifier=keyid,issuer keyUsage = dataEncipherment 6. Finally, you create the signed certificates by running the following commands. /usr/bin/openssl x509 -req -sha256 -CAcreateserial -days 1825 -in signing-key- csr.pem -out signing-cert.pem -CA \ root-ca.pem -CAkey root-ca-key.pem -extfile signing-cert.conf /usr/bin/openssl x509 -req -sha256 -CAcreateserial -days 1825 -in encryption-key- csr.pem -out encryption-cert.pem \ -CA root-ca.pem -CAkey root-ca-key.pem -extfile encryption-cert.conf Step 3: Import certificates as Transfer Family certificate resources This procedure explains how to import certificates by using the AWS CLI. If you want to use the Transfer Family console instead, see the section called “Import AS2 certificates”. To import the signing and encryption certificates that you created in step 1, run the following import-certificate commands. If you're using the same certificate for encryption and signing, import the same certificate twice (once with the SIGNING usage and again with the ENCRYPTION usage). Note If you have a file that contains both a certificate and its chain, you can provide that file to the import-certificate command using only the certificate parameter. For example: aws transfer import-certificate --usage ENCRYPTION --certificate file://combined-cert-and-chain-file.pem Step 3: Import certificates as Transfer Family certificate resources 72 AWS Transfer Family User Guide If you use the certificate parameter to upload both the certificate and its chain, don't use the certificate-chain parameter. If you combine the certificate and its chain, your key is formatted using conventional PEM standards, which includes a newline “\n” every 64 characters. The certificate that is stored is functionally equivalent to the one you uploaded, with the sole difference that the DescribeCertificate response via the AWS CLI will contain these newline characters. aws transfer import-certificate --usage SIGNING --certificate file://signing-cert.pem \ --private-key file://signing-key.pem --certificate-chain file://root-ca.pem This command returns your signing CertificateId. In the next section, this certificate ID is referred to as my-signing-cert-id. aws transfer import-certificate --usage ENCRYPTION --certificate file://encryption- cert.pem \ --private-key file://encryption-key.pem --certificate-chain file://root- ca.pem This command returns your encryption CertificateId. In the next section, this certificate ID is referred to as my-encrypt-cert-id. Next, import your partner's encryption and signing certificates by running the following commands. aws transfer import-certificate --usage ENCRYPTION --certificate file://partner- encryption-cert.pem \ --certificate-chain file://partner-root-ca.pem This command returns your partner's encryption CertificateId. In the next section, this certificate ID is referred to as partner-encrypt-cert-id. aws transfer import-certificate --usage SIGNING --certificate file://partner-signing- cert.pem \ --certificate-chain file://partner-root-ca.pem This command returns your partner's signing CertificateId. In the next section, this certificate ID is referred to as partner-signing-cert-id. Step 3: Import certificates as Transfer Family certificate resources 73 AWS Transfer Family User Guide Step 3: Create profiles for you and your trading partner This procedure explains how to create AS2 profiles by using AWS CLI. If you want to use the Transfer Family console instead, see the section called “Create AS2 profiles”. Create your local AS2 profile by running the following command. This command references the certificates that contain your public and private keys. aws transfer create-profile --as2-id MYCORP --profile-type LOCAL --certificate-ids \ my-signing-cert-id my-encrypt-cert-id This command returns your profile ID. In the next section, this ID is referred to as my-profile-id. Now create the partner profile by running the following command. This command uses only your partner's public key certificates. To use this command, replace the user input placeholders with your own information; for example, your partner's AS2 name and certificate IDs. aws transfer create-profile --as2-id PARTNER-COMPANY --profile-type PARTNER -- certificate-ids \ partner-signing-cert-id partner-encrypt-cert-id This command returns your partner's profile ID. In the next section, this ID is referred to as partner-profile-id. Note In the previous commands, replace MYCORP with the name of your organization, and PARTNER-COMPANY with the name of your trading partner's organization. Step 4: Create a Transfer Family server that uses the AS2 protocol This procedure explains how to create an AS2-enabled server by using the Transfer Family AWS CLI. Note Many of the example steps use commands that load parameters from a file. For more details about using files to load parameters, see How to load parameters from a file. Step 3: Create profiles for you and your trading partner 74 AWS Transfer Family User Guide If you want to use the console instead, see Create an AS2 server using the Transfer Family console. Similar to how you create an SFTP or FTPS AWS Transfer Family server, you create an AS2-enabled server by using the --protocols AS2 parameter of the create-server AWS CLI command. Currently, Transfer Family supports only VPC endpoint types and Amazon S3 storage with the AS2 protocol. When you create your AS2-enabled server for Transfer Family by using the create-server command, a VPC endpoint is automatically created for you. This endpoint exposes TCP port 5080 so that it can accept AS2 messages. If you want to expose your VPC endpoint publicly to the internet, you can associate Elastic IP addresses with your VPC
transferfamily-ug-029
transferfamily-ug.pdf
29
how you create an SFTP or FTPS AWS Transfer Family server, you create an AS2-enabled server by using the --protocols AS2 parameter of the create-server AWS CLI command. Currently, Transfer Family supports only VPC endpoint types and Amazon S3 storage with the AS2 protocol. When you create your AS2-enabled server for Transfer Family by using the create-server command, a VPC endpoint is automatically created for you. This endpoint exposes TCP port 5080 so that it can accept AS2 messages. If you want to expose your VPC endpoint publicly to the internet, you can associate Elastic IP addresses with your VPC endpoint. To use these instructions, you need the following: • The ID of your VPC (for example, vpc-abcdef01). • The IDs of your VPC subnets (for example, subnet-abcdef01, subnet-subnet-abcdef01, subnet-021345ab). • One or more IDs of the security groups that allow incoming traffic on TCP port 5080 from your trading partners (for example, sg-1234567890abcdef0 and sg-abcdef01234567890). • (Optional) The Elastic IP addresses that you want to associate with your VPC endpoint. • If your trading partner is not connected to your VPC through a VPN, you need an internet gateway. For more information, see Connect to the internet using an internet gateway in the Amazon VPC User Guide. To create an AS2-enabled server 1. Run the following command. Replace each user input placeholder with your own information. aws transfer create-server --endpoint-type VPC \ --endpoint-details VpcId=vpc-abcdef01,SubnetIds=subnet-abcdef01,subnet- abcdef01,subnet- 021345ab,SecurityGroupIds=sg-abcdef01234567890,sg-1234567890abcdef0 --protocols AS2 \ --protocol-details As2Transports=HTTP Step 4: Create a Transfer Family server that uses the AS2 protocol 75 AWS Transfer Family User Guide 2. (Optional) You can make the VPC endpoint public. You can attach Elastic IP addresses to a Transfer Family server only through an update-server operation. The following commands stop the server, update it with Elastic IP addresses, and then start it again. aws transfer stop-server --server-id your-server-id aws transfer update-server --server-id your-server-id --endpoint-details \ AddressAllocationIds=eipalloc-abcdef01234567890,eipalloc- 1234567890abcdef0,eipalloc-abcd012345ccccccc aws transfer start-server --server-id your-server-id This start-server command automatically creates a DNS record for you that contains the public IP address for your server. To give your trading partner access to the server, you provide them with the following information. In this case, your-region refers to your AWS Region. s-your-server-id.server.transfer.your-region.amazonaws.com The full URL that you provide to your trading partner is as follows: http://s-your-server-id.server.transfer.your-region.amazonaws.com:5080 3. To test whether your AS2-enabled server is accessible, use the following commands. Make sure that your server can be accessed either through your VPC endpoint's private DNS address, or through your public endpoint (if you associated an Elastic IP address with your endpoint). If your server is configured correctly, the connection will succeed. However, you will receive an HTTP status code 400 (Bad Request) response because you aren't sending a valid AS2 message. • For a public endpoint (if you associated an Elastic IP address in the previous step), run the following command, substituting your server ID and Region. curl -vv -X POST http://s-your-server-id.transfer.your-region.amazonaws.com:5080 • If you are connecting within your VPC, look up your VPC endpoint's private DNS name by running the following commands. aws transfer describe-server --server-id s-your-server-id Step 4: Create a Transfer Family server that uses the AS2 protocol 76 AWS Transfer Family User Guide This describe-server command returns your VPC endpoint ID in the VpcEndpointId parameter. Use this value to run the following command. aws ec2 describe-vpc-endpoints --vpc-endpoint-ids vpce-your-vpc-endpoint-id This describe-vpc-endpoints command returns a DNSEntries array, with several DnsName parameters. Use the Regional DNS name (the one that does not include the Availability Zone) in the following command. curl -vv -X POST http://vpce-your-vpce.vpce-svc-your-vpce-svc.your- region.vpce.amazonaws.com:5080 For example, the following command shows sample values for the placeholders in the previous command. curl -vv -X POST http://vpce-0123456789abcdefg-fghij123.vpce- svc-11111aaaa2222bbbb.us-east-1.vpce.amazonaws.com:5080 4. (Optional) Configure a logging role. Transfer Family logs the status of messages sent and received in a structured JSON format to Amazon CloudWatch logs. To provide Transfer Family with access to the CloudWatch logs in your account, you must configure a logging role on your server. Create an AWS Identity and Access Management (IAM) role that trusts transfer.amazonaws.com, and attach the AWSTransferLoggingAccess managed policy. For details, see Create an IAM role and policy. Note the Amazon Resource Name (ARN) of the IAM role that you just created, and associate it with the server by running the following update-server command: aws transfer update-server --server-id your-server-id --logging-role arn:aws:iam::your-account-id:role/logging-role-name Note Even though the logging role is optional, we highly recommend setting it up so that you can see the status of your messages and troubleshoot configuration issues. Step 4: Create a Transfer Family server that uses the AS2 protocol 77 AWS Transfer Family User Guide Step 5: Create an agreement between you and your partner This procedure explains how to create AS2 agreements by using the AWS CLI. If you want to use the Transfer Family console instead, see the section called
transferfamily-ug-030
transferfamily-ug.pdf
30
it with the server by running the following update-server command: aws transfer update-server --server-id your-server-id --logging-role arn:aws:iam::your-account-id:role/logging-role-name Note Even though the logging role is optional, we highly recommend setting it up so that you can see the status of your messages and troubleshoot configuration issues. Step 4: Create a Transfer Family server that uses the AS2 protocol 77 AWS Transfer Family User Guide Step 5: Create an agreement between you and your partner This procedure explains how to create AS2 agreements by using the AWS CLI. If you want to use the Transfer Family console instead, see the section called “Create an AS2 agreement”. Agreements bring together the two profiles (local and partner), their certificates, and a server configuration that allows inbound AS2 transfers between two parties. You can list your items by running the following commands. aws transfer list-profiles --profile-type LOCAL aws transfer list-profiles --profile-type PARTNER aws transfer list-servers This step requires an Amazon S3 bucket and IAM role with read/write access to and from the bucket. The instructions for creating this role are the same as for the Transfer Family SFTP, FTP, and FTPS protocols and are available in Create an IAM role and policy. To create an agreement, you need the following items: • The Amazon S3 bucket name (and object prefix, if specified) to store your AS2 files. We recommend that you specify separate directories for different file types. • The ARN of the IAM role with access to the bucket • Your Transfer Family server ID • Your profile ID and your partner's profile ID Save the following code into a file, for example, agreementDetails.json. Replace each user input placeholder with your own information. { "Description": "ExampleAgreementName", "ServerId": "your-server-id", "LocalProfileId": "your-profile-id", "PartnerProfileId": "your-partner-profile-id", "AccessRole": "arn:aws:iam::111111111111:role/TransferAS2AccessRole", "Status": "ACTIVE", "PreserveFilename": "ENABLED", "EnforceMessageSigning": "ENABLED", "CustomDirectories": { Step 5: Create an agreement between you and your partner 78 AWS Transfer Family User Guide "FailedFilesDirectory": "/amzn-s3-demo-destination-bucket/AS2-failed", "MdnFilesDirectory": "/amzn-s3-demo-destination-bucket/AS2-mdn", "PayloadFilesDirectory": "/amzn-s3-demo-destination-bucket/AS2-payload", "StatusFilesDirectory": "/amzn-s3-demo-destination-bucket/AS2-status", "TemporaryFilesDirectory": "/amzn-s3-demo-destination-bucket/AS2-temp" } } Note To use a single base directory instead of separate directories, remove the CustomDirectories line and its individual directory lines from the previous code and use the following parameter instead: "BaseDirectory": "/amzn-s3-demo-destination-bucket/AS2-inbox" Do not use both a base directory and separate directory parameters, or the command will fail. Then, run the following command. aws transfer create-agreement --cli-input-json file://agreementDetails.json If successful, this command returns the ID for the agreement. You can then view the details of the agreement with the following command. aws transfer describe-agreement --agreement-id agreement-id --server-id your-server-id Step 6: Create a connector between you and your partner This procedure explains how to create AS2 connectors by using the AWS CLI. If you want to use the Transfer Family console instead, see the section called “Configure AS2 connectors”. You can use the StartFileTransfer API operation to send files that are stored in Amazon S3 to your trading partner's AS2 endpoint by using a connector. You can find the profiles that you created earlier by running the following command. aws transfer list-profiles Step 6: Create a connector between you and your partner 79 AWS Transfer Family User Guide When you create the connector, you must provide your partner's AS2 server URL. Copy the following text to a file named testAS2Config.json. { "Compression": "ZLIB", "EncryptionAlgorithm": "AES256_CBC", "LocalProfileId": "your-profile-id", "MdnResponse": "SYNC", "MdnSigningAlgorithm": "DEFAULT", "MessageSubject": "Your Message Subject", "PartnerProfileId": "partner-profile-id", "PreserveContentType": "FALSE", "SigningAlgorithm": "SHA256" } Note For EncryptionAlgorithm, do not specify the DES_EDE3_CBC algorithm unless you must support a legacy client that requires it, as it is a weak encryption algorithm. Then run the following command to create the connector. aws transfer create-connector --url "http://partner-as2-server-url" \ --access-role your-IAM-role-for-bucket-access \ --logging-role arn:aws:iam::your-account-id:role/service-role/AWSTransferLoggingAccess \ --as2-config file:///path/to/testAS2Config.json Step 7: Test exchanging files over AS2 by using Transfer Family Receive a file from your trading partner If you associated a public Elastic IP address with your VPC endpoint, Transfer Family automatically created a DNS name that contains your public IP address. The subdomain is your AWS Transfer Family server ID (of the format s-1234567890abcdef0). Provide your server URL to your trading partner in the following format. http://s-1234567890abcdef0.server.transfer.us-east-1.amazonaws.com:5080 Step 7: Test exchanging files over AS2 by using Transfer Family 80 AWS Transfer Family User Guide If you didn't associate a public Elastic IP address with your VPC endpoint, look up the hostname of the VPC endpoint that can accept AS2 messages over HTTP POST from your trading partners on port 5080. To retrieve the VPC endpoint details, use the following command. aws transfer describe-server --server-id s-1234567890abcdef0 For example, assume the preceding command returns a VPC endpoint ID of vpce-1234abcd5678efghi. Then, you would use the following command to retrieve the DNS names. aws ec2 describe-vpc-endpoints --vpc-endpoint-ids vpce-1234abcd5678efghi This command returns all the details for the VPC endpoint that you need to run the following command. The DNS name is listed in the DnsEntries array.
transferfamily-ug-031
transferfamily-ug.pdf
31
address with your VPC endpoint, look up the hostname of the VPC endpoint that can accept AS2 messages over HTTP POST from your trading partners on port 5080. To retrieve the VPC endpoint details, use the following command. aws transfer describe-server --server-id s-1234567890abcdef0 For example, assume the preceding command returns a VPC endpoint ID of vpce-1234abcd5678efghi. Then, you would use the following command to retrieve the DNS names. aws ec2 describe-vpc-endpoints --vpc-endpoint-ids vpce-1234abcd5678efghi This command returns all the details for the VPC endpoint that you need to run the following command. The DNS name is listed in the DnsEntries array. Your trading partner must be within your VPC to access your VPC endpoint (for example through AWS PrivateLink or a VPN). Provide your VPC endpoint URL to your partner in the following format. http://vpce-your-vpce-id.vpce-svc-your-vpce-svc-id.your-region.vpce.amazonaws.com:5080 For example, the following URL shows sample values for the placeholders in the previous commands. http://vpce-0123456789abcdefg-fghij123.vpce-svc-11111aaaa2222bbbb.us- east-1.vpce.amazonaws.com:5080 In this example, successful transfers are stored at the location that's specified in the base-directory parameter that you specified in Step 5: Create an agreement between you and your partner. If we successfully receive files named myfile1.txt and myfile2.txt, the files are stored as /path-defined-in-the-agreement/ processed/original_filename.messageId.original_extension. Here, the files are stored as /amzn-s3-demo-destination-bucket/AS2-inbox/processed/ myfile1.messageId.txt and /amzn-s3-demo-destination-bucket/AS2-inbox/ processed/myfile2.messageId.txt. If you configured a logging role when you created your Transfer Family server, you can also check your CloudWatch logs for the status of AS2 messages. Step 7: Test exchanging files over AS2 by using Transfer Family 81 AWS Transfer Family User Guide Send a file to your trading partner You can use Transfer Family to send AS2 messages by referencing the connector ID and the paths to the files, as illustrated in the following start-file-transfer AWS Command Line Interface (AWS CLI) command: aws transfer start-file-transfer --connector-id c-1234567890abcdef0 \ --send-file-paths "/amzn-s3-demo-source-bucket/myfile1.txt" "/amzn-s3-demo-source- bucket/myfile2.txt" To get the details for your connectors, run the following command: aws transfer list-connectors The list-connectors command returns the connector IDs, URLs, and Amazon Resource Names (ARNs) for your connectors. To return the properties of a particular connector, run the following command with the ID that you want to use: aws transfer describe-connector --connector-id your-connector-id The describe-connector command returns all of the properties for the connector, including its URL, roles, profiles, Message Disposition Notices (MDNs), tags, and monitoring metrics. You can confirm that the partner successfully received the files by viewing the JSON and MDN files. These files are named according to the conventions described in File names and locations. If you configured a logging role when you created the connector, you can also check your CloudWatch logs for the status of AS2 messages. Setting up a Transfer Family web app This tutorial walks through how to set up a Transfer Family web app. Transfer Family web apps enable a simple interface for transferring data to and from Amazon S3 over a web browser. For detailed documentation for this feature, see Transfer Family web apps. Set up a web app 82 AWS Transfer Family User Guide Web app tutorial: prerequisites • Create either an account instance or organization instance of AWS IAM Identity Center. For details, see Configure your identity provider for Transfer Family web apps. If you are not using IAM Identity Center as your identity provider, Integrate Okta as your identity provider for web apps illustrates how to use an alternative (in this case Okta) identity provider. • You need an Amazon S3 bucket to use for interacting with your Transfer Family web app. For details, see Configure an Amazon S3 bucket Note This tutorial assumes that you are using the IAM Identity Center directory for your identity provider, If that is not the case, see Configure your identity provider for Transfer Family web apps before proceeding with this tutorial. After you complete the tutorial, your user can log in and interact with the web app that you create. Step 1: Create the necessary supporting resources You need to add a user to your IAM Identity Center directory. You also need two roles: one to use as an identity bearer role for your web app, and a second to use for configuring an Amazon S3 access grant. For the tutorial, we allow AWS services to create these roles for us. To add a user 1. Sign in to the AWS Management Console and open the AWS IAM Identity Center console at https://console.aws.amazon.com/singlesignon/. 2. From the left navigation pane, choose Users. 3. Choose Add user and specify the user details. Specify a username, email address, and other required information. You can choose to either send an email to the user with instructions for setting up their password, or you can generate a one-time password to share with them. 4. Choose Next and optionally assign the new user to one or more groups. 5. Choose Next and review your
transferfamily-ug-032
transferfamily-ug.pdf
32
roles for us. To add a user 1. Sign in to the AWS Management Console and open the AWS IAM Identity Center console at https://console.aws.amazon.com/singlesignon/. 2. From the left navigation pane, choose Users. 3. Choose Add user and specify the user details. Specify a username, email address, and other required information. You can choose to either send an email to the user with instructions for setting up their password, or you can generate a one-time password to share with them. 4. Choose Next and optionally assign the new user to one or more groups. 5. Choose Next and review your choices. Prerequisites 83 AWS Transfer Family User Guide If everything looks good, choose Add user to create the new user with the details that you specified. For the tutorial, the example user is Bob Stiles, username bobstiles and email address [email protected]. Step 2: Create a Transfer Family web app To create a Transfer Family web app 1. Sign in to the AWS Management Console and open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. In the left navigation pane, choose Web apps. 3. Choose Create web app. For authentication access, note that the service automatically finds the AWS IAM Identity Center instance that you set up as a prerequisite. 4. In the Permission type pane, select Create and use a new service role. The service creates the identity bearer role for you. An identity bearer role includes an authenticated user's identity in its sessions. 5. In the Web app units pane, accept the default value of 1, or adjust to a higher value if needed. 6. Add a tag to help you organize your web apps. For the tutorial, enter Name for the key and Tutorial web app for the value. Tip You can edit the web app name directly from the Web apps list page after you create it. 7. Choose Next to open the Design web app page. On this screen, provide the following information. You can optionally provide a title for your web app. You can also upload image files for your logo and favicon. Step 2: Create a Transfer Family web app 84 AWS Transfer Family User Guide • For the page title, customize the title for the browser tab that your users see when they connect to the web app. If you don't enter anything for the page title, it defaults to Transfer Web App. • For the logo, upload an image file. The maximum file size for your logo image is 50 KB. • For the favicon, upload an image file. The maximum file size for your favicon is 20 KB. 8. Choose Next, then choose Create web app. To provide a branded experience, you can provide a custom URL for your users to access your Transfer Family web app. For details, see Update your access endpoint with a custom URL. Step 3: Configure Cross-origin resource sharing (CORS) for your bucket You must set up cross-origin resource sharing (CORS) for all buckets that are used by your web app. A CORS configuration is a document that defines rules that identify the origins that you will allow to access your bucket. For more information about CORS, see Configuring cross-origin resource sharing (CORS). To set up Cross-origin resource sharing (CORS) for your Amazon S3 bucket 1. Sign in to the AWS Management Console and open the Amazon S3 console at https:// console.aws.amazon.com/s3/. 2. Choose Buckets from the left navigation panel and search for your bucket in the search dialog, then choose the Permissions tab. 3. In Cross-origin resource sharing (CORS), choose Edit and paste in the following code. Replace AccessEndpoint with the actual access endpoint for your web app. Make sure not to enter trailing slashes, because doing so causes errors when users attempt to log on to your web app. • Incorrect example: https://webapp-c7bf3423.transfer-webapp.us- east-2.on.aws/ • Correct example: https://webapp-c7bf3423.transfer-webapp.us-east-2.on.aws If you are reusing a bucket for multiple web apps, append their web app access endpoints to the AllowedOrigins list. [ { Step 3: Configure Cross-origin resource sharing (CORS) for your bucket 85 AWS Transfer Family User Guide "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "PUT", "POST", "DELETE", "HEAD" ], "AllowedOrigins": [ "https://AccessEndpoint" ], "ExposeHeaders": [ "last-modified", "content-length", "etag", "x-amz-version-id", "content-type", "x-amz-request-id", "x-amz-id-2", "date", "x-amz-cf-id", "x-amz-storage-class", "access-control-expose-headers" ], "MaxAgeSeconds": 3000 } ] 4. Choose Save changes to update the CORS. Step 4: Add a user to your Transfer Family web app Add the user that you previously created in IAM Identity Center. To assign users to a Transfer Family web app 1. Navigate to the web app that you created earlier. 2. Choose Assign users and groups. Step 4: Add a user to your Transfer Family web app 86 AWS Transfer Family User Guide 3. To assign the user that you previously created in IAM Identity
transferfamily-ug-033
transferfamily-ug.pdf
33
"last-modified", "content-length", "etag", "x-amz-version-id", "content-type", "x-amz-request-id", "x-amz-id-2", "date", "x-amz-cf-id", "x-amz-storage-class", "access-control-expose-headers" ], "MaxAgeSeconds": 3000 } ] 4. Choose Save changes to update the CORS. Step 4: Add a user to your Transfer Family web app Add the user that you previously created in IAM Identity Center. To assign users to a Transfer Family web app 1. Navigate to the web app that you created earlier. 2. Choose Assign users and groups. Step 4: Add a user to your Transfer Family web app 86 AWS Transfer Family User Guide 3. To assign the user that you previously created in IAM Identity Center, select Assign existing users and groups and select Next. a. Search for the user by the display name. Note that no users appear until you begin entering your search criteria. To add Bob Stiles, enter bob in the search box. If you can't find your user, navigate to the IAM Identity Center management console, find the user, then copy and paste their display name here. b. Choose the Bob Stiles user, then choose Assign. Step 5: Register a location in Amazon S3 and create an access grant After you assign a user to your web app, you need to register a bucket and create an access grant for that user. Step 5: Register a location in Amazon S3 and create an access grant 87 AWS Transfer Family Note User Guide You must have an S3 Access Grants instance before you can proceed. For details, see Create an S3 Access Grants instance in the Amazon Simple Storage Service User Guide. To register a location and create an access grant 1. Sign in to the AWS Management Console and open the Amazon S3 console at https:// console.aws.amazon.com/s3/. 2. Choose Access Grants from the left navigation pane. 3. Choose View details to see the details for your S3 Access Grants instance. 4. Select the Locations tab, then choose Register location. 5. Provide the following information. • For the Scope, browse for a bucket or enter the name of your bucket, and optionally a prefix. Note that the scope begins with the string s3://. • For the IAM role, choose Create new role to have Amazon S3 create a role. This role allows S3 Access Grants to access your specified location scope. Step 5: Register a location in Amazon S3 and create an access grant 88 AWS Transfer Family User Guide Choose Register location to continue. 6. Select the Grants tab, then choose Create Grant and provide the following details. • For Location, select Browse locations and choose the location that you registered in the previous step. • For Subprefix, enter * to indicate that the access grant applies to the entire bucket. • For Permissions, select Read and Write. • For Grantee type, choose Directory identity from IAM Identity Center. • For Directory identity type, select User. • In IAM Identity Center user/ ID, copy and paste the user ID for Bob Stiles. This ID is available in the Users pane in your Transfer Family web app. 7. Choose Create Grant. The access grant is created. Step 6: Access your Transfer Family web app as a user Now, we navigate to the web app's URL and log in as the user that we assigned earlier. To log onto the Transfer Family web app 1. Navigate to your web app 2. Choose the Access endpoint from the Web app details pane. Step 6: Access your Transfer Family web app as a user 89 AWS Transfer Family User Guide 3. On the sign in screen, enter the user you created, bobstiles, then select Next. 4. 5. Enter the password that the system assigned to this user when created and select Next. If your organization requires multi-factor authentication (MFA), you need to set it up now. If not, skip ahead to step 6. a. You are presented with a screen to register your MFA device. Choose one of the available options and select Next. b. Perform the necessary steps to configure MFA for this user: the steps depend upon the MFA option you chose. c. You may have to set a new password for your user: if required, do so now. The system may also require that you sign in again, using the new MFA credentials that you configured. Your use should see a screen similar to the following. Note that this screenshot includes customization for the favicon and logo. Step 6: Access your Transfer Family web app as a user 90 AWS Transfer Family User Guide Integrate Okta as your identity provider for web apps You can integrate an external identity provider with Transfer Family web apps. This section describes how to set up Okta as your identity provider. 1. In Okta, create a user, group, and application. For details on how to do
transferfamily-ug-034
transferfamily-ug.pdf
34
require that you sign in again, using the new MFA credentials that you configured. Your use should see a screen similar to the following. Note that this screenshot includes customization for the favicon and logo. Step 6: Access your Transfer Family web app as a user 90 AWS Transfer Family User Guide Integrate Okta as your identity provider for web apps You can integrate an external identity provider with Transfer Family web apps. This section describes how to set up Okta as your identity provider. 1. In Okta, create a user, group, and application. For details on how to do this, see Configure SAML and SCIM with Okta and IAM Identity Center. Integrate Okta as your identity provider for web apps 91 AWS Transfer Family User Guide 2. Connect Okta and import user and group from Okta to AWS IAM Identity Center. Follow steps 1–4 in Configure SAML and SCIM with Okta and IAM Identity Center. Integrate Okta as your identity provider for web apps 92 AWS Transfer Family User Guide 3. Confirm that the identity source in IAM Identity Center is SAML 2.0. 4. Assign your user and group, as described in Step 4: Add a user to your Transfer Family web app. 5. To avoid having your users need to use MFA when logging into your web app, perform the following steps in Okta. a. From the Okta admin console, access [Applications] - [Applications], and select the AWS IAM Identity Center application. b. On the Sign on tab, select [User authentication] - Edit. c. Select Password only. Integrate Okta as your identity provider for web apps 93 AWS Transfer Family User Guide After you perform all of the other steps for the tutorial, your user should be able to access your Transfer Family web app by navigating to the web app's access endpoint in a web browser. Integrate Okta as your identity provider for web apps 94 AWS Transfer Family User Guide Configuring an SFTP, FTPS, or FTP server endpoint This topic provides details for creating and using AWS Transfer Family server endpoints that use one or more of the SFTP, FTPS, and FTP protocols. Topics • Identity provider options • AWS Transfer Family endpoint type matrix • Configuring an SFTP, FTPS, or FTP server endpoint • Transferring files over a server endpoint using a client • Managing users for server endpoints • Using logical directories to simplify your Transfer Family directory structures Identity provider options AWS Transfer Family provides several methods for authenticating and managing users. The following table compares the available identity providers that you can use with Transfer Family. Action AWS Transfer Family service AWS Managed Microsoft AD Amazon API Gateway AWS Lambda managed SFTP SFTP, FTPS, FTP SFTP, FTPS, FTP SFTP, FTPS, FTP Yes No Yes No Yes Yes Yes Yes Yes Yes Yes Yes Supported protocols Key-based authentication Password authentication AWS Identity and Access Management (IAM) and POSIX Identity provider options 95 AWS Transfer Family service AWS Managed Microsoft AD Amazon API Gateway AWS Lambda User Guide AWS Transfer Family Action Logical home directory Parameter ized access (username- based) managed Yes Yes Ad hoc access structure Yes AWS WAF No Notes: Yes Yes No No Yes Yes Yes Yes Yes Yes Yes No • IAM is used to control access for Amazon S3 backing storage, and POSIX is used for Amazon EFS. • Ad hoc refers to the ability to send the user profile at runtime. For example, you can land users in their home directories by passing the username as a variable. • For details about AWS WAF, see Add a web application firewall. • There is a blog post that describes using a Lambda function integrated with Microsoft Entra ID (formerly Azure AD) as your Transfer Family identity provider. For details, see Authenticating to AWS Transfer Family with Azure Active Directory and AWS Lambda. • We provide several AWS CloudFormation templates to help you quickly deploy a Transfer Family server that uses a custom identity provider. For details, see Lambda function templates. In the following procedures, you can create an SFTP-enabled server, FTPS-enabled server, FTP- enabled server, or AS2-enabled server. Next step • Create an SFTP-enabled server • Create an FTPS-enabled server Identity provider options 96 AWS Transfer Family • Create an FTP-enabled server • Configuring AS2 User Guide AWS Transfer Family endpoint type matrix When you create a Transfer Family server, you choose the type of endpoint to use. The following table describes characteristics for each type of endpoint. Endpoint type matrix Characteristic Public VPC - Internet VPC - Internal VPC_Endpoint (deprecated) Supported protocols Access SFTP SFTP, FTPS, AS2 SFTP, FTP, FTPS, AS2 SFTP From over the internet. This Over the internet and From within VPC and VPC-conne From within VPC and VPC-conne endpoint type from within VPC cted environme
transferfamily-ug-035
transferfamily-ug.pdf
35
server Identity provider options 96 AWS Transfer Family • Create an FTP-enabled server • Configuring AS2 User Guide AWS Transfer Family endpoint type matrix When you create a Transfer Family server, you choose the type of endpoint to use. The following table describes characteristics for each type of endpoint. Endpoint type matrix Characteristic Public VPC - Internet VPC - Internal VPC_Endpoint (deprecated) Supported protocols Access SFTP SFTP, FTPS, AS2 SFTP, FTP, FTPS, AS2 SFTP From over the internet. This Over the internet and From within VPC and VPC-conne From within VPC and VPC-conne endpoint type from within VPC cted environme cted environme doesn't require and VPC-conne nts, such as nts, such as any special cted environme an on-premis an on-premis configuration in nts, such as es data center es data center your VPC. an on-premis over AWS Direct over AWS Direct es data center Connect or VPN. Connect or VPN. Static IP address You can’t attach a static IP address. AWS provides IP addresses that are subject to change. over AWS Direct Connect or VPN. You can attach Elastic IP addresses to the endpoint. These can be AWS-owned IP addresses or your own IP addresses (Bring your own IP addresses Private IP addresses attached to the endpoint don't change. Private IP addresses attached to the endpoint don't change. AWS Transfer Family endpoint type matrix 97 AWS Transfer Family Characteristic Public VPC - Internet VPC - Internal User Guide VPC_Endpoint (deprecated) ). Elastic IP addresses attached to the endpoint don't change. Private IP addresses attached to the server also don't change. AWS Transfer Family endpoint type matrix 98 AWS Transfer Family Characteristic Public VPC - Internet VPC - Internal User Guide VPC_Endpoint (deprecated) Source IP allow list This endpoint type does not To allow access by source IP To allow access by source IP To allow access by source IP support allow address, you address, you address, you lists by source IP can use security can use security can use security addresses. groups attached groups attached groups attached The endpoint is publicly accessible and listens for traffic over port 22. to the server to the server to the server endpoints and endpoints and endpoints and network ACLs network access network ACLs attached to the control lists attached to the subnet that the (network ACLs) subnet that the endpoint is in. attached to the endpoint is in. subnet that the endpoint is in. Note For VPC- hosted endpoints , SFTP Transfer Family servers can operate over port 22 (the default), 2222, 2223, or 22000. AWS Transfer Family endpoint type matrix 99 AWS Transfer Family Characteristic Public VPC - Internet VPC - Internal User Guide VPC_Endpoint (deprecated) Client firewall allow list You must allow the DNS name You can allow the DNS name You can allow the private IP You can allow the private IP of the server. of the server addresses or the addresses or the or the Elastic DNS name of DNS name of IP addresses the endpoints. the endpoints. attached to the server. Because IP addresses are subject to change, avoid using IP addresses for your client firewall allow list. Note The VPC_ENDPOINT endpoint type is now deprecated and cannot be used to create new servers. Instead of using EndpointType=VPC_ENDPOINT, use the new VPC endpoint type (EndpointType=VPC), which you can use as either Internal or Internet Facing, as described in the preceding table. For details, see Discontinuing the use of VPC_ENDPOINT. Consider the following options to increase the security posture of your AWS Transfer Family server: • Use a VPC endpoint with internal access, so that the server is accessible only to clients within your VPC or VPC-connected environments such as an on-premises data center over AWS Direct Connect or VPN. • To allow clients to access the endpoint over the internet and protect your server, use a VPC endpoint with internet-facing access. Then, modify the VPC's security groups to allow traffic only from certain IP addresses that host your users' clients. • If you require password-based authentication and you use a custom identity provider with your server, it's a best practice that your password policy prevents users from creating weak passwords and limits the number of failed login attempts. AWS Transfer Family endpoint type matrix 100 AWS Transfer Family User Guide • AWS Transfer Family is a managed service, and so it doesn't provide shell access. You cannot directly access the underlying SFTP server to run OS native commands on Transfer Family servers. • Use a Network Load Balancer in front of a VPC endpoint with internal access. Change the listener port on the load balancer from port 22 to a different port. This can reduce, but not eliminate, the risk of port scanners and bots probing your server, because port 22 is most commonly used for scanning. For
transferfamily-ug-036
transferfamily-ug.pdf
36
AWS Transfer Family endpoint type matrix 100 AWS Transfer Family User Guide • AWS Transfer Family is a managed service, and so it doesn't provide shell access. You cannot directly access the underlying SFTP server to run OS native commands on Transfer Family servers. • Use a Network Load Balancer in front of a VPC endpoint with internal access. Change the listener port on the load balancer from port 22 to a different port. This can reduce, but not eliminate, the risk of port scanners and bots probing your server, because port 22 is most commonly used for scanning. For details, see the blog post Network Load Balancers now support Security groups. Note If you use a Network Load Balancer, the AWS Transfer Family CloudWatch logs show the IP address for the NLB, rather than the actual client IP address. Configuring an SFTP, FTPS, or FTP server endpoint You can create a file transfer server by using the AWS Transfer Family service. The following file transfer protocols are available: • Secure Shell (SSH) File Transfer Protocol (SFTP) – File transfer over SSH. For details, see the section called “Create an SFTP-enabled server”. Note We provide an AWS CDK example for creating an SFTP Transfer Family server. The example uses TypeScript, and is available on GitHub here. • File Transfer Protocol Secure (FTPS) – File transfer with TLS encryption. For details, see the section called “Create an FTPS-enabled server”. • File Transfer Protocol (FTP) – Unencrypted file transfer. For details, see the section called “Create an FTP-enabled server”. • Applicability Statement 2 (AS2) – File transfer for transporting structured business-to-business data. For details, see the section called “Configure AS2”. For AS2, you can quickly create an AWS CloudFormation stack for demonstration purposes. This procedure is described in Use a template to create a demo Transfer Family AS2 stack. You can create a server with multiple protocols. Configure a Transfer Family server endpoint 101 AWS Transfer Family Note User Guide If you have multiple protocols enabled for the same server endpoint and you want to provide access by using the same username over multiple protocols, you can do so as long as the credentials specific to the protocol have been set up in your identity provider. For FTP, we recommend maintaining separate credentials from SFTP and FTPS. This is because, unlike SFTP and FTPS, FTP transmits credentials in clear text. By isolating FTP credentials from SFTP or FTPS, if FTP credentials are shared or exposed, your workloads using SFTP or FTPS remain secure. When you create a server, you choose a specific AWS Region to perform the file operation requests of users who are assigned to that server. Along with assigning the server one or more protocols, you also assign one of the following identity provider types: • Service managed by using SSH keys. For details, see Working with service-managed users. • AWS Directory Service for Microsoft Active Directory (AWS Managed Microsoft AD). This method allows you integrate your Microsoft Active Directory groups to provide access to your Transfer Family servers. For details, see Using AWS Directory Service for Microsoft Active Directory. • A custom identity provider. Transfer Family offers several options for using a custom identity provider, as described in the Working with custom identity providers topic. You also assign the server an endpoint type (publicly accessible or VPC hosted) and a hostname by using the default server endpoint, or a custom hostname by using the Amazon Route 53 service or by using a Domain Name System (DNS) service of your choice. A server hostname must be unique in the AWS Region where it's created. Additionally, you can assign an Amazon CloudWatch logging role to push events to your CloudWatch logs, choose a security policy that contains the cryptographic algorithms that are enabled for use by your server, and add metadata to the server in the form of tags that are key- value pairs. Configure a Transfer Family server endpoint 102 AWS Transfer Family Important User Guide You incur costs for instantiated servers and for data transfer. For information about pricing and to use AWS Pricing Calculator to get an estimate of the cost to use Transfer Family, see AWS Transfer Family pricing. Create an SFTP-enabled server Secure Shell (SSH) File Transfer Protocol (SFTP) is a network protocol used for secure transfer of data over the internet. The protocol supports the full security and authentication functionality of SSH. It's widely used to exchange data, including sensitive information between business partners in a variety of industries such as financial services, healthcare, retail, and advertising. Note the following • SFTP servers for Transfer Family operate over port 22. For VPC-hosted endpoints, SFTP Transfer Family servers can also operate over port 2222, 2223 or 22000. For details, see Create a server in a virtual
transferfamily-ug-037
transferfamily-ug.pdf
37
Family pricing. Create an SFTP-enabled server Secure Shell (SSH) File Transfer Protocol (SFTP) is a network protocol used for secure transfer of data over the internet. The protocol supports the full security and authentication functionality of SSH. It's widely used to exchange data, including sensitive information between business partners in a variety of industries such as financial services, healthcare, retail, and advertising. Note the following • SFTP servers for Transfer Family operate over port 22. For VPC-hosted endpoints, SFTP Transfer Family servers can also operate over port 2222, 2223 or 22000. For details, see Create a server in a virtual private cloud. • Public endpoints cannot restrict traffic via security groups. To use security groups with your Transfer Family server, you must host your server's endpoint inside a virtual private cloud (VPC) as described in Create a server in a virtual private cloud. See also • We provide an AWS CDK example for creating an SFTP Transfer Family server. The example uses TypeScript, and is available on GitHub here. • For a walkthrough of how to deploy a Transfer Family server inside of a VPC, see Use IP allow list to secure your AWS Transfer Family servers. To create an SFTP-enabled server 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/ and 2. 3. select Servers from the navigation pane, then choose Create server. In Choose protocols, select SFTP, and then choose Next. In Choose an identity provider, choose the identity provider that you want to use to manage user access. You have the following options: Create an SFTP-enabled server 103 AWS Transfer Family User Guide • Service managed – You store user identities and keys in AWS Transfer Family. • AWS Directory Service for Microsoft Active Directory – You provide an AWS Directory Service directory to access the endpoint. By doing so, you can use credentials stored in your Active Directory to authenticate your users. To learn more about working with AWS Managed Microsoft AD identity providers, see Using AWS Directory Service for Microsoft Active Directory. Note • Cross-Account and Shared directories are not supported for AWS Managed Microsoft AD. • To set up a server with Directory Service as your identity provider, you need to add some AWS Directory Service permissions. For details, see Before you start using AWS Directory Service for Microsoft Active Directory. • Custom identity provider – Choose either of the following options: • Use AWS Lambda to connect your identity provider – You can use an existing identity provider, backed by a Lambda function. You provide the name of the Lambda function. For more information, see Using AWS Lambda to integrate your identity provider. • Use Amazon API Gateway to connect your identity provider – You can create an API Gateway method backed by a Lambda function for use as an identity provider. You provide an Amazon API Gateway URL and an invocation role. For more information, see Using Amazon API Gateway to integrate your identity provider. Create an SFTP-enabled server 104 AWS Transfer Family User Guide 4. Choose Next. 5. In Choose an endpoint, do the following: a. For Endpoint type, choose the Publicly accessible endpoint type. For a VPC hosted endpoint, see Create a server in a virtual private cloud. b. (Optional) For Custom hostname, choose None. You get a server hostname provided by AWS Transfer Family. The server hostname takes the form serverId.server.transfer.regionId.amazonaws.com. Create an SFTP-enabled server 105 AWS Transfer Family User Guide For a custom hostname, you specify a custom alias for your server endpoint. To learn more about working with custom hostnames, see Working with custom hostnames. c. (Optional) For FIPS Enabled, select the FIPS Enabled endpoint check box to ensure that the endpoint complies with Federal Information Processing Standards (FIPS). Note FIPS-enabled endpoints are only available in North American AWS Regions. For available Regions, see AWS Transfer Family endpoints and quotas in the AWS General Reference. For more information about FIPS, see Federal Information Processing Standard (FIPS) 140-2 . d. Choose Next. 6. On the Choose domain page, choose the AWS storage service that you want to use to store and access your data over the selected protocol: • Choose Amazon S3 to store and access your files as objects over the selected protocol. • Choose Amazon EFS to store and access your files in your Amazon EFS file system over the selected protocol. Choose Next. 7. In Configure additional details, do the following: a. For logging, specify an existing log group or create a new one (the default option). If you choose an existing log group, you must select one that is associated with your AWS account. Create an SFTP-enabled server 106 AWS Transfer Family User Guide If you choose Create log group, the CloudWatch console (https:// console.aws.amazon.com/cloudwatch/) opens to the Create log group page. For details,
transferfamily-ug-038
transferfamily-ug.pdf
38
as objects over the selected protocol. • Choose Amazon EFS to store and access your files in your Amazon EFS file system over the selected protocol. Choose Next. 7. In Configure additional details, do the following: a. For logging, specify an existing log group or create a new one (the default option). If you choose an existing log group, you must select one that is associated with your AWS account. Create an SFTP-enabled server 106 AWS Transfer Family User Guide If you choose Create log group, the CloudWatch console (https:// console.aws.amazon.com/cloudwatch/) opens to the Create log group page. For details, see Create a log group in CloudWatch Logs. b. (Optional) For Managed workflows, choose workflow IDs (and a corresponding role) that Transfer Family should assume when executing the workflow. You can choose one workflow to execute upon a complete upload, and another to execute upon a partial upload. To learn more about processing your files by using managed workflows, see AWS Transfer Family managed workflows. Create an SFTP-enabled server 107 AWS Transfer Family User Guide c. d. For Cryptographic algorithm options, choose a security policy that contains the cryptographic algorithms enabled for use by your server. Our latest security policy is the default: for details, see Security policies for AWS Transfer Family servers. (Optional) For Server Host Key, enter an RSA, ED25519, or ECDSA private key that will be used to identify your server when clients connect to it over SFTP. You can also add a description to differentiate among multiple host keys. After you create your server, you can add additional host keys. Having multiple host keys is useful if you want to rotate keys or if you want to have different types of keys, such as an RSA key and also an ECDSA key. Note The Server Host Key section is used only for migrating users from an existing SFTP-enabled server. e. (Optional) For Tags, for Key and Value, enter one or more tags as key-value pairs, and then choose Add tag. f. Choose Next. g. You can optimize performance for your Amazon S3 directories. For example, suppose that you go into your home directory, and you have 10,000 subdirectories. In other words, your Amazon S3 bucket has 10,000 folders. In this scenario, if you run the ls (list) command, the list operation takes between six and eight minutes. However, if you optimize your directories, this operation takes only a few seconds. When you create your server using the console, optimized directories is enabled by default. If you create your server using the API, this behavior is not enabled by default. Create an SFTP-enabled server 108 AWS Transfer Family User Guide h. (Optional) Configure AWS Transfer Family servers to display customized messages such as organizational policies or terms and conditions to your end users. For Display banner, in the Pre-authentication display banner text box, enter the text message that you want to display to your users before they authenticate. i. (Optional) You can configure the following additional options. • SetStat option: enable this option to ignore the error that is generated when a client attempts to use SETSTAT on a file you are uploading to an Amazon S3 bucket. For additional details, see the SetStatOption documentation in the ProtocolDetails. • TLS session resumption: this option is only available if you have enabled FTPS as one of the protocols for this server. • Passive IP: this option is only available if you have enabled FTPS or FTP as one of the protocols for this server. Create an SFTP-enabled server 109 AWS Transfer Family User Guide 8. In Review and create, review your choices. • If you want to edit any of them, choose Edit next to the step. Note You must review each step after the step that you chose to edit. • If you have no changes, choose Create server to create your server. You are taken to the Servers page, shown following, where your new server is listed. Create an SFTP-enabled server 110 AWS Transfer Family User Guide It can take a couple of minutes before the status for your new server changes to Online. At that point, your server can perform file operations, but you'll need to create a user first. For details on creating users, see Managing users for server endpoints. Create an FTPS-enabled server File Transfer Protocol over SSL (FTPS) is an extension to FTP. It uses Transport Layer Security (TLS) and Secure Sockets Layer (SSL) cryptographic protocols to encrypt traffic. FTPS allows encryption of both the control and data channel connections either concurrently or independently. To create an FTPS-enabled server 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/ and select Servers from the navigation pane, then choose Create server. 2. In Choose protocols, select FTPS. For Server certificate, choose a certificate stored
transferfamily-ug-039
transferfamily-ug.pdf
39
to create a user first. For details on creating users, see Managing users for server endpoints. Create an FTPS-enabled server File Transfer Protocol over SSL (FTPS) is an extension to FTP. It uses Transport Layer Security (TLS) and Secure Sockets Layer (SSL) cryptographic protocols to encrypt traffic. FTPS allows encryption of both the control and data channel connections either concurrently or independently. To create an FTPS-enabled server 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/ and select Servers from the navigation pane, then choose Create server. 2. In Choose protocols, select FTPS. For Server certificate, choose a certificate stored in AWS Certificate Manager (ACM) which will be used to identify your server when clients connect to it over FTPS and then choose Next. To request a new public certificate, see Request a public certificate in the AWS Certificate Manager User Guide. To import an existing certificate into ACM, see Importing certificates into ACM in the AWS Certificate Manager User Guide. To request a private certificate to use FTPS through private IP addresses, see Requesting a Private Certificate in the AWS Certificate Manager User Guide. Certificates with the following cryptographic algorithms and key sizes are supported: • 2048-bit RSA (RSA_2048) • 4096-bit RSA (RSA_4096) • Elliptic Prime Curve 256 bit (EC_prime256v1) • Elliptic Prime Curve 384 bit (EC_secp384r1) • Elliptic Prime Curve 521 bit (EC_secp521r1) Create an FTPS-enabled server 111 AWS Transfer Family Note User Guide The certificate must be a valid SSL/TLS X.509 version 3 certificate with FQDN or IP address specified and contain information about the issuer. 3. In Choose an identity provider, choose the identity provider that you want to use to manage user access. You have the following options: • AWS Directory Service for Microsoft Active Directory – You provide an AWS Directory Service directory to access the endpoint. By doing so, you can use credentials stored in your Active Directory to authenticate your users. To learn more about working with AWS Managed Microsoft AD identity providers, see Using AWS Directory Service for Microsoft Active Directory. Note • Cross-Account and Shared directories are not supported for AWS Managed Microsoft AD. • To set up a server with Directory Service as your identity provider, you need to add some AWS Directory Service permissions. For details, see Before you start using AWS Directory Service for Microsoft Active Directory. • Custom identity provider – Choose either of the following options: • Use AWS Lambda to connect your identity provider – You can use an existing identity provider, backed by a Lambda function. You provide the name of the Lambda function. For more information, see Using AWS Lambda to integrate your identity provider. • Use Amazon API Gateway to connect your identity provider – You can create an API Gateway method backed by a Lambda function for use as an identity provider. You provide an Amazon API Gateway URL and an invocation role. For more information, see Using Amazon API Gateway to integrate your identity provider. Create an FTPS-enabled server 112 AWS Transfer Family User Guide 4. Choose Next. 5. In Choose an endpoint, do the following: Note FTPS servers for Transfer Family operate over Port 21 (Control Channel) and Port Range 8192–8200 (Data Channel). Create an FTPS-enabled server 113 AWS Transfer Family User Guide a. For Endpoint type, choose the VPC hosted endpoint type to host your server's endpoint. For information about setting up your VPC hosted endpoint, see Create a server in a virtual private cloud. Note Publicly accessible endpoints are not supported. b. (Optional) For FIPS Enabled, select the FIPS Enabled endpoint check box to ensure that the endpoint complies with Federal Information Processing Standards (FIPS). Note FIPS-enabled endpoints are only available in North American AWS Regions. For available Regions, see AWS Transfer Family endpoints and quotas in the AWS General Reference. For more information about FIPS, see Federal Information Processing Standard (FIPS) 140-2 . c. Choose Next. Create an FTPS-enabled server 114 AWS Transfer Family User Guide 6. On the Choose domain page, choose the AWS storage service that you want to use to store and access your data over the selected protocol: • Choose Amazon S3 to store and access your files as objects over the selected protocol. • Choose Amazon EFS to store and access your files in your Amazon EFS file system over the selected protocol. Choose Next. 7. In Configure additional details, do the following: a. For logging, specify an existing log group or create a new one (the default option). Create an FTPS-enabled server 115 AWS Transfer Family User Guide If you choose Create log group, the CloudWatch console (https:// console.aws.amazon.com/cloudwatch/) opens to the Create log group page. For details, see Create a log group in CloudWatch Logs. b. (Optional) For Managed workflows, choose workflow IDs (and a corresponding role) that
transferfamily-ug-040
transferfamily-ug.pdf
40
the selected protocol. • Choose Amazon EFS to store and access your files in your Amazon EFS file system over the selected protocol. Choose Next. 7. In Configure additional details, do the following: a. For logging, specify an existing log group or create a new one (the default option). Create an FTPS-enabled server 115 AWS Transfer Family User Guide If you choose Create log group, the CloudWatch console (https:// console.aws.amazon.com/cloudwatch/) opens to the Create log group page. For details, see Create a log group in CloudWatch Logs. b. (Optional) For Managed workflows, choose workflow IDs (and a corresponding role) that Transfer Family should assume when executing the workflow. You can choose one workflow to execute upon a complete upload, and another to execute upon a partial upload. To learn more about processing your files by using managed workflows, see AWS Transfer Family managed workflows. Create an FTPS-enabled server 116 AWS Transfer Family User Guide c. d. e. For Cryptographic algorithm options, choose a security policy that contains the cryptographic algorithms enabled for use by your server. Our latest security policy is the default: for details, see Security policies for AWS Transfer Family servers. For Server Host Key, keep it blank. (Optional) For Tags, for Key and Value, enter one or more tags as key-value pairs, and then choose Add tag. f. You can optimize performance for your Amazon S3 directories. For example, suppose that you go into your home directory, and you have 10,000 subdirectories. In other words, your Amazon S3 bucket has 10,000 folders. In this scenario, if you run the ls (list) command, the list operation takes between six and eight minutes. However, if you optimize your directories, this operation takes only a few seconds. When you create your server using the console, optimized directories is enabled by default. If you create your server using the API, this behavior is not enabled by default. g. Choose Next. h. (Optional) You can configure AWS Transfer Family servers to display customized messages such as organizational policies or terms and conditions to your end users. You can also display customized Message of The Day (MOTD) to users who have successfully authenticated. For Display banner, in the Pre-authentication display banner text box, enter the text message that you want to display to your users before they authenticate, and in the Post- authentication display banner text box, enter the text that you want to display to your users after they successfully authenticate. i. (Optional) You can configure the following additional options. Create an FTPS-enabled server 117 AWS Transfer Family User Guide • SetStat option: enable this option to ignore the error that is generated when a client attempts to use SETSTAT on a file you are uploading to an Amazon S3 bucket. For additional details, see the SetStatOption documentation in the ProtocolDetails topic. • TLS session resumption: provides a mechanism to resume or share a negotiated secret key between the control and data connection for an FTPS session. For additional details, see the TlsSessionResumptionMode documentation in the ProtocolDetails topic. • Passive IP: indicates passive mode, for FTP and FTPS protocols. Enter a single IPv4 address, such as the public IP address of a firewall, router, or load balancer. For additional details, see the PassiveIp documentation in the ProtocolDetails topic. 8. In Review and create, review your choices. • If you want to edit any of them, choose Edit next to the step. Note You must review each step after the step that you chose to edit. Create an FTPS-enabled server 118 AWS Transfer Family User Guide • If you have no changes, choose Create server to create your server. You are taken to the Servers page, shown following, where your new server is listed. It can take a couple of minutes before the status for your new server changes to Online. At that point, your server can perform file operations for your users. Next steps: For the next step, continue on to Working with custom identity providers to set up users. Create an FTP-enabled server File Transfer Protocol (FTP) is a network protocol used for the transfer of data. FTP uses a separate channel for control and data transfers. The control channel is open until terminated or inactivity timeout. The data channel is active for the duration of the transfer. FTP uses clear text and does not support encryption of traffic. Note When you enable FTP, you must choose the internal access option for the VPC-hosted endpoint. If you need your server to have data traverse the public network, you must use secure protocols, such as SFTP or FTPS. To create an FTP-enabled server 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/ and select Servers from the navigation pane, then choose Create server. 2. 3. In Choose protocols, select FTP, and then
transferfamily-ug-041
transferfamily-ug.pdf
41
open until terminated or inactivity timeout. The data channel is active for the duration of the transfer. FTP uses clear text and does not support encryption of traffic. Note When you enable FTP, you must choose the internal access option for the VPC-hosted endpoint. If you need your server to have data traverse the public network, you must use secure protocols, such as SFTP or FTPS. To create an FTP-enabled server 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/ and select Servers from the navigation pane, then choose Create server. 2. 3. In Choose protocols, select FTP, and then choose Next. In Choose an identity provider, choose the identity provider that you want to use to manage user access. You have the following options: • AWS Directory Service for Microsoft Active Directory – You provide an AWS Directory Service directory to access the endpoint. By doing so, you can use credentials stored in your Active Directory to authenticate your users. To learn more about working with AWS Managed Microsoft AD identity providers, see Using AWS Directory Service for Microsoft Active Directory. Create an FTP-enabled server 119 AWS Transfer Family Note User Guide • Cross-Account and Shared directories are not supported for AWS Managed Microsoft AD. • To set up a server with Directory Service as your identity provider, you need to add some AWS Directory Service permissions. For details, see Before you start using AWS Directory Service for Microsoft Active Directory. • Custom identity provider – Choose either of the following options: • Use AWS Lambda to connect your identity provider – You can use an existing identity provider, backed by a Lambda function. You provide the name of the Lambda function. For more information, see Using AWS Lambda to integrate your identity provider. • Use Amazon API Gateway to connect your identity provider – You can create an API Gateway method backed by a Lambda function for use as an identity provider. You provide an Amazon API Gateway URL and an invocation role. For more information, see Using Amazon API Gateway to integrate your identity provider. Create an FTP-enabled server 120 AWS Transfer Family User Guide 4. Choose Next. 5. In Choose an endpoint, do the following: Note FTP servers for Transfer Family operate over Port 21 (Control Channel) and Port Range 8192–8200 (Data Channel). a. For Endpoint type, choose VPC hosted to host your server's endpoint. For information about setting up your VPC hosted endpoint, see Create a server in a virtual private cloud. Create an FTP-enabled server 121 AWS Transfer Family User Guide Note Publicly accessible endpoints are not supported. b. For FIPS Enabled, keep the FIPS Enabled endpoint check box cleared. Note FIPS-enabled endpoints are not supported for FTP servers. c. Choose Next. Create an FTP-enabled server 122 AWS Transfer Family User Guide 6. On the Choose domain page, choose the AWS storage service that you want to use to store and access your data over the selected protocol. • Choose Amazon S3 to store and access your files as objects over the selected protocol. • Choose Amazon EFS to store and access your files in your Amazon EFS file system over the selected protocol. Choose Next. 7. In Configure additional details, do the following: a. For logging, specify an existing log group or create a new one (the default option). If you choose Create log group, the CloudWatch console (https:// console.aws.amazon.com/cloudwatch/) opens to the Create log group page. For details, see Create a log group in CloudWatch Logs. b. (Optional) For Managed workflows, choose workflow IDs (and a corresponding role) that Transfer Family should assume when executing the workflow. You can choose one workflow to execute upon a complete upload, and another to execute upon a partial upload. To learn more about processing your files by using managed workflows, see AWS Transfer Family managed workflows. Create an FTP-enabled server 123 AWS Transfer Family User Guide c. For Cryptographic algorithm options, choose a security policy that contains the cryptographic algorithms enabled for use by your server. Note Transfer Family assigns the latest security policy to your FTP server. However, since the FTP protocol doesn't use any encryption, FTP servers do not use any of the security policy algorithms. Unless your server also uses the FTPS or SFTP protocol, the security policy remains unused. d. e. For Server Host Key, keep it blank. (Optional) For Tags, for Key and Value, enter one or more tags as key-value pairs, and then choose Add tag. f. You can optimize performance for your Amazon S3 directories. For example, suppose that you go into your home directory, and you have 10,000 subdirectories. In other words, your Amazon S3 bucket has 10,000 folders. In this scenario, if you run the ls (list) command, the list operation takes between six and eight
transferfamily-ug-042
transferfamily-ug.pdf
42
security policy algorithms. Unless your server also uses the FTPS or SFTP protocol, the security policy remains unused. d. e. For Server Host Key, keep it blank. (Optional) For Tags, for Key and Value, enter one or more tags as key-value pairs, and then choose Add tag. f. You can optimize performance for your Amazon S3 directories. For example, suppose that you go into your home directory, and you have 10,000 subdirectories. In other words, your Amazon S3 bucket has 10,000 folders. In this scenario, if you run the ls (list) command, the list operation takes between six and eight minutes. However, if you optimize your directories, this operation takes only a few seconds. When you create your server using the console, optimized directories is enabled by default. If you create your server using the API, this behavior is not enabled by default. Create an FTP-enabled server 124 AWS Transfer Family User Guide g. Choose Next. h. (Optional) You can configure AWS Transfer Family servers to display customized messages such as organizational policies or terms and conditions to your end users. You can also display customized Message of The Day (MOTD) to users who have successfully authenticated. For Display banner, in the Pre-authentication display banner text box, enter the text message that you want to display to your users before they authenticate, and in the Post- authentication display banner text box, enter the text that you want to display to your users after they successfully authenticate. i. (Optional) You can configure the following additional options. • SetStat option: enable this option to ignore the error that is generated when a client attempts to use SETSTAT on a file you are uploading to an Amazon S3 bucket. For additional details, see the SetStatOption documentation in the ProtocolDetails topic. • TLS session resumption: provides a mechanism to resume or share a negotiated secret key between the control and data connection for an FTPS session. For additional details, see the TlsSessionResumptionMode documentation in the ProtocolDetails topic. • Passive IP: indicates passive mode, for FTP and FTPS protocols. Enter a single IPv4 address, such as the public IP address of a firewall, router, or load balancer. For additional details, see the PassiveIp documentation in the ProtocolDetails topic. Create an FTP-enabled server 125 AWS Transfer Family User Guide 8. In Review and create, review your choices. • If you want to edit any of them, choose Edit next to the step. Note You must review each step after the step that you chose to edit. • If you have no changes, choose Create server to create your server. You are taken to the Servers page, shown following, where your new server is listed. It can take a couple of minutes before the status for your new server changes to Online. At that point, your server can perform file operations for your users. Next steps – For the next step, continue on to Working with custom identity providers to set up users. Create an FTP-enabled server 126 AWS Transfer Family User Guide Create a server in a virtual private cloud You can host your server's endpoint inside a virtual private cloud (VPC) to use for transferring data to and from an Amazon S3 bucket or Amazon EFS file system without going over the public internet. Note After May 19, 2021, you won't be able to create a server using EndpointType=VPC_ENDPOINT in your AWS account if your account hasn't already done so before May 19, 2021. If you have already created servers with EndpointType=VPC_ENDPOINT in your AWS account on or before February 21, 2021, you will not be affected. After this date, use EndpointType=VPC. For more information, see the section called “Discontinuing the use of VPC_ENDPOINT”. If you use Amazon Virtual Private Cloud (Amazon VPC) to host your AWS resources, you can establish a private connection between your VPC and a server. You can then use this server to transfer data over your client to and from your Amazon S3 bucket without using public IP addressing or requiring an internet gateway. Using Amazon VPC, you can launch AWS resources in a custom virtual network. You can use a VPC to control your network settings, such as the IP address range, subnets, route tables, and network gateways. For more information about VPCs, see What Is Amazon VPC? in the Amazon VPC User Guide. In the next sections, find instructions on how to create and connect your VPC to a server. As an overview, you do this as follows: 1. Set up a server using a VPC endpoint. 2. Connect to your server using a client that is inside your VPC through the VPC endpoint. Doing this enables you to transfer data that is stored in your Amazon S3 bucket over your client using AWS Transfer Family. You can
transferfamily-ug-043
transferfamily-ug.pdf
43
IP address range, subnets, route tables, and network gateways. For more information about VPCs, see What Is Amazon VPC? in the Amazon VPC User Guide. In the next sections, find instructions on how to create and connect your VPC to a server. As an overview, you do this as follows: 1. Set up a server using a VPC endpoint. 2. Connect to your server using a client that is inside your VPC through the VPC endpoint. Doing this enables you to transfer data that is stored in your Amazon S3 bucket over your client using AWS Transfer Family. You can perform this transfer even though the network is disconnected from the public internet. 3. In addition, if you choose to make your server's endpoint internet-facing, you can associate Elastic IP addresses with your endpoint. Doing this lets clients outside of your VPC connect to your server. You can use VPC security groups to control access to authenticated users whose requests originate only from allowed addresses. Create a server in a VPC 127 AWS Transfer Family Topics User Guide • Create a server endpoint that can be accessed only within your VPC • Create an internet-facing endpoint for your server • Change the endpoint type for your server • Discontinuing the use of VPC_ENDPOINT • Updating the AWS Transfer Family server endpoint type from VPC_ENDPOINT to VPC Create a server endpoint that can be accessed only within your VPC In the following procedure, you create a server endpoint that is accessible only to resources within your VPC. To create a server endpoint inside a VPC 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. 3. 4. From the navigation pane, select Servers, then choose Create server. In Choose protocols, select one or more protocols, and then choose Next. For more information about protocols, see Step 2: Create an SFTP-enabled server. In Choose an identity provider, choose Service managed to store user identities and keys in AWS Transfer Family, and then choose Next. This procedure uses the service-managed option. If you choose Custom, you provide an Amazon API Gateway endpoint and an AWS Identity and Access Management (IAM) role to access the endpoint. By doing so, you can integrate your directory service to authenticate and authorize your users. To learn more about working with custom identity providers, see Working with custom identity providers. 5. In Choose an endpoint, do the following: a. b. For Endpoint type, choose the VPC hosted endpoint type to host your server's endpoint. For Access, choose Internal to make your endpoint only accessible to clients using the endpoint's private IP addresses. For details on the Internet Facing option, see Create an internet-facing endpoint for your server. A server that is created in a VPC for internal access only doesn't support custom hostnames. c. For VPC, choose an existing VPC ID or choose Create a VPC to create a new VPC. Create a server in a VPC 128 AWS Transfer Family User Guide d. e. In the Availability Zones section, choose up to three Availability Zones and associated subnets. In the Security Groups section, choose an existing security group ID or IDs or choose Create a security group to create a new security group. For more information about security groups, see Security groups for your VPC in the Amazon Virtual Private Cloud User Guide. To create a security group, see Creating a security group in the Amazon Virtual Private Cloud User Guide. Note Your VPC automatically comes with a default security group. If you don't specify a different security group or groups when you launch the server, we associate the default security group with your server. • For the inbound rules for the security group, you can configure SSH traffic to use port 22, 2222, 22000, or any combination. Port 22 is configured by default. To use port 2222 or port 22000, you add an inbound rule to your security group. For the type, choose Custom TCP, then enter either 2222 or 22000 for Port range, and for the source, enter the same CIDR range that you have for your SSH port 22 rule. • For the inbound rules for the security group, configure FTP and FTPS traffic to use Port range 21 for the control channel and 8192-8200 for the data channel. Note You can also use port 2223 for clients that require TCP "piggy-back" ACKs, or the ability for the final ack of the TCP 3-way handshake to also contain data. Some client software may be incompatible with port 2223: for example, a client that requires the server to send the SFTP Identification String before the client does. Create a server in a VPC 129 AWS Transfer Family User Guide f. (Optional) For FIPS Enabled, select the FIPS Enabled endpoint check box to ensure the endpoint
transferfamily-ug-044
transferfamily-ug.pdf
44
to use Port range 21 for the control channel and 8192-8200 for the data channel. Note You can also use port 2223 for clients that require TCP "piggy-back" ACKs, or the ability for the final ack of the TCP 3-way handshake to also contain data. Some client software may be incompatible with port 2223: for example, a client that requires the server to send the SFTP Identification String before the client does. Create a server in a VPC 129 AWS Transfer Family User Guide f. (Optional) For FIPS Enabled, select the FIPS Enabled endpoint check box to ensure the endpoint complies with Federal Information Processing Standards (FIPS). Note FIPS-enabled endpoints are only available in North American AWS Regions. For available Regions, see AWS Transfer Family endpoints and quotas in the AWS General Reference. For more information about FIPS, see Federal Information Processing Standard (FIPS) 140-2 . g. Choose Next. 6. In Configure additional details, do the following: a. For CloudWatch logging, choose one of the following to enable Amazon CloudWatch logging of your user activity: • Create a new role to allow Transfer Family to automatically create the IAM role, as long as you have the right permissions to create a new role. The IAM role that is created is called AWSTransferLoggingAccess. • Choose an existing role to choose an existing IAM role from your account. Under Logging role, choose the role. This IAM role should include a trust policy with Service set to transfer.amazonaws.com. Create a server in a VPC 130 AWS Transfer Family User Guide For more information about CloudWatch logging, see Configure CloudWatch logging role. Note • You can't view end-user activity in CloudWatch if you don't specify a logging role. • If you don't want to set up a CloudWatch logging role, select Choose an existing role, but don't select a logging role. b. For Cryptographic algorithm options, choose a security policy that contains the cryptographic algorithms enabled for use by your server. Note By default, the TransferSecurityPolicy-2024-01 security policy is attached to your server unless you choose a different one. For more information about security policies, see Security policies for AWS Transfer Family servers. c. d. (Optional: this section is only for migrating users from an existing SFTP-enabled server.) For Server Host Key, enter an RSA, ED25519, or ECDSA private key that will be used to identify your server when clients connect to it over SFTP. (Optional) For Tags, for Key and Value, enter one or more tags as key-value pairs, and then choose Add tag. e. Choose Next. 7. In Review and create, review your choices. If you: • Want to edit any of them, choose Edit next to the step. Note You will need to review each step after the step that you chose to edit. Create a server in a VPC 131 AWS Transfer Family User Guide • Have no changes, choose Create server to create your server. You are taken to the Servers page, shown following, where your new server is listed. It can take a couple of minutes before the status for your new server changes to Online. At that point, your server can perform file operations, but you'll need to create a user first. For details on creating users, see Managing users for server endpoints. Create an internet-facing endpoint for your server In the following procedure, you create a server endpoint. This endpoint is accessible over the internet only to clients whose source IP addresses are allowed in your VPC's default security group. Additionally, by using Elastic IP addresses to make your endpoint internet-facing, your clients can use the Elastic IP address to allow access to your endpoint in their firewalls. Note Only SFTP and FTPS can be used on an internet-facing VPC hosted endpoint. To create an internet-facing endpoint 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. 3. 4. From the navigation pane, select Servers, then choose Create server. In Choose protocols, select one or more protocols, and then choose Next. For more information about protocols, see Step 2: Create an SFTP-enabled server. In Choose an identity provider, choose Service managed to store user identities and keys in AWS Transfer Family, and then choose Next. This procedure uses the service-managed option. If you choose Custom, you provide an Amazon API Gateway endpoint and an AWS Identity and Access Management (IAM) role to access the endpoint. By doing so, you can integrate your directory service to authenticate and authorize your users. To learn more about working with custom identity providers, see Working with custom identity providers. 5. In Choose an endpoint, do the following: a. For Endpoint type, choose the VPC hosted endpoint type to host your server's endpoint. Create a server in a VPC 132 AWS Transfer Family User Guide b. For Access, choose Internet Facing
transferfamily-ug-045
transferfamily-ug.pdf
45
procedure uses the service-managed option. If you choose Custom, you provide an Amazon API Gateway endpoint and an AWS Identity and Access Management (IAM) role to access the endpoint. By doing so, you can integrate your directory service to authenticate and authorize your users. To learn more about working with custom identity providers, see Working with custom identity providers. 5. In Choose an endpoint, do the following: a. For Endpoint type, choose the VPC hosted endpoint type to host your server's endpoint. Create a server in a VPC 132 AWS Transfer Family User Guide b. For Access, choose Internet Facing to make your endpoint accessible to clients over the internet. Note When you choose Internet Facing, you can choose an existing Elastic IP address in each subnet or subnets. Or you can go to the VPC console (https:// console.aws.amazon.com/vpc/) to allocate one or more new Elastic IP addresses. These addresses can be owned either by AWS or by you. You can't associate Elastic IP addresses that are already in use with your endpoint. c. (Optional) For Custom hostname, choose one of the following: Note Customers in AWS GovCloud (US) need to connect via the Elastic IP address directly, or create a hostname record within Commercial Route 53 that points to their EIP. For more information about using Route 53 for GovCloud endpoints, see Setting up Amazon Route 53 with your AWS GovCloud (US) resources in the AWS GovCloud (US) User Guide. • Amazon Route 53 DNS alias – if the hostname that you want to use is registered with Route 53. You can then enter the hostname. • Other DNS – if the hostname that you want to use is registered with another DNS provider. You can then enter the hostname. • None – to use the server's endpoint and not use a custom hostname. The server hostname takes the form server-id.server.transfer.region.amazonaws.com. Note For customers in AWS GovCloud (US), selecting None does not create a hostname in this format. To learn more about working with custom hostnames, see Working with custom hostnames. Create a server in a VPC 133 AWS Transfer Family User Guide d. e. f. For VPC, choose an existing VPC ID or choose Create a VPC to create a new VPC. In the Availability Zones section, choose up to three Availability Zones and associated subnets. For IPv4 Addresses, choose an Elastic IP address for each subnet. This is the IP address that your clients can use to allow access to your endpoint in their firewalls. Tip: You must use a public subnet for your Availability Zones, or first setup an internet gateway if you want to use a private subnet. In the Security Groups section, choose an existing security group ID or IDs or choose Create a security group to create a new security group. For more information about security groups, see Security groups for your VPC in the Amazon Virtual Private Cloud User Guide. To create a security group, see Creating a security group in the Amazon Virtual Private Cloud User Guide. Note Your VPC automatically comes with a default security group. If you don't specify a different security group or groups when you launch the server, we associate the default security group with your server. • For the inbound rules for the security group, you can configure SSH traffic to use port 22, 2222, 22000, or any combination. Port 22 is configured by default. To use port 2222 or port 22000, you add an inbound rule to your security group. For the type, choose Custom TCP, then enter either 2222 or 22000 for Port range, and for the source, enter the same CIDR range that you have for your SSH port 22 rule. • For the inbound rules for the security group, configure FTPS traffic to use Port range 21 for the control channel and 8192-8200 for the data channel. Note You can also use port 2223 for clients that require TCP "piggy-back" ACKs, or the ability for the final ack of the TCP 3-way handshake to also contain data. Some client software may be incompatible with port 2223: for example, a client that requires the server to send the SFTP Identification String before the client does. Create a server in a VPC 134 AWS Transfer Family User Guide g. (Optional) For FIPS Enabled, select the FIPS Enabled endpoint check box to ensure the endpoint complies with Federal Information Processing Standards (FIPS). Note FIPS-enabled endpoints are only available in North American AWS Regions. For available Regions, see AWS Transfer Family endpoints and quotas in the AWS General Reference. For more information about FIPS, see Federal Information Processing Standard (FIPS) 140-2 . h. Choose Next. 6. In Configure additional details, do the following: a. For CloudWatch logging, choose one of the following to enable Amazon CloudWatch
transferfamily-ug-046
transferfamily-ug.pdf
46
client does. Create a server in a VPC 134 AWS Transfer Family User Guide g. (Optional) For FIPS Enabled, select the FIPS Enabled endpoint check box to ensure the endpoint complies with Federal Information Processing Standards (FIPS). Note FIPS-enabled endpoints are only available in North American AWS Regions. For available Regions, see AWS Transfer Family endpoints and quotas in the AWS General Reference. For more information about FIPS, see Federal Information Processing Standard (FIPS) 140-2 . h. Choose Next. 6. In Configure additional details, do the following: a. For CloudWatch logging, choose one of the following to enable Amazon CloudWatch logging of your user activity: • Create a new role to allow Transfer Family to automatically create the IAM role, as long as you have the right permissions to create a new role. The IAM role that is created is called AWSTransferLoggingAccess. • Choose an existing role to choose an existing IAM role from your account. Under Logging role, choose the role. This IAM role should include a trust policy with Service set to transfer.amazonaws.com. Create a server in a VPC 135 AWS Transfer Family User Guide For more information about CloudWatch logging, see Configure CloudWatch logging role. Note • You can't view end-user activity in CloudWatch if you don't specify a logging role. • If you don't want to set up a CloudWatch logging role, select Choose an existing role, but don't select a logging role. b. For Cryptographic algorithm options, choose a security policy that contains the cryptographic algorithms enabled for use by your server. Note By default, the TransferSecurityPolicy-2024-01 security policy is attached to your server unless you choose a different one. c. d. e. f. For more information about security policies, see Security policies for AWS Transfer Family servers. (Optional: this section is only for migrating users from an existing SFTP-enabled server.) For Server Host Key, enter an RSA, ED25519, or ECDSA private key that will be used to identify your server when clients connect to it over SFTP. (Optional) For Tags, for Key and Value, enter one or more tags as key-value pairs, and then choose Add tag. Choose Next. (Optional) For Managed workflows, choose workflow IDs (and a corresponding role) that Transfer Family should assume when executing the workflow. You can choose one workflow to execute upon a complete upload, and another to execute upon a partial upload. To learn more about processing your files by using managed workflows, see AWS Transfer Family managed workflows. Create a server in a VPC 136 AWS Transfer Family User Guide 7. In Review and create, review your choices. If you: • Want to edit any of them, choose Edit next to the step. Note You will need to review each step after the step that you chose to edit. • Have no changes, choose Create server to create your server. You are taken to the Servers page, shown following, where your new server is listed. You can choose the server ID to see the detailed settings of the server that you just created. After the column Public IPv4 address has been populated, the Elastic IP addresses that you provided are successfully associated with your server's endpoint. Note When your server in a VPC is online, only the subnets can be modified and only through the UpdateServer API. You must stop the server to add or change the server endpoint's Elastic IP addresses. Change the endpoint type for your server If you have an existing server that is accessible over the internet (that is, has a public endpoint type), you can change its endpoint to a VPC endpoint. Create a server in a VPC 137 AWS Transfer Family Note User Guide If you have an existing server in a VPC displayed as VPC_ENDPOINT, we recommend that you modify it to the new VPC endpoint type. With this new endpoint type, you no longer need to use a Network Load Balancer (NLB) to associate Elastic IP addresses with your server's endpoint. Also, you can use VPC security groups to restrict access to your server's endpoint. However, you can continue to use the VPC_ENDPOINT endpoint type as needed. The following procedure assumes that you have a server that uses either the current public endpoint type or the older VPC_ENDPOINT type. To change the endpoint type for your server 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. 3. 4. 5. 6. 7. In the navigation pane, choose Servers. Select the check box of the server that you want to change the endpoint type for. Important You must stop the server before you can change its endpoint. For Actions, choose Stop. In the confirmation dialog box that appears, choose Stop to confirm that you want to stop the server. Note Before proceeding to the next step, in Endpoint details, wait
transferfamily-ug-047
transferfamily-ug.pdf
47
the current public endpoint type or the older VPC_ENDPOINT type. To change the endpoint type for your server 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. 3. 4. 5. 6. 7. In the navigation pane, choose Servers. Select the check box of the server that you want to change the endpoint type for. Important You must stop the server before you can change its endpoint. For Actions, choose Stop. In the confirmation dialog box that appears, choose Stop to confirm that you want to stop the server. Note Before proceeding to the next step, in Endpoint details, wait for the Status of the server to change to Offline; this can take a couple of minutes. You might have to choose Refresh on the Servers page to see the status change. You won't be able to make any edits until the server is Offline. In Endpoint details, choose Edit. In Edit endpoint configuration, do the following: a. For Edit endpoint type, choose VPC hosted. Create a server in a VPC 138 AWS Transfer Family User Guide b. For Access, choose one of the following: • Internal to make your endpoint only accessible to clients using the endpoint's private IP addresses. • Internet Facing to make your endpoint accessible to clients over the public internet. Note When you choose Internet Facing, you can choose an existing Elastic IP address in each subnet or subnets. Or, you can go to the VPC console (https:// console.aws.amazon.com/vpc/) to allocate one or more new Elastic IP addresses. These addresses can be owned either by AWS or by you. You can't associate Elastic IP addresses that are already in use with your endpoint. c. (Optional for internet facing access only) For Custom hostname, choose one of the following: • Amazon Route 53 DNS alias – if the hostname that you want to use is registered with Route 53. You can then enter the hostname. • Other DNS – if the hostname that you want to use is registered with another DNS provider. You can then enter the hostname. • None – to use the server's endpoint and not use a custom hostname. The server hostname takes the form serverId.server.transfer.regionId.amazonaws.com. To learn more about working with custom hostnames, see Working with custom hostnames. d. e. For VPC, choose an existing VPC ID, or choose Create a VPC to create a new VPC. In the Availability Zones section, select up to three Availability Zones and associated subnets. If Internet Facing is chosen, also choose an Elastic IP address for each subnet. Note If you want the maximum of three Availability Zones, but there are not enough available, create them in the VPC console (https://console.aws.amazon.com/vpc/). Create a server in a VPC 139 AWS Transfer Family User Guide If you modify the subnets or Elastic IP addresses, the server takes a few minutes to update. You can't save your changes until the server update is complete. f. Choose Save. 8. For Actions, choose Start and wait for the status of the server to change to Online; this can take a couple of minutes. Note If you changed a public endpoint type to a VPC endpoint type, notice that Endpoint type for your server has changed to VPC. The default security group is attached to the endpoint. To change or add additional security groups, see Creating Security Groups. Discontinuing the use of VPC_ENDPOINT AWS Transfer Family is discontinuing the ability to create servers with EndpointType=VPC_ENDPOINT for new AWS accounts. As of May 19, 2021, AWS accounts that don't own AWS Transfer Family servers with an endpoint type of VPC_ENDPOINT will not be able to create new servers with EndpointType=VPC_ENDPOINT. If you already own servers that use the VPC_ENDPOINT endpoint type, we recommend that you start using EndpointType=VPC as soon as possible. For details, see Update your AWS Transfer Family server endpoint type from VPC_ENDPOINT to VPC. We launched the new VPC endpoint type earlier in 2020. For more information, see AWS Transfer Family for SFTP supports VPC Security Groups and Elastic IP addresses. This new endpoint is more feature rich and cost effective and there are no PrivateLink charges. For more information, see AWS PrivateLink pricing. This endpoint type is functionally equivalent to the previous endpoint type (VPC_ENDPOINT). You can attach Elastic IP addresses directly to the endpoint to make it internet facing and use security groups for source IP filtering. For more information, see the Use IP allow listing to secure your AWS Transfer Family for SFTP servers blog post. You can also host this endpoint in a shared VPC environment. For more information, see AWS Transfer Family now supports shared services VPC environments. Create a server in a VPC 140 AWS Transfer Family User Guide In addition to SFTP, you can use the VPC EndpointType to enable FTPS
transferfamily-ug-048
transferfamily-ug.pdf
48
functionally equivalent to the previous endpoint type (VPC_ENDPOINT). You can attach Elastic IP addresses directly to the endpoint to make it internet facing and use security groups for source IP filtering. For more information, see the Use IP allow listing to secure your AWS Transfer Family for SFTP servers blog post. You can also host this endpoint in a shared VPC environment. For more information, see AWS Transfer Family now supports shared services VPC environments. Create a server in a VPC 140 AWS Transfer Family User Guide In addition to SFTP, you can use the VPC EndpointType to enable FTPS and FTP. We don't plan to add these features and FTPS/FTP support to EndpointType=VPC_ENDPOINT. We have also removed this endpoint type as an option from the AWS Transfer Family console. You can change the endpoint type for your server using the Transfer Family console, AWS CLI, API, SDKs, or AWS CloudFormation. To change your server’s endpoint type, see Updating the AWS Transfer Family server endpoint type from VPC_ENDPOINT to VPC. If you have any questions, contact AWS Support or your AWS account team. Note We do not plan to add these features and FTPS or FTP support to EndpointType=VPC_ENDPOINT. We are no longer offering it as an option on the AWS Transfer Family Console. If you have additional questions, you can contact us through AWS Support or your account team. Updating the AWS Transfer Family server endpoint type from VPC_ENDPOINT to VPC You can use the AWS Management Console, AWS CloudFormation, or the Transfer Family API to update a server's EndpointType from VPC_ENDPOINT to VPC. Detailed procedures and examples for using each of these methods to update a server endpoint type are provided in the following sections. If you have servers in multiple AWS regions and in multiple AWS accounts, you can use the example script provided in the following section, with modifications, to identify servers using the VPC_ENDPOINT type that you will need to update. Topics • Identifying servers using the VPC_ENDPOINT endpoint type • Updating the server endpoint type using the AWS Management Console • Updating the server endpoint type using AWS CloudFormation • Updating the server EndpointType using the API Identifying servers using the VPC_ENDPOINT endpoint type You can identify which servers are using the VPC_ENDPOINT using the AWS Management Console. Create a server in a VPC 141 AWS Transfer Family User Guide To identify servers using the VPC_ENDPOINT endpoint type using the console 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. Choose Servers in the navigation pane to display the list of servers in your account in that region. 3. Sort the list of servers by the Endpoint type to see all servers using VPC_ENDPOINT. To identify servers using VPC_ENDPOINT across multiple AWS Regions and accounts If you have servers in multiple AWS regions and in multiple AWS accounts, you can use the following example script, with modifications, to identify servers using the VPC_ENDPOINT endpoint type. The example script uses the Amazon EC2 DescribeRegions and the Transfer Family ListServers API operations. If you have many AWS accounts, you could loop through your accounts using an IAM Role with read only auditor access if you authenticate using session profiles to your identity provider. 1. Following is a simple example. import boto3 profile = input("Enter the name of the AWS account you'll be working in: ") session = boto3.Session(profile_name=profile) ec2 = session.client("ec2") regions = ec2.describe_regions() for region in regions['Regions']: region_name = region['RegionName'] if region_name=='ap-northeast-3': #https://github.com/boto/boto3/issues/1943 continue transfer = session.client("transfer", region_name=region_name) servers = transfer.list_servers() for server in servers['Servers']: if server['EndpointType']=='VPC_ENDPOINT': print(server['ServerId'], region_name) 2. After you have the list of the servers to update, you can use one of the methods described in the following sections to update the EndpointType to VPC. Create a server in a VPC 142 AWS Transfer Family User Guide Updating the server endpoint type using the AWS Management Console 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. 3. 4. 5. In the navigation pane, choose Servers. Select the check box of the server that you want to change the endpoint type for. Important You must stop the server before you can change its endpoint. For Actions, choose Stop. In the confirmation dialog box that appears, choose Stop to confirm that you want to stop the server. Note Before proceeding to the next step, wait for the Status of the server to change to Offline; this can take a couple of minutes. You might have to choose Refresh on the Servers page to see the status change. 6. After the status changes to Offline, choose the server to display the server details page. 7. In the Endpoint details section, choose Edit. 8. Choose VPC hosted for the Endpoint type. 9. Choose Save 10. For Actions, choose Start and wait for the status
transferfamily-ug-049
transferfamily-ug.pdf
49
dialog box that appears, choose Stop to confirm that you want to stop the server. Note Before proceeding to the next step, wait for the Status of the server to change to Offline; this can take a couple of minutes. You might have to choose Refresh on the Servers page to see the status change. 6. After the status changes to Offline, choose the server to display the server details page. 7. In the Endpoint details section, choose Edit. 8. Choose VPC hosted for the Endpoint type. 9. Choose Save 10. For Actions, choose Start and wait for the status of the server to change to Online; this can take a couple of minutes. Updating the server endpoint type using AWS CloudFormation This section describes how to use AWS CloudFormation to update a server's EndpointType to VPC. Use this procedure for Transfer Family servers that you have deployed using AWS CloudFormation. In this example, the original AWS CloudFormation template used to deploy the Transfer Family server is shown as follows: AWSTemplateFormatVersion: '2010-09-09' Description: 'Create AWS Transfer Server with VPC_ENDPOINT endpoint type' Parameters: Create a server in a VPC 143 User Guide AWS Transfer Family SecurityGroupId: Type: AWS::EC2::SecurityGroup::Id SubnetIds: Type: List<AWS::EC2::Subnet::Id> VpcId: Type: AWS::EC2::VPC::Id Resources: TransferServer: Type: AWS::Transfer::Server Properties: Domain: S3 EndpointDetails: VpcEndpointId: !Ref VPCEndpoint EndpointType: VPC_ENDPOINT IdentityProviderType: SERVICE_MANAGED Protocols: - SFTP VPCEndpoint: Type: AWS::EC2::VPCEndpoint Properties: ServiceName: com.amazonaws.us-east-1.transfer.server SecurityGroupIds: - !Ref SecurityGroupId SubnetIds: - !Select [0, !Ref SubnetIds] - !Select [1, !Ref SubnetIds] - !Select [2, !Ref SubnetIds] VpcEndpointType: Interface VpcId: !Ref VpcId The template is updated with the following changes: • The EndpointType was changed to VPC. • The AWS::EC2::VPCEndpoint resource is removed. • The SecurityGroupId, SubnetIds, and VpcId were moved to the EndpointDetails section of the AWS::Transfer::Server resource, • The VpcEndpointId property of EndpointDetails was removed. The updated template looks as follows: AWSTemplateFormatVersion: '2010-09-09' Create a server in a VPC 144 AWS Transfer Family User Guide Description: 'Create AWS Transfer Server with VPC endpoint type' Parameters: SecurityGroupId: Type: AWS::EC2::SecurityGroup::Id SubnetIds: Type: List<AWS::EC2::Subnet::Id> VpcId: Type: AWS::EC2::VPC::Id Resources: TransferServer: Type: AWS::Transfer::Server Properties: Domain: S3 EndpointDetails: SecurityGroupIds: - !Ref SecurityGroupId SubnetIds: - !Select [0, !Ref SubnetIds] - !Select [1, !Ref SubnetIds] - !Select [2, !Ref SubnetIds] VpcId: !Ref VpcId EndpointType: VPC IdentityProviderType: SERVICE_MANAGED Protocols: - SFTP To update the endpoint type of Transfer Family servers deployed using AWS CloudFormation 1. Stop the server that you want to update using the following steps. a. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. b. c. d. e. In the navigation pane, choose Servers. Select the check box of the server that you want to change the endpoint type for. Important You must stop the server before you can change its endpoint. For Actions, choose Stop. In the confirmation dialog box that appears, choose Stop to confirm that you want to stop the server. Create a server in a VPC 145 AWS Transfer Family User Guide Note Before proceeding to the next step, wait for the Status of the server to change to Offline; this can take a couple of minutes. You might have to choose Refresh on the Servers page to see the status change. 2. Update the CloudFormation stack a. Open the AWS CloudFormation console at https://console.aws.amazon.com/ cloudformation. b. Choose the stack used to create the Transfer Family server. c. Choose Update. d. Choose Replace current template e. Upload the new template. CloudFormation Change Sets help you understand how template changes will affect running resources before you implement them. In this example, the Transfer server resource will be modified, and the VPCEndpoint resource will be removed. The VPC endpoint type server creates a VPC Endpoint on your behalf, replacing the original VPCEndpoint resource. After uploading the new template, the change set will look similar to the following: f. Update the stack. 3. Once the stack update is complete, navigate to the Transfer Family management console at https://console.aws.amazon.com/transfer/. Create a server in a VPC 146 AWS Transfer Family User Guide 4. Restart the server. Choose the server you updated in AWS CloudFormation, and then choose Start from the Actions menu. Updating the server EndpointType using the API You can use the describe-server AWS CLI command, or the UpdateServer API command. The following example script stops the Transfer Family server, updates the EndpointType, removes the VPC_ENDPOINT, and starts the server. import boto3 import time profile = input("Enter the name of the AWS account you'll be working in: ") region_name = input("Enter the AWS Region you're working in: ") server_id = input("Enter the AWS Transfer Server Id: ") session = boto3.Session(profile_name=profile) ec2 = session.client("ec2", region_name=region_name) transfer = session.client("transfer", region_name=region_name) group_ids=[] transfer_description = transfer.describe_server(ServerId=server_id) if transfer_description['Server']['EndpointType']=='VPC_ENDPOINT': transfer_vpc_endpoint = transfer_description['Server']['EndpointDetails'] ['VpcEndpointId'] transfer_vpc_endpoint_descriptions = ec2.describe_vpc_endpoints(VpcEndpointIds=[transfer_vpc_endpoint]) for transfer_vpc_endpoint_description in transfer_vpc_endpoint_descriptions['VpcEndpoints']: subnet_ids=transfer_vpc_endpoint_description['SubnetIds'] group_id_list=transfer_vpc_endpoint_description['Groups'] vpc_id=transfer_vpc_endpoint_description['VpcId'] for group_id in group_id_list: group_ids.append(group_id['GroupId']) if transfer_description['Server']['State']=='ONLINE': transfer_stop = transfer.stop_server(ServerId=server_id) print(transfer_stop) time.sleep(300) #safe transfer_update = transfer.update_server(ServerId=server_id,EndpointType='VPC',EndpointDetails={'SecurityGroupIds':group_ids,'SubnetIds':subnet_ids,'VpcId':vpc_id}) Create
transferfamily-ug-050
transferfamily-ug.pdf
50
stops the Transfer Family server, updates the EndpointType, removes the VPC_ENDPOINT, and starts the server. import boto3 import time profile = input("Enter the name of the AWS account you'll be working in: ") region_name = input("Enter the AWS Region you're working in: ") server_id = input("Enter the AWS Transfer Server Id: ") session = boto3.Session(profile_name=profile) ec2 = session.client("ec2", region_name=region_name) transfer = session.client("transfer", region_name=region_name) group_ids=[] transfer_description = transfer.describe_server(ServerId=server_id) if transfer_description['Server']['EndpointType']=='VPC_ENDPOINT': transfer_vpc_endpoint = transfer_description['Server']['EndpointDetails'] ['VpcEndpointId'] transfer_vpc_endpoint_descriptions = ec2.describe_vpc_endpoints(VpcEndpointIds=[transfer_vpc_endpoint]) for transfer_vpc_endpoint_description in transfer_vpc_endpoint_descriptions['VpcEndpoints']: subnet_ids=transfer_vpc_endpoint_description['SubnetIds'] group_id_list=transfer_vpc_endpoint_description['Groups'] vpc_id=transfer_vpc_endpoint_description['VpcId'] for group_id in group_id_list: group_ids.append(group_id['GroupId']) if transfer_description['Server']['State']=='ONLINE': transfer_stop = transfer.stop_server(ServerId=server_id) print(transfer_stop) time.sleep(300) #safe transfer_update = transfer.update_server(ServerId=server_id,EndpointType='VPC',EndpointDetails={'SecurityGroupIds':group_ids,'SubnetIds':subnet_ids,'VpcId':vpc_id}) Create a server in a VPC 147 AWS Transfer Family User Guide print(transfer_update) time.sleep(10) transfer_start = transfer.start_server(ServerId=server_id) print(transfer_start) delete_vpc_endpoint = ec2.delete_vpc_endpoints(VpcEndpointIds=[transfer_vpc_endpoint]) Working with custom hostnames Your server host name is the hostname that your users enter in their clients when they connect to your server. You can use a custom domain that you have registered for your server hostname when you work with AWS Transfer Family. For example, you might use a custom hostname like mysftpserver.mysubdomain.domain.com. To redirect traffic from your registered custom domain to your server endpoint, you can use Amazon Route 53 or any Domain Name System (DNS) provider. Route 53 is the DNS service that AWS Transfer Family natively supports. Topics • Use Amazon Route 53 as your DNS provider • Use other DNS providers • Custom hostnames for non-console created servers On the console, you can choose one of these options for setting up a custom hostname: • Amazon Route 53 DNS alias – if the hostname that you want to use is registered with Route 53. You can then enter the hostname. • Other DNS – if the hostname that you want to use is registered with another DNS provider. You can then enter the hostname. • None – to use the server's endpoint and not use a custom hostname. You set this option when you create a new server or edit the configuration of an existing server. For more information about creating a new server, see Step 2: Create an SFTP-enabled server. For more information about editing the configuration of an existing server, see Edit server details. For more details about using your own domain for the server hostname and how AWS Transfer Family uses Route 53, see the following sections. Working with custom hostnames 148 AWS Transfer Family User Guide Use Amazon Route 53 as your DNS provider When you create a server, you can use Amazon Route 53 as your DNS provider. Before you use a domain with Route 53, you register the domain. For more information, see How Domain registration works in the Amazon Route 53 Developer Guide. When you use Route 53 to provide DNS routing to your server, AWS Transfer Family uses the custom hostname that you entered to extract its hosted zone. When AWS Transfer Family extracts a hosted zone, three things can happen: 1. If you're new to Route 53 and don't have a hosted zone, AWS Transfer Family adds a new hosted zone and a CNAME record. The value of this CNAME record is the endpoint hostname for your server. A CNAME is an alternate domain name. 2. If you have a hosted zone in Route 53 without any CNAME records, AWS Transfer Family adds a CNAME record to the hosted zone. 3. If the service detects that a CNAME record already exists in the hosted zone, you see an error indicating that a CNAME record already exists. In this case, change the value of the CNAME record to the hostname of your server. For more information about hosted zones in Route 53, see Hosted zone in the Amazon Route 53 Developer Guide. Use other DNS providers When you create a server, you can also use DNS providers other than Amazon Route 53. If you use an alternate DNS provider, make sure that traffic from your domain is directed to your server endpoint. To do so, set your domain to the endpoint hostname for the server. An endpoint hostname looks like this in the console: serverid.server.transfer.region.amazonaws.com Note If your server has a VPC endpoint, then the format for the hostname is different from the one described above. To find your VPC endpoint, select the VPC on the server's details Working with custom hostnames 149 AWS Transfer Family User Guide page, then select the VPC endpoint ID on the VPC dashboard. The endpoint is the first DNS name of those listed. Custom hostnames for non-console created servers When you create a server using AWS Cloud Development Kit (AWS CDK), AWS CloudFormation, or through the CLI, you must add a tag if you want that server to have a custom hostname. When you create a Transfer Family server by using the console, the tagging is done automatically. Note You
transferfamily-ug-051
transferfamily-ug.pdf
51
To find your VPC endpoint, select the VPC on the server's details Working with custom hostnames 149 AWS Transfer Family User Guide page, then select the VPC endpoint ID on the VPC dashboard. The endpoint is the first DNS name of those listed. Custom hostnames for non-console created servers When you create a server using AWS Cloud Development Kit (AWS CDK), AWS CloudFormation, or through the CLI, you must add a tag if you want that server to have a custom hostname. When you create a Transfer Family server by using the console, the tagging is done automatically. Note You also need to create a DNS record to redirect traffic from your domain to your server endpoint. For details, see Working with records in the Amazon Route 53 Developer Guide. Use the following keys for your custom hostname: • Add transfer:customHostname to display the custom hostname in the console. • If you are using Route 53 as your DNS provider, add transfer:route53HostedZoneId. This tag links the custom hostname to your Route 53 Hosted Zone ID. To add the custom hostname, issue the following CLI command. aws transfer tag-resource --arn arn:aws:transfer:region:AWS account:server/server-ID -- tags Key=transfer:customHostname,Value="custom-host-name" For example: aws transfer tag-resource --arn arn:aws:transfer:us-east-1:111122223333:server/ s-1234567890abcdef0 --tags Key=transfer:customHostname,Value="abc.example.com" If you are using Route 53, issue the following command to link your custom hostname to your Route 53 Hosted Zone ID. aws transfer tag-resource --arn server-ARN:server/server-ID --tags Key=transfer:route53HostedZoneId,Value=HOSTED-ZONE-ID Working with custom hostnames 150 AWS Transfer Family For example: User Guide aws transfer tag-resource --arn arn:aws:transfer:us-east-1:111122223333:server/ s-1234567890abcdef0 --tags Key=transfer:route53HostedZoneId,Value=ABCDE1111222233334444 Assuming the sample values from the previous command, run the following command to view your tags: aws transfer list-tags-for-resource --arn arn:aws:transfer:us- east-1:111122223333:server/s-1234567890abcdef0 "Tags": [ { "Key": "transfer:route53HostedZoneId", "Value": "/hostedzone/ABCDE1111222233334444" }, { "Key": "transfer:customHostname", "Value": "abc.example.com" } ] Note Your public, hosted zones and their IDs are available on Amazon Route 53. Sign in to the AWS Management Console and open the Route 53 console at https:// console.aws.amazon.com/route53/. Transferring files over a server endpoint using a client You transfer files over the AWS Transfer Family service by specifying the transfer operation in a client. AWS Transfer Family supports the following clients: • We support version 3 of the SFTP protocol. • OpenSSH (macOS and Linux) Transfer files over server endpoint 151 AWS Transfer Family Note User Guide This client works only with servers that are enabled for Secure Shell (SSH) File Transfer Protocol (SFTP). • WinSCP (Microsoft Windows only) • Cyberduck (Windows, macOS, and Linux) • FileZilla (Windows, macOS, and Linux) The following limitations apply to every client: • The SCP protocol is not supported, as it is considered insecure. You can use the OpenSSH scp command as described in Using the scp command. • The maximum number of concurrent, multiplexed, SFTP sessions per connection is 10. • There are two timeout values for SFTP/FTP/FTPS connections. For idle connections, the timeout value is 1800 seconds (30 minutes). If there is no activity after the period has passed the client may be disconnected. There is also a 300 seconds (5 minutes) timeout when a client is completely unresponsive. • Amazon S3 and Amazon EFS (due to the NFSv4 protocol) require filenames to be in UTF-8 encoding. Using different encoding can lead to unexpected results. For Amazon S3, see Object key naming guidelines. • For File Transfer Protocol over SSL (FTPS), only Explicit mode is supported. Implicit mode is not supported. • For File Transfer Protocol (FTP) and FTPS, only Passive mode is supported. • For FTP and FTPS, only STREAM mode is supported. • For FTP and FTPS, only Image/Binary mode is supported. • For FTP and FTPS, TLS - PROT C (unprotected) TLS for the data connection is the default but PROT C is not supported in the AWS Transfer Family FTPS protocol. So for FTPS, you need to issue PROT P for your data operation to be accepted. • If you are using Amazon S3 for your server's storage, and if your client contains an option to use multiple connections for a single transfer, make sure to disable the option. Otherwise, large file uploads can fail in unpredictable ways. Note that if you are using Amazon EFS as your storage backend, EFS does support multiple connections for a single transfer. Transfer files over server endpoint 152 AWS Transfer Family User Guide The following is a list of available commands for FTP and FTPS: Available commands FEAT LANG LIST MLST MKD MODE MDTM NLST MFMT MLSD NOOP OPTS PASS PASV PBSZ PROT PWD QUIT RETR RMD RNFR RNTO SIZE STAT STOR STOU STRU SYST TYPE USER ABOR AUTH CDUP CWD DELE EPSV Note APPE is not supported. For SFTP, the following operations are currently not supported for users that are using the logical home directory on servers that are using Amazon Elastic File System (Amazon EFS). Unsupported SFTP
transferfamily-ug-052
transferfamily-ug.pdf
52
a single transfer. Transfer files over server endpoint 152 AWS Transfer Family User Guide The following is a list of available commands for FTP and FTPS: Available commands FEAT LANG LIST MLST MKD MODE MDTM NLST MFMT MLSD NOOP OPTS PASS PASV PBSZ PROT PWD QUIT RETR RMD RNFR RNTO SIZE STAT STOR STOU STRU SYST TYPE USER ABOR AUTH CDUP CWD DELE EPSV Note APPE is not supported. For SFTP, the following operations are currently not supported for users that are using the logical home directory on servers that are using Amazon Elastic File System (Amazon EFS). Unsupported SFTP commands SSH_FXP_READLINK SSH_FXP_SYMLINK SSH_FXP_STAT when the requested file is a symlink SSH_FXP_REALPATH when the requested path contains any symlink components Generate public-private key pair Before you can transfer a file, you must have a public-private key pair available. If you have not previously generated a key pair, see Generate SSH keys for service-managed users. Topics • Available SFTP/FTPS/FTP Commands Transfer files over server endpoint 153 AWS Transfer Family User Guide • Find your Amazon VPC endpoint • Avoid setstat errors • Use OpenSSH • Use WinSCP • Use Cyberduck • Use FileZilla • Use a Perl client • Use LFTP • Post upload processing • SFTP messages Available SFTP/FTPS/FTP Commands The following table describes the available commands for AWS Transfer Family, for the SFTP, FTPS, and FTP protocols. Note The table mentions files and directories for Amazon S3, which only supports buckets and objects: there is no hierarchy. However, you can use prefixes in object key names to imply a hierarchy and organize your data in a way similar to folders. This behavior is described in Working with object metadata in the Amazon Simple Storage Service User Guide. SFTP/FTPS/FTP Commands Command cd chgrp chmod chmtime Amazon S3 Supported Not supported Amazon EFS Supported Supported (root or owner only) Not supported Supported (root only) Not supported Supported Available SFTP/FTPS/FTP Commands 154 AWS Transfer Family User Guide Command Amazon S3 Amazon EFS chown get ln -s ls/dir mkdir put pwd rename rm rmdir Not supported Supported (root only) Supported Not supported Supported Supported Supported Supported Supported (including resolving symbolic links) Supported Supported Supported Supported Supported Supported for files only Supported Note Renaming that would overwrite an existing file or directory is not supported. Supported Supported (empty directories only) Supported Supported version Supported Supported Find your Amazon VPC endpoint If the endpoint type for your Transfer Family server is VPC, identifying the endpoint to use for transferring files is not straightforward. In this case, use the following procedure to find your Amazon VPC endpoint. Find your Amazon VPC endpoint 155 AWS Transfer Family User Guide To find your Amazon VPC endpoint 1. Navigate to your server's details page. 2. In the Endpoint details pane, select the VPC. 3. 4. In the Amazon VPC dashboard, select the VPC endpoint ID. In the list of DNS names, your server endpoint is the first one listed. Find your Amazon VPC endpoint 156 AWS Transfer Family Avoid setstat errors User Guide Some SFTP file transfer clients can attempt to change the attributes of remote files, including timestamp and permissions, using commands, such as SETSTAT when uploading the file. However, these commands are not compatible with object storage systems, such as Amazon S3. Due to this incompatibility, file uploads from these clients can result in errors even when the file is otherwise successfully uploaded. • When you call the CreateServer or UpdateServer API, use the ProtocolDetails option SetStatOption to ignore the error that is generated when the client attempts to use SETSTAT on a file you are uploading to an S3 bucket. • Set the value to ENABLE_NO_OP to have the Transfer Family server ignore the SETSTAT command, and upload files without needing to make any changes to your SFTP client. • Note that while the SetStatOption ENABLE_NO_OP setting ignores the error, it does generate a log entry in CloudWatch Logs, so you can determine when the client is making a SETSTAT call. For the API details for this option, see ProtocolDetails. Use OpenSSH This section contains instructions to transfer files from the command line using OpenSSH. Note This client works only with an SFTP-enabled server. Topics • Using OpenSSH • Using the scp command Using OpenSSH To transfer files over AWS Transfer Family using the OpenSSH command line utility 1. On Linux, macOS, or Windows, open a command terminal. Avoid setstat errors 157 AWS Transfer Family User Guide 2. At the prompt, enter the following command: sftp -i transfer-key sftp_user@service_endpoint In the preceding command, sftp_user is the username and transfer-key is the SSH private key. Here, service_endpoint is the server's endpoint as shown in the AWS Transfer Family console for the selected server. Note This command uses settings that are in the default ssh_config file. Unless you
transferfamily-ug-053
transferfamily-ug.pdf
53
Using OpenSSH • Using the scp command Using OpenSSH To transfer files over AWS Transfer Family using the OpenSSH command line utility 1. On Linux, macOS, or Windows, open a command terminal. Avoid setstat errors 157 AWS Transfer Family User Guide 2. At the prompt, enter the following command: sftp -i transfer-key sftp_user@service_endpoint In the preceding command, sftp_user is the username and transfer-key is the SSH private key. Here, service_endpoint is the server's endpoint as shown in the AWS Transfer Family console for the selected server. Note This command uses settings that are in the default ssh_config file. Unless you have previously edited this file, SFTP uses port 22. You can specify a different port (for example 2222) by adding a -P flag to the command, as follows. sftp -P 2222 -i transfer-key sftp_user@service_endpoint Alternatively, if you always want to use port 2222 or port 22000, you can update your default port in your ssh_config file. 3. 4. An sftp prompt should appear. (Optional) To view the user's home directory, enter the following command at the sftp prompt: pwd To upload a file from your file system to the Transfer Family server, use the put command. For example, to upload hello.txt (assuming that file is in your current directory on your file system), run the following command at the sftp prompt: put hello.txt A message similar to the following appears, indicating that the file transfer is in progress, or complete. Uploading hello.txt to /amzn-s3-demo-bucket/home/sftp_user/hello.txt hello.txt 100% 127 0.1KB/s 00:00 Use OpenSSH 158 AWS Transfer Family Note User Guide After your server is created, it can take a few minutes for the server endpoint hostname to be resolvable by the DNS service in your environment. Using the scp command Transfer Family doesn't support the SCP protocol. However, you can use the OpenSSH scp command if you need this functionality. The recommendation for using SCP over SFTP is to use OpenSSH version 9.0 or later. In OpenSSH version 9 and later, the scp command defaults to using the SFTP protocol for file transfers instead of the legacy SCP protocol. Important Ensure that your Transfer Family server has been configured to use S3 optimized directory access. Use WinSCP Use the instructions that follow to transfer files from the command line using WinSCP. Note If you are using WinSCP 5.19, you can directly connect to Amazon S3 using your AWS credentials and upload/download files. For more details, see Connecting to Amazon S3 service. To transfer files over AWS Transfer Family using WinSCP 1. Open the WinSCP client. 2. In the Login dialog box, for File protocol, choose a protocol: SFTP or FTP. If you chose FTP, for Encryption, choose one of the following: Use WinSCP 159 AWS Transfer Family • No encryption for FTP • TLS/SSL Explicit encryption for FTPS User Guide 3. For Host name, enter your server endpoint. The server endpoint is located on the Server details page. For more information, see View SFTP, FTPS, and FTP server details. If your server uses a VPC endpoint, see Find your Amazon VPC endpoint. 4. For Port number, enter the following: • 22 for SFTP • 21 for FTP/FTPS 5. For User name, enter the name for the user that you created for your specific identity provider. Tip: The username should be one of the users you created or configured for your identity provider. AWS Transfer Family provides the following identity providers: • Working with service-managed users • Using AWS Directory Service for Microsoft Active Directory • Working with custom identity providers 6. Choose Advanced to open the Advanced Site Settings dialog box. In the SSH section, choose Authentication. 7. For Private key file, browse for and choose the SSH private key file from your file system. If WinSCP offers to convert your SSH private key to the PPK format, choose OK. 8. Choose OK to return to the Login dialog box, and then choose Save. 9. In the Save session as site dialog box, choose OK to complete your connection setup. 10. In the Login dialog box, choose Tools, and then choose Preferences. 11. In the Preferences dialog box, for Transfer, choose Endurance. For the Enable transfer resume/transfer to temporary filename for option, choose Disable. Important If you leave this option enabled, it increases upload costs, substantially decreasing upload performance. It also can lead to failures of large file uploads. Use WinSCP 160 AWS Transfer Family User Guide 12. For Transfer, choose Background, and clear the Use multiple connections for single transfer check box. Tip: If you leave this option selected, large file uploads can fail in unpredictable ways. For example, orphaned multipart uploads that incur Amazon S3 charges can be created. Silent data corruption can also occur. 13. Perform your file transfer. You can use drag-and-drop methods to copy files between the
transferfamily-ug-054
transferfamily-ug.pdf
54
choose Disable. Important If you leave this option enabled, it increases upload costs, substantially decreasing upload performance. It also can lead to failures of large file uploads. Use WinSCP 160 AWS Transfer Family User Guide 12. For Transfer, choose Background, and clear the Use multiple connections for single transfer check box. Tip: If you leave this option selected, large file uploads can fail in unpredictable ways. For example, orphaned multipart uploads that incur Amazon S3 charges can be created. Silent data corruption can also occur. 13. Perform your file transfer. You can use drag-and-drop methods to copy files between the target and source windows. You can use toolbar icons to upload, download, delete, edit, or modify the properties of files in WinSCP. Note This note does not apply if you are using Amazon EFS for storage. Commands that attempt to change attributes of remote files, including timestamps, are not compatible with object storage systems such as Amazon S3. Therefore, if you are using Amazon S3 for storage, be sure to disable WinSCP timestamp settings (or use the SetStatOption as described in Avoid setstat errors) before you perform file transfers. To do so, in the WinSCP Transfer settings dialog box, disable the Set permissions upload option and the Preserve timestamp common option. Use Cyberduck Use the instructions that follow to transfer files from the command line using Cyberduck. To transfer files over AWS Transfer Family using Cyberduck 1. Open the Cyberduck client. 2. Choose Open Connection. 3. 4. In the Open Connection dialog box, choose a protocol: SFTP (SSH File Transfer Protocol), FTP-SSL (Explicit AUTH TLS), or FTP (File Transfer Protocol). For Server, enter your server endpoint. The server endpoint is located on the Server details page. For more information, see View SFTP, FTPS, and FTP server details. If your server uses a VPC endpoint, see Find your Amazon VPC endpoint. Use Cyberduck 161 AWS Transfer Family User Guide 5. For Port number, enter the following: • 22 for SFTP • 21 for FTP/FTPS 6. For Username, enter the name for the user that you created in Managing users for server endpoints. 7. If SFTP is selected, for SSH Private Key, choose or enter the SSH private key. 8. Choose Connect. 9. Perform your file transfer. Depending on where your files are, do one of the following: • In your local directory (the source), choose the files that you want to transfer, and drag and drop them into the Amazon S3 directory (the target). • In the Amazon S3 directory (the source), choose the files that you want to transfer, and drag and drop them into your local directory (the target). Use FileZilla Use the instructions that follow to transfer files using FileZilla. To set up FileZilla for a file transfer 1. Open the FileZilla client. 2. Choose File, and then choose Site Manager. 3. In the Site Manager dialog box, choose New site. 4. On the General tab, for Protocol, choose a protocol: SFTP or FTP. If you chose FTP, for Encryption, choose one of the following: • Only use plain FTP (insecure) – for FTP • Use explicit FTP over TLS if available – for FTPS 5. For Host name, enter the protocol that you are using, followed by your server endpoint. The server endpoint is located on the Server details page. For more information, see View SFTP, FTPS, and FTP server details. • If you are using SFTP, enter: sftp://hostname Use FileZilla 162 AWS Transfer Family User Guide • If you are using FTPS, enter: ftps://hostname Make sure to replace hostname with your actual server endpoint. If your server uses a VPC endpoint, see Find your Amazon VPC endpoint. 6. For Port number, enter the following: • 22 for SFTP • 21 for FTP/FTPS 7. If SFTP is selected, for Logon Type, choose Key file. For Key file, choose or enter the SSH private key. 8. For User, enter the name for the user that you created in Managing users for server endpoints. 9. Choose Connect. 10. Perform your file transfer. Note If you interrupt a file transfer in progress, AWS Transfer Family might write a partial object in your Amazon S3 bucket. If you interrupt an upload, check that the file size in the Amazon S3 bucket matches the file size of the source object before continuing. Use a Perl client If you use the NET::SFTP::Foreign perl client, you must set the queue_size to 1. For example: my $sftp = Net::SFTP::Foreign->new('[email protected] east-2.amazonaws.com', queue_size => 1); Note This workaround is needed for revisions of Net::SFTP::Foreign prior to 1.92.02. Use a Perl client 163 AWS Transfer Family Use LFTP User Guide LFTP is a free FTP client that allows users to perform file transfers via the command-line interface from most Linux machines. For large file downloads, LFTP has a
transferfamily-ug-055
transferfamily-ug.pdf
55
check that the file size in the Amazon S3 bucket matches the file size of the source object before continuing. Use a Perl client If you use the NET::SFTP::Foreign perl client, you must set the queue_size to 1. For example: my $sftp = Net::SFTP::Foreign->new('[email protected] east-2.amazonaws.com', queue_size => 1); Note This workaround is needed for revisions of Net::SFTP::Foreign prior to 1.92.02. Use a Perl client 163 AWS Transfer Family Use LFTP User Guide LFTP is a free FTP client that allows users to perform file transfers via the command-line interface from most Linux machines. For large file downloads, LFTP has a known issue with out of order packets, causing the file transfer to fail. Post upload processing You can view post upload processing information including Amazon S3 object metadata and event notifications. Topics • Amazon S3 object metadata • Amazon S3 event notifications Amazon S3 object metadata As a part of your object's metadata you see a key called x-amz-meta-user-agent whose value is AWSTransfer and x-amz-meta-user-agent-id whose value is username@server-id. The username is the Transfer Family user who uploaded the file and server-id is the server used for the upload. This information can be accessed using the HeadObject operation on the S3 object inside your Lambda function. Use LFTP 164 AWS Transfer Family User Guide Amazon S3 event notifications When an object is uploaded to your S3 bucket using Transfer Family, RoleSessionName is contained in the Requester field in the S3 event notification structure as [AWS:Role Unique Identifier]/username.sessionid@server-id. For example, the following are the contents for a sample Requester field from an S3 access log for a file that was copied to the S3 bucket. arn:aws:sts::AWS-Account-ID:assumed-role/IamRoleName/ username.sessionid@server-id In the Requester field above, it shows the IAM Role called IamRoleName. For more information about configuring S3 event notifications, see Configuring Amazon S3 event notifications in the Amazon Simple Storage Service Developer Guide. For more information about AWS Identity and Access Management (IAM) role unique identifiers, see Unique identifiers in the AWS Identity and Access Management User Guide. SFTP messages This section describes client side messages that you may receive during or after your SFTP file transfers when using a Transfer Family server. For more information on any SFTP event, check your SFTP client logs. You can use that information to troubleshoot any errors, or forward that information to your network team for their help in identifying the issue. SFTP client-side messages Activity AUTH_FAILURE CLOSE CONNECTED/DISCONNECTED CREATE_SYMLINK Description The user failed authentication. This can be any kind of failure from a custom identity provider or service managed user. The details in the event help clarify the root cause of the failure. Indicates that an opened file or directory is closed successfully. Indicates normal connection success and disconnections. A symbolic link was created (successfully or unsuccessfully). SFTP messages 165 AWS Transfer Family User Guide Activity DELETE ERROR EXIT_REASON MKDIR OPEN PARTIAL_CLOSE RENAME RMDIR Description A file was deleted (successfully or unsuccess fully). A general, unexpected error. The associated description contains information that can help you or your network administrators to identify the specific issue. Emitted when an unexpected error caused termination of your SFTP session. The message associated with the event describes the cause. A directory was created (successfully or unsuccessfully). A file was opened for read or write (successf ully or unsuccessfully) The client disconnected from the server while a file was still open with no CLOSE message received. Transfer Family stores the received portion of the file (which could in fact be the complete file) and emits the PARTIAL_C LOSE event to alert the customer about the issue. Workflows integration also receives an onPartialClose event to handle the file appropriately. A file was renamed (successfully or unsuccess fully) A directory was deleted (successfully or unsuccessfully) SFTP messages 166 AWS Transfer Family Activity SETSTAT User Guide Description The attributes of a file are changed (successf ully or unsuccessfully). Note Transfer Family doesn't support SETSTAT if you are using Amazon S3 for storage. The Avoid setstat errors section provides details on how to avoid SetStat errors, by turning off the setting. This avoids you receiving a fail unsupported error : instead, you receive success but do nothing message. TLS_RESUME_FAILURE The server is configured to enforce TLS Session Resumption and the client does not support it. Managing users for server endpoints In the following sections, you can find information about how to add users using AWS Transfer Family, AWS Directory Service for Microsoft Active Directory or a custom identity provider. As part of each user's properties, you also store that user's Secure Shell (SSH) public key. Doing so is required for key-based authentication. The private key is stored locally on your user's computer. When your user sends an authentication request to your server by using a client, your server first confirms that the user has
transferfamily-ug-056
transferfamily-ug.pdf
56
enforce TLS Session Resumption and the client does not support it. Managing users for server endpoints In the following sections, you can find information about how to add users using AWS Transfer Family, AWS Directory Service for Microsoft Active Directory or a custom identity provider. As part of each user's properties, you also store that user's Secure Shell (SSH) public key. Doing so is required for key-based authentication. The private key is stored locally on your user's computer. When your user sends an authentication request to your server by using a client, your server first confirms that the user has access to the associated SSH private key. The server then successfully authenticates the user. In addition, you specify a user's home directory, or landing directory, and assign an AWS Identity and Access Management (IAM) role to the user. Optionally, you can provide a session policy to limit user access only to the home directory of your Amazon S3 bucket. Manage users 167 AWS Transfer Family Important User Guide AWS Transfer Family blocks usernames that are 1 or 2 characters long from authenticating to SFTP servers. Additionally, we also block the rootuser name. The reason behind this is due to the large volume of malicious login attempts by password scanners. Amazon EFS vs. Amazon S3 Characteristics of each storage option: • To limit access: Amazon S3 supports session policies; Amazon EFS supports POSIX user, group, and secondary group IDs • Both support public/private keys • Both support home directories • Both support logical directories Note For Amazon S3, most of the support for logical directories is via API/CLI. You can use the Restricted check box in the console to lock down a user to their home directory, but you cannot specify a virtual directory structure. Logical directories If you are specifying logical directory values for your user, the parameter you use depends on the type of user. • For service-managed users, provide logical directory values in HomeDirectoryMappings. • For custom identity provider users, provide logical directory values in HomeDirectoryDetails. Enhanced HomeDirectory support for logical directories AWS Transfer Family now supports specifying a HomeDirectory value when using the LOGICAL HomeDirectoryType. This enhancement applies to Service Managed users, Active Directory access, Amazon EFS vs. Amazon S3 168 AWS Transfer Family User Guide and Custom Identity Provider implementations where the HomeDirectoryDetails are provided in the response. Important When specifying a HomeDirectory with LOGICAL HomeDirectoryType, the value must map to one of your logical directory mappings. The service validates this during both user creation and updates to prevent configurations that would not work. Default behavior By default, if left unspecified, the HomeDirectory is set to "/" for LOGICAL mode. This behavior is unchanged and remains compatible with existing user definitions. • Make sure to map your HomeDirectory to an Entry and not a Target. For more details, see Rules for using logical directories. • For details on how a virtual directory is structured see Virtual directory structure. Custom Identity Provider considerations When using a Custom Identity Provider, you can now specify a HomeDirectory in the response while using LOGICAL HomeDirectoryType. The TestIdentityProvider API call will produce correct results when the Custom IDP specifies a HomeDirectory in LOGICAL mode. Example Custom IDP response with HomeDirectory and LOGICAL HomeDirectoryType: { "Role": "arn:aws:iam::123456789012:role/transfer-user-role", "HomeDirectoryType": "LOGICAL", "HomeDirectory": "/marketing", "HomeDirectoryDetails": "[{\"Entry\":\"/\",\"Target\":\"/bucket/home\"},{\"Entry\": \"/marketing\",\"Target\":\"/marketing-bucket/campaigns\"}]" } Enhanced HomeDirectory for logical directories 169 AWS Transfer Family User Guide Active Directory group quotas AWS Transfer Family has a default limit of 100 Active Directory groups per server. If your use case requires more than 100 groups, consider using a custom identity provider solution as described in Simplify Active Directory authentication with a custom identity provider for AWS Transfer Family. This limit applies to servers using the following identity providers: • AWS Directory Service for Microsoft Active Directory • AWS Directory Service for Entra ID Domain Services If you need to request a service limit increase, see AWS service quotas in the AWS General Reference. If your use case requires more than 100 groups, consider using a custom identity provider solution as described in Simplify Active Directory authentication with a custom identity provider for AWS Transfer Family. For troubleshooting information related to Active Directory group limits, see Active Directory group limits exceeded. Topics • Working with service-managed users • Working with custom identity providers • Using AWS Directory Service for Microsoft Active Directory • Using AWS Directory Service for Entra ID Domain Services Working with service-managed users You can add either Amazon S3 or Amazon EFS service-managed users to your server, depending on the server's Domain setting. For more information, see Configuring an SFTP, FTPS, or FTP server endpoint. If you use a service-managed identity type, you add users to your file transfer protocol enabled server. When you do so, each username must be unique on
transferfamily-ug-057
transferfamily-ug.pdf
57
see Active Directory group limits exceeded. Topics • Working with service-managed users • Working with custom identity providers • Using AWS Directory Service for Microsoft Active Directory • Using AWS Directory Service for Entra ID Domain Services Working with service-managed users You can add either Amazon S3 or Amazon EFS service-managed users to your server, depending on the server's Domain setting. For more information, see Configuring an SFTP, FTPS, or FTP server endpoint. If you use a service-managed identity type, you add users to your file transfer protocol enabled server. When you do so, each username must be unique on your server. To add a service-managed user programmatically, see the example for the CreateUser API. Active Directory group quotas 170 AWS Transfer Family Note User Guide For service-managed users there is a limit of 2,000 logical directory entries. For information about using logical directories see Using logical directories to simplify your Transfer Family directory structures. Topics • Adding Amazon S3 service-managed users • Adding Amazon EFS service-managed users • Managing service-managed users Adding Amazon S3 service-managed users Note If you want to configure a cross account Amazon S3 bucket, follow the steps mentioned in this Knowledge Center article: How do I configure my AWS Transfer Family server to use an Amazon Simple Storage Service bucket that's in another AWS account?. To add an Amazon S3 service-managed user to your server 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/, then select Servers from the navigation pane. 2. On the Servers page, select the check box of the server that you want to add a user to. 3. Choose Add user. 4. In the User configuration section, for Username, enter the username. This username must be a minimum of 3 and a maximum of 100 characters. You can use the following characters in the username: a–z, A-Z, 0–9, underscore '_', hyphen '-', period '.' and at sign '@'. The username can't start with a hyphen '-', period '.' or at sign '@'. 5. For Access, choose the IAM role that you previously created that provides access to your Amazon S3 bucket. You created this IAM role using the procedure in Create an IAM role and policy. That IAM role includes an IAM policy that provides access to your Amazon S3 bucket. It also includes a trust Service-managed users 171 AWS Transfer Family User Guide relationship with the AWS Transfer Family service, defined in another IAM policy. If you need fine-grained access control for your users, refer to the Enhance data access control with AWS Transfer Family and Amazon S3 blog post. 6. (Optional) For Policy, select one of the following: • None • Existing policy • Select a policy from IAM: allows you to choose an existing session policy. Choose View to see a JSON object containing the details of the policy. • Auto-generate policy based on home folder: generates a session policy for you. Choose View to see a JSON object containing the details of the policy. Note If you choose Auto-generate policy based on home folder, do not select Restricted for this user. To learn more about session policies, see Create an IAM role and policy. To learn more about creating a session policy, see Creating a session policy for an Amazon S3 bucket. 7. For Home directory, choose the Amazon S3 bucket to store the data to transfer using AWS Transfer Family. Enter the path to the home directory where your user lands when they log in using their client. If you keep this parameter blank, the root directory of your Amazon S3 bucket is used. In this case, make sure that your IAM role provides access to this root directory. Note We recommend that you choose a directory path that contains the user name of the user, which enables you to effectively use a session policy. The session policy limits user access in the Amazon S3 bucket to that user's home directory. 8. (Optional) For Restricted, select the check box so that your users can't access anything outside of that folder and can't see the Amazon S3 bucket or folder name. Service-managed users 172 AWS Transfer Family Note User Guide Assigning the user a home directory and restricting the user to that home directory should be sufficient to lock down the user's access to the designated folder. If you need to apply further controls, use a session policy. If you select Restricted for this user, you cannot select Auto-generate policy based on home folder, because home folder is not a defined value for Restricted users. 9. For SSH public key, enter the public SSH key portion of the SSH key pair. Your key is validated by the service before you can add your new user. Note For instructions on how to generate an SSH key pair, see
transferfamily-ug-058
transferfamily-ug.pdf
58
restricting the user to that home directory should be sufficient to lock down the user's access to the designated folder. If you need to apply further controls, use a session policy. If you select Restricted for this user, you cannot select Auto-generate policy based on home folder, because home folder is not a defined value for Restricted users. 9. For SSH public key, enter the public SSH key portion of the SSH key pair. Your key is validated by the service before you can add your new user. Note For instructions on how to generate an SSH key pair, see Generate SSH keys for service-managed users. 10. (Optional) For Key and Value, enter one or more tags as key-value pairs, and choose Add tag. 11. Choose Add to add your new user to the server that you chose. The new user appears in the Users section of the Server details page. Next steps – For the next step, continue on to Transferring files over a server endpoint using a client. Adding Amazon EFS service-managed users Amazon EFS uses the Portable Operating System Interface (POSIX) file permission model to represent file ownership. • For more details on Amazon EFS file ownership, see Amazon EFS file ownership. • For more details on setting up directories for your EFS users, see Set up Amazon EFS users for Transfer Family. Service-managed users 173 AWS Transfer Family User Guide To add an Amazon EFS service-managed user to your server 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/, then select Servers from the navigation pane. 2. On the Servers page, select the Amazon EFS server that you want to add a user to. 3. Choose Add user to display the Add user page. 4. In the User configuration section, use the following settings. a. The Username, must be a minimum of 3 and a maximum of 100 characters. You can use the following characters in the username: a–z, A-Z, 0–9, underscore '_', hyphen '-', period '.', and at sign "@". The username can't start with a hyphen '-', period '.', or at sign "@". b. For User ID and Group ID, note the following: • For the first user that you create, we recommend that you enter a value of 0 for both Group ID and User ID. This grants the user administrator privileges for Amazon EFS. • For additional users, enter the user's POSIX user ID and group ID. These IDs are used for all Amazon Elastic File System operations performed by the user. • For User ID and Group ID, do not use any leading zeroes. For example, 12345 is acceptable, 012345 is not. c. (Optional) For Secondary Group IDs, enter one or more additional POSIX group IDs for each user, separated by commas. d. For Access, choose the IAM role that: • Gives the user access to only the Amazon EFS resources (file systems) that you want them to access. • Defines which file system operations that the user can and cannot perform. We recommend that you use the IAM role for Amazon EFS file system selection with mount access and read/write permissions. For example, the combination of the following two AWS managed policies, while quite permissive, grants the necessary permissions for your user: • AmazonElasticFileSystemClientFullAccess • AWSTransferConsoleFullAccess Service-managed users 174 AWS Transfer Family User Guide For more information, see the blog post AWS Transfer Family support for Amazon Elastic File System. e. For Home directory, do the following: • Choose the Amazon EFS file system that you want to use for storing the data to transfer using AWS Transfer Family. • Decide whether to set the home directory to Restricted. Setting the home directory to Restricted has the following effects: • Amazon EFS users can't access any files or directories outside of that folder. • Amazon EFS users can't see the Amazon EFS file system name (fs-xxxxxxx). Note When you select the Restricted option, symlinks don't resolve for Amazon EFS users. • (Optional) Enter the path to the home directory that you want users to be in when they log in using their client. If you don't specify a home directory, the root directory of your Amazon EFS file system is used. In this case, make sure that your IAM role provides access to this root directory. 5. For SSH public key, enter the public SSH key portion of the SSH key pair. Your key is validated by the service before you can add your new user. Note For instructions on how to generate an SSH key pair, see Generate SSH keys for service-managed users. 6. (Optional) Enter any tags for the user. For Key and Value, enter one or more tags as key-value pairs, and choose Add tag. 7. Choose Add to add your new user to the server that
transferfamily-ug-059
transferfamily-ug.pdf
59
used. In this case, make sure that your IAM role provides access to this root directory. 5. For SSH public key, enter the public SSH key portion of the SSH key pair. Your key is validated by the service before you can add your new user. Note For instructions on how to generate an SSH key pair, see Generate SSH keys for service-managed users. 6. (Optional) Enter any tags for the user. For Key and Value, enter one or more tags as key-value pairs, and choose Add tag. 7. Choose Add to add your new user to the server that you chose. The new user appears in the Users section of the Server details page. Service-managed users 175 AWS Transfer Family User Guide Issues that you might encounter when you first SFTP to your Transfer Family server: • If you run the sftp command and the prompt doesn't appear, you might encounter the following message: Couldn't canonicalize: Permission denied Need cwd In this case, you must increase the policy permissions for your user's role. You can add an AWS managed policy, such as AmazonElasticFileSystemClientFullAccess. • If you enter pwd at the sftp prompt to view the user's home directory, you might see the following message, where USER-HOME-DIRECTORY is the home directory for the SFTP user: remote readdir("/USER-HOME-DIRECTORY"): No such file or directory In this case, you should be able to navigate to the parent directory (cd ..), and create the user's home directory (mkdir username) . Next steps – For the next step, continue on to Transferring files over a server endpoint using a client. Managing service-managed users In this section, you can find information about how to view a list of users, how to edit user details, and how to add an SSH public key. • View a list of users • View or edit user details • Delete a user • Add SSH public key • Delete SSH public key To find a list of your users 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. Select Servers from the navigation pane to display the Servers page. 3. Choose the identifier in the Server ID column to see the Server details page. Service-managed users 176 AWS Transfer Family User Guide 4. Under Users, view a list of users. To view or edit user details 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. Select Servers from the navigation pane to display the Servers page. 3. Choose the identifier in the Server ID column to see the Server details page. 4. Under Users, choose a username to see the User details page. You can change the user's properties on this page by choosing Edit. 5. On the Users details page, choose Edit next to User configuration. 6. On the Edit configuration page, for Access, choose the IAM role that you previously created that provides access to your Amazon S3 bucket. You created this IAM role using the procedure in Create an IAM role and policy. That IAM role includes an IAM policy that provides access to your Amazon S3 bucket. It also includes a trust relationship with the AWS Transfer Family service, defined in another IAM policy. 7. (Optional) For Policy, choose one of the following: Service-managed users 177 AWS Transfer Family • None • Existing policy User Guide • Select a policy from IAM to choose an existing policy. Choose View to see a JSON object containing the details of the policy. To learn more about session policies, see Create an IAM role and policy. To learn more about creating a session policy, see Creating a session policy for an Amazon S3 bucket. 8. For Home directory, choose the Amazon S3 bucket to store the data to transfer using AWS Transfer Family. Enter the path to the home directory where your user lands when they log in using their client. If you leave this parameter blank, the root directory of your Amazon S3 bucket is used. In this case, make sure that your IAM role provides access to this root directory. Note We recommend that you choose a directory path that contains the user name of the user, which enables you to effectively use a session policy. The session policy limits user access in the Amazon S3 bucket to that user's home directory. 9. (Optional) For Restricted, select the check box so that your users can't access anything outside of that folder and can't see the Amazon S3 bucket or folder name. Note When assigning the user a home directory and restricting the user to that home directory, this should be sufficient enough to lock down the user's access to the designated folder. Use a session policy when you need to apply further controls. 10. Choose Save to save your changes. To delete a user 1.
transferfamily-ug-060
transferfamily-ug.pdf
60
policy. The session policy limits user access in the Amazon S3 bucket to that user's home directory. 9. (Optional) For Restricted, select the check box so that your users can't access anything outside of that folder and can't see the Amazon S3 bucket or folder name. Note When assigning the user a home directory and restricting the user to that home directory, this should be sufficient enough to lock down the user's access to the designated folder. Use a session policy when you need to apply further controls. 10. Choose Save to save your changes. To delete a user 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. Select Servers from the navigation pane to display the Servers page. 3. Choose the identifier in the Server ID column to see the Server details page. Service-managed users 178 AWS Transfer Family User Guide 4. Under Users, choose a username to see the User details page. 5. On the Users details page, choose Delete to the right of the username. 6. In the confirmation dialog box that appears, enter the word delete, and then choose Delete to confirm that you want to delete the user. The user is deleted from the users list. To add an SSH public key for a user 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. In the navigation pane, choose Servers. 3. Choose the identifier in the Server ID column to see the Server details page. 4. Under Users, choose a username to see the User details page. 5. Choose Add SSH public key to add a new SSH public key to a user. Note SSH keys are used only by servers that are enabled for Secure Shell (SSH) File Transfer Protocol (SFTP). For information about how to generate an SSH key pair, see Generate SSH keys for service-managed users. 6. For SSH public key, enter the SSH public key portion of the SSH key pair. Your key is validated by the service before you can add your new user. The format of the SSH key is ssh-rsa string. To generate an SSH key pair, see Generate SSH keys for service- managed users. 7. Choose Add key. To delete an SSH public key for a user 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 2. In the navigation pane, choose Servers. 3. Choose the identifier in the Server ID column to see the Server details page. 4. Under Users, choose a username to see the User details page. 5. To delete a public key, select its SSH key check box and choose Delete. Service-managed users 179 AWS Transfer Family User Guide Working with custom identity providers AWS Transfer Family offers several options for custom identity providers to authenticate and authorize users for secure file transfers. Here are the main approaches: • Custom identity provider solution—This topic describes the Transfer Family custom identity provider solution, using a toolkit hosted in GitHub. Note For most use cases, this is the recommended option. Specifically, if you need to support more than 100 Active Directory groups, the custom identity provider solution offers a scalable alternative without group limitations. This solution is described in the blog post, Simplify Active Directory authentication with a custom identity provider for AWS Transfer Family. • Using AWS Lambda to integrate your identity provider—This topic describes how to create an AWS Lambda function that connects to your custom identity provider. To authenticate your users, you can use your existing identity provider with AWS Transfer Family. You integrate your identity provider using an AWS Lambda function, which authenticates and authorizes your users for access to Amazon S3 or Amazon Elastic File System (Amazon EFS). For details, see Using AWS Lambda to integrate your identity provider. You can also access CloudWatch graphs for metrics such as number of files and bytes transferred in the AWS Transfer Family Management Console, giving you a single pane of glass to monitor file transfers using a centralized dashboard. • Using Amazon API Gateway to integrate your identity provider—This topic describes how to use an AWS Lambda function to back an Amazon API Gateway method. You can provide a RESTful interface with a single Amazon API Gateway method. Transfer Family calls this method to connect to your identity provider, which authenticates and authorizes your users for access to Amazon S3 or Amazon EFS. Use this option if you need a RESTful API to integrate your identity provider or if you want to use AWS WAF to leverage its capabilities for geo-blocking or rate-limiting requests. For details, see Using Amazon API Gateway to integrate your identity provider. • Transfer Family provides a blog post and a workshop that walk you through building a file transfer solution. This solution leverages AWS Transfer Family for managed SFTP/FTPS endpoints and Amazon Cognito and DynamoDB
transferfamily-ug-061
transferfamily-ug.pdf
61
calls this method to connect to your identity provider, which authenticates and authorizes your users for access to Amazon S3 or Amazon EFS. Use this option if you need a RESTful API to integrate your identity provider or if you want to use AWS WAF to leverage its capabilities for geo-blocking or rate-limiting requests. For details, see Using Amazon API Gateway to integrate your identity provider. • Transfer Family provides a blog post and a workshop that walk you through building a file transfer solution. This solution leverages AWS Transfer Family for managed SFTP/FTPS endpoints and Amazon Cognito and DynamoDB for user management. Custom identity provider 180 AWS Transfer Family User Guide The blog post is available at Using Amazon Cognito as an identity provider with AWS Transfer Family and Amazon S3. You can view the details for the workshop here. Note For custom identity providers, the username must be a minimum of 3 and a maximum of 100 characters. You can use the following characters in the username: a–z, A-Z, 0–9, underscore '_', hyphen '-', period '.' and at sign '@'. The username can't start with a hyphen '-', period '.' or at sign '@'. When implementing a custom identity provider, consider the following best practices: • Deploy the solution in the same AWS account and region as your Transfer Family servers. • Implement the principle of least privilege when configuring IAM roles and policies. • Use features like IP allow-listing and standardized logging for enhanced security. • Test your custom identity provider thoroughly in a non-production environment before deployment. Topics • Custom identity provider solution • Using AWS Lambda to integrate your identity provider • Using Amazon API Gateway to integrate your identity provider • Using multiple authentication methods Custom identity provider solution The AWS Transfer Family custom identity provider solution is a modular custom identity provider solution that solves for many common authentication and authorization use cases that enterprises have when implementing the service. This solution provides a reusable foundation for implementing custom identity providers with granular per-user session configuration and separates authentication and authorization logic, offering a flexible and easy-to-maintain foundation for various use cases. Custom identity provider 181 AWS Transfer Family User Guide With the AWS Transfer Family custom identity provider solution, you can address common enterprise authentication and authorization use cases. This modular solution offers: • A reusable foundation for implementing custom identity providers • Granular per-user session configuration • Separated authentication and authorization logic The solution provides a flexible and maintainable base for various use cases. To get started, review the toolkit at https://github.com/aws-samples/toolkit-for-aws-transfer-family, then follow the deployment instructions in the Getting started section. Note If you have previously used custom identity provider templates and examples, consider adopting this solution instead. Moving forward, provider-specific modules will standardize on this solution. Ongoing maintenance and feature enhancements will be applied to this solution. This solution contains standard patterns for implementing a custom provider that accounts for details including logging and where to store the additional session metadata needed for AWS Transfer Family, such as the HomeDirectoryDetails parameter. This solution provides a Custom identity provider 182 AWS Transfer Family User Guide reusable foundation for implementing custom identity providers with granular per-user session configuration, and decouples the identity provider authentication logic from the reusable logic that builds a configuration that is returned to Transfer Family to complete authentication and establish settings for the session. The code and supporting resources for this solution are available at https://github.com/aws- samples/toolkit-for-aws-transfer-family. The toolkit contains the following features: • An AWS Serverless Application Model template that provisions the required resources. Optionally, deploy and configure Amazon API Gateway to incorporate AWS WAF, as described in the blog post Securing AWS Transfer Family with AWS Web Application Firewall and Amazon API Gateway. • An Amazon DynamoDB schema to store configuration metadata about identity providers, including user session settings such as HomeDirectoryDetails, Role, and Policy. • A modular approach that enables you to add new identity providers to the solution in the future, as modules. • Attribute retrieval: Optionally retrieve IAM role and POSIX Profile (UID and GID) attributes from supported identity providers, including AD, LDAP, and Okta. • Support for multiple identity providers connected to a single Transfer Family server and multiple Transfer Family servers using the same deployment of the solution. • Built-in IP allow-list checking such as IP allow lists that can optionally be configured on a per- user or per-identity provider basis. • Detailed logging with configurable log-level and tracing support to aid in troubleshooting. Before you begin to deploy the custom identity provider solution, you need to have the following AWS resources. • An Amazon Virtual Private Cloud (VPC) with private subnets, with internet connectivity through either a NAT gateway or a DynamoDB gateway endpoint. • Appropriate IAM permissions to
transferfamily-ug-062
transferfamily-ug.pdf
62
to a single Transfer Family server and multiple Transfer Family servers using the same deployment of the solution. • Built-in IP allow-list checking such as IP allow lists that can optionally be configured on a per- user or per-identity provider basis. • Detailed logging with configurable log-level and tracing support to aid in troubleshooting. Before you begin to deploy the custom identity provider solution, you need to have the following AWS resources. • An Amazon Virtual Private Cloud (VPC) with private subnets, with internet connectivity through either a NAT gateway or a DynamoDB gateway endpoint. • Appropriate IAM permissions to perform the following tasks: • Deploy the custom-idp.yaml AWS CloudFormation template, • Create AWS CodePipeline projects • Create AWS CodeBuild projects Custom identity provider 183 AWS Transfer Family • Create IAM roles and policies Important User Guide You must deploy the solution to the same AWS account and AWS Region that contains your target Transfer Family servers. Supported identity providers The following list contains details for identity providers that are supported for the custom identity provider solution. Provider Password flows Public key flows Multi-factor Attribute retrieval Details Active Directory and Yes LDAP Yes* No Yes Argon2 (local hash) Yes No No No User verificat ion can be performed as part of public key authentic ation flow. *Retrievi ng keys from AD/ LDAP is not supported. Argon2 hashes are stored in the user record for 'local' password based authentic Custom identity provider 184 AWS Transfer Family Provider Password flows Public key flows Multi-factor Attribute retrieval Details User Guide Amazon Cognito Yes No Yes* No Yes No No No Entra ID (formerly Azure AD) Okta Yes Public key No Yes Yes Yes* No Yes No Secrets Manager Yes Yes No No ation use cases. Time-base d One-Time Password (TOTP)-ba sed multi-fac tor authentic ation only. *SMS-base d MFA is not supported. TOTP-based MFA only. Public keys are stored in the user record in DynamoDB. Custom identity provider 185 AWS Transfer Family User Guide Using AWS Lambda to integrate your identity provider This topic describes how to create an AWS Lambda function that connects to your custom identity provider. You can use any custom identity provider, such as Okta, Secrets Manager, OneLogin, or a custom data store that includes authorization and authentication logic. For most use cases, the recommended way to configure a custom identity provider is to use the Custom identity provider solution. Note Before you create a Transfer Family server that uses Lambda as the identity provider, you must create the function. For an example Lambda function, see Example Lambda functions. Or, you can deploy a CloudFormation stack that uses one of the Lambda function templates. Also, make sure your Lambda function uses a resource-based policy that trusts Transfer Family. For an example policy, see Lambda resource-based policy. 1. Open the AWS Transfer Family console. 2. Choose Create server to open the Create server page. For Choose an identity provider, choose Custom Identity Provider, as shown in the following screenshot. Custom identity provider 186 AWS Transfer Family User Guide Note The choice of authentication methods is only available if you enable SFTP as one of the protocols for your Transfer Family server. 3. Make sure the default value, Use AWS Lambda to connect your identity provider, is selected. 4. 5. For AWS Lambda function, choose the name of your Lambda function. Fill in the remaining boxes, and then choose Create server. For details on the remaining steps for creating a server, see Configuring an SFTP, FTPS, or FTP server endpoint. Custom identity provider 187 AWS Transfer Family Lambda resource-based policy User Guide You must have a policy that references the Transfer Family server and Lambda ARNs. For example, you could use the following policy with your Lambda function that connects to your identity provider. The policy is escaped JSON as a string. "Policy": "{ "Version": "2012-10-17", "Id": "default", "Statement": [ { "Sid": "AllowTransferInvocation", "Effect": "Allow", "Principal": { "Service": "transfer.amazonaws.com" }, "Action": "lambda:InvokeFunction", "Resource": "arn:aws:lambda:region:account-id:function:my-lambda-auth-function", "Condition": { "ArnLike": { "AWS:SourceArn": "arn:aws:transfer:region:account-id:server/server-id" } } } ] }" Note In the example policy above, replace each user input placeholder with your own information. Event message structure The event message structure from SFTP server sent to the authorizer Lambda function for a custom IDP is as follows. { "username": "value", "password": "value", Custom identity provider 188 AWS Transfer Family User Guide "protocol": "SFTP", "serverId": "s-abcd123456", "sourceIp": "192.168.0.100" } Where username and password are the values for the sign-in credentials that are sent to the server. For example, you enter the following command to connect: sftp bobusa@server_hostname You are then prompted to enter your password: Enter password: mysecretpassword You can check this from your Lambda function by printing the passed event from within the Lambda function. It should look similar to the following text block. {
transferfamily-ug-063
transferfamily-ug.pdf
63
to the authorizer Lambda function for a custom IDP is as follows. { "username": "value", "password": "value", Custom identity provider 188 AWS Transfer Family User Guide "protocol": "SFTP", "serverId": "s-abcd123456", "sourceIp": "192.168.0.100" } Where username and password are the values for the sign-in credentials that are sent to the server. For example, you enter the following command to connect: sftp bobusa@server_hostname You are then prompted to enter your password: Enter password: mysecretpassword You can check this from your Lambda function by printing the passed event from within the Lambda function. It should look similar to the following text block. { "username": "bobusa", "password": "mysecretpassword", "protocol": "SFTP", "serverId": "s-abcd123456", "sourceIp": "192.168.0.100" } The event structure is similar for FTP and FTPS: the only difference is those values are used for the protocol parameter, rather than SFTP. Lambda functions for authentication To implement different authentication strategies, edit the Lambda function. To help you meet your application's needs, you can deploy a CloudFormation stack. For more information about Lambda, see the AWS Lambda Developer Guide or Building Lambda functions with Node.js. Topics • Valid Lambda values • Example Lambda functions Custom identity provider 189 AWS Transfer Family • Testing your configuration • Lambda function templates Valid Lambda values User Guide The following table describes details for the values that Transfer Family accepts for Lambda functions that are used for custom identity providers. Value Role Required Required Description Specifies the Amazon Resource Name (ARN) of the IAM role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests. For details on establishing a trust relationship, see To establish a trust relationship. PosixProfile The full POSIX identity, including user ID (Uid), group ID (Gid), and any secondary group IDs (Secondary Gids ), that controls your Required for Amazon EFS backing storage Custom identity provider 190 AWS Transfer Family User Guide Value Description Required users' access to your Amazon EFS file systems. The POSIX permissions that are set on files and directories in your file system determine the level of access your users get when transferring files into and out of your Amazon EFS file systems. A list of SSH public key values that are valid for this user. An empty list implies that this is not a valid login. Must not be returned during password authentication. A session policy for your user so that you can use the same IAM role across multiple users. This policy scopes down user access to portions of their Amazon S3 bucket. Optional Optional PublicKeys Policy Custom identity provider 191 AWS Transfer Family User Guide Required Optional Value Description HomeDirectoryType The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. • If you set it to PATH, the user sees the absolute Amazon S3 bucket or Amazon EFS paths as is in their file transfer protocol clients. • If you set it to LOGICAL, you must provide mappings in the HomeDirec toryDetails parameter to make Amazon S3 or Amazon EFS paths visible to your users. HomeDirectoryDetails Logical directory mappings that specify which Amazon Required if HomeDirec toryType has a value of S3 or Amazon EFS paths LOGICAL and keys should be visible to your user and how you want to make them visible. You must specify the Entry and Target pair, where Entry shows how the path is made visible and Target is the actual Amazon S3 or Amazon EFS path. Custom identity provider 192 AWS Transfer Family User Guide Value Description HomeDirectory The landing directory for a user when they log in to the server using the client. Required Optional Note HomeDirectoryDetails is a string representation of a JSON map. This is in contrast to PosixProfile, which is an actual JSON map object, and PublicKeys which is a JSON array of strings. See the code examples for the language-specific details. Example Lambda functions This section presents some example Lambda functions, in both NodeJS and Python. Note In these examples, the user, role, POSIX profile, password, and home directory details are all examples, and must be replaced with your actual values. Logical home directory, NodeJS The following NodeJS example function provides the details for a user that has a logical home directory. // GetUserConfig Lambda exports.handler = (event, context, callback) => { console.log("Username:", event.username, "ServerId: ", event.serverId); var response; // Check if the username presented for authentication is correct. This doesn't check the value of the server
transferfamily-ug-064
transferfamily-ug.pdf
64
for the language-specific details. Example Lambda functions This section presents some example Lambda functions, in both NodeJS and Python. Note In these examples, the user, role, POSIX profile, password, and home directory details are all examples, and must be replaced with your actual values. Logical home directory, NodeJS The following NodeJS example function provides the details for a user that has a logical home directory. // GetUserConfig Lambda exports.handler = (event, context, callback) => { console.log("Username:", event.username, "ServerId: ", event.serverId); var response; // Check if the username presented for authentication is correct. This doesn't check the value of the server ID, only that it is provided. if (event.serverId !== "" && event.username == 'example-user') { var homeDirectoryDetails = [ { Custom identity provider 193 AWS Transfer Family User Guide Entry: "/", Target: "/fs-faa1a123" } ]; response = { Role: 'arn:aws:iam::123456789012:role/transfer-access-role', // The user is authenticated if and only if the Role field is not blank PosixProfile: {"Gid": 65534, "Uid": 65534}, // Required for EFS access, but not needed for S3 HomeDirectoryDetails: JSON.stringify(homeDirectoryDetails), HomeDirectoryType: "LOGICAL", }; // Check if password is provided if (!event.password) { // If no password provided, return the user's SSH public key response['PublicKeys'] = [ "ssh- rsa abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" ]; // Check if password is correct } else if (event.password !== 'Password1234') { // Return HTTP status 200 but with no role in the response to indicate authentication failure response = {}; } } else { // Return HTTP status 200 but with no role in the response to indicate authentication failure response = {}; } callback(null, response); }; Path-based home directory, NodeJS The following NodeJS example function provides the details for a user that has a path-based home directory. // GetUserConfig Lambda exports.handler = (event, context, callback) => { console.log("Username:", event.username, "ServerId: ", event.serverId); var response; Custom identity provider 194 AWS Transfer Family User Guide // Check if the username presented for authentication is correct. This doesn't check the value of the server ID, only that it is provided. // There is also event.protocol (one of "FTP", "FTPS", "SFTP") and event.sourceIp (e.g., "127.0.0.1") to further restrict logins. if (event.serverId !== "" && event.username == 'example-user') { response = { Role: 'arn:aws:iam::123456789012:role/transfer-access-role', // The user is authenticated if and only if the Role field is not blank Policy: '', // Optional, JSON stringified blob to further restrict this user's permissions HomeDirectory: '/fs-faa1a123' // Not required, defaults to '/' }; // Check if password is provided if (!event.password) { // If no password provided, return the user's SSH public key response['PublicKeys'] = [ "ssh- rsa abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" ]; // Check if password is correct } else if (event.password !== 'Password1234') { // Return HTTP status 200 but with no role in the response to indicate authentication failure response = {}; } } else { // Return HTTP status 200 but with no role in the response to indicate authentication failure response = {}; } callback(null, response); }; Logical home directory, Python The following Python example function provides the details for a user that has a logical home directory. # GetUserConfig Python Lambda with LOGICAL HomeDirectoryDetails import json def lambda_handler(event, context): print("Username: {}, ServerId: {}".format(event['username'], event['serverId'])) Custom identity provider 195 AWS Transfer Family response = {} User Guide # Check if the username presented for authentication is correct. This doesn't check the value of the server ID, only that it is provided. if event['serverId'] != '' and event['username'] == 'example-user': homeDirectoryDetails = [ { 'Entry': '/', 'Target': '/fs-faa1a123' } ] response = { 'Role': 'arn:aws:iam::123456789012:role/transfer-access-role', # The user will be authenticated if and only if the Role field is not blank 'PosixProfile': {"Gid": 65534, "Uid": 65534}, # Required for EFS access, but not needed for S3 'HomeDirectoryDetails': json.dumps(homeDirectoryDetails), 'HomeDirectoryType': "LOGICAL" } # Check if password is provided if event.get('password', '') == '': # If no password provided, return the user's SSH public key response['PublicKeys'] = [ "ssh- rsa abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" ] # Check if password is correct elif event['password'] != 'Password1234': # Return HTTP status 200 but with no role in the response to indicate authentication failure response = {} else: # Return HTTP status 200 but with no role in the response to indicate authentication failure response = {} return response Path-based home directory, Python The following Python example function provides the details for a user that has a path-based home directory. # GetUserConfig Python Lambda with PATH HomeDirectory Custom identity provider 196 AWS Transfer Family User Guide def lambda_handler(event, context): print("Username: {}, ServerId: {}".format(event['username'], event['serverId'])) response = {} # Check if the username presented for authentication is correct. This doesn't check the value of the server ID, only that it is provided. # There is also event.protocol (one of "FTP", "FTPS", "SFTP") and event.sourceIp (e.g., "127.0.0.1") to further restrict logins. if event['serverId'] != '' and event['username'] == 'example-user': response =
transferfamily-ug-065
transferfamily-ug.pdf
65
Path-based home directory, Python The following Python example function provides the details for a user that has a path-based home directory. # GetUserConfig Python Lambda with PATH HomeDirectory Custom identity provider 196 AWS Transfer Family User Guide def lambda_handler(event, context): print("Username: {}, ServerId: {}".format(event['username'], event['serverId'])) response = {} # Check if the username presented for authentication is correct. This doesn't check the value of the server ID, only that it is provided. # There is also event.protocol (one of "FTP", "FTPS", "SFTP") and event.sourceIp (e.g., "127.0.0.1") to further restrict logins. if event['serverId'] != '' and event['username'] == 'example-user': response = { 'Role': 'arn:aws:iam::123456789012:role/transfer-access-role', # The user will be authenticated if and only if the Role field is not blank 'Policy': '', # Optional, JSON stringified blob to further restrict this user's permissions 'HomeDirectory': '/fs-fs-faa1a123', 'HomeDirectoryType': "PATH" # Not strictly required, defaults to PATH } # Check if password is provided if event.get('password', '') == '': # If no password provided, return the user's SSH public key response['PublicKeys'] = [ "ssh- rsa abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" ] # Check if password is correct elif event['password'] != 'Password1234': # Return HTTP status 200 but with no role in the response to indicate authentication failure response = {} else: # Return HTTP status 200 but with no role in the response to indicate authentication failure response = {} return response Testing your configuration After you create your custom identity provider, you should test your configuration. Custom identity provider 197 AWS Transfer Family Console User Guide To test your configuration by using the AWS Transfer Family console 1. Open the AWS Transfer Family console. 2. On the Servers page, choose your new server, choose Actions, and then choose Test. 3. Enter the text for Username and Password that you set when you deployed the AWS CloudFormation stack. If you kept the default options, the username is myuser and the password is MySuperSecretPassword. 4. Choose the Server protocol and enter the IP address for Source IP, if you set them when you deployed the AWS CloudFormation stack. CLI To test your configuration by using the AWS CLI 1. Run the test-identity-provider command. Replace each user input placeholder with your own information, as described in the subsequent steps. aws transfer test-identity-provider --server-id s-1234abcd5678efgh --user- name myuser --user-password MySuperSecretPassword --server-protocol FTP -- source-ip 127.0.0.1 Enter the server ID. Enter the username and password that you set when you deployed the AWS CloudFormation stack. If you kept the default options, the username is myuser and the password is MySuperSecretPassword. Enter the server protocol and source IP address, if you set them when you deployed the AWS CloudFormation stack. 2. 3. 4. If user authentication succeeds, the test returns a StatusCode: 200 HTTP response, an empty string Message: "" (which would contain a reason for failure otherwise), and a Response field. Custom identity provider 198 AWS Transfer Family Note User Guide In the response example below, the Response field is a JSON object that has been "stringified" (converted into a flat JSON string that can be used inside a program), and contains the details of the user's roles and permissions. { "Response":"{\"Policy\":\"{\\\"Version\\\":\\\"2012-10-17\\\",\\\"Statement\\\": [{\\\"Sid\\\":\\\"ReadAndListAllBuckets\\\",\\\"Effect\\\":\\\"Allow\\\",\\\"Action\\ \":[\\\"s3:ListAllMybuckets\\\",\\\"s3:GetBucketLocation\\\",\\\"s3:ListBucket\\\",\\ \"s3:GetObjectVersion\\\",\\\"s3:GetObjectVersion\\\"],\\\"Resource\\\":\\\"*\\\"}]}\", \"Role\":\"arn:aws:iam::000000000000:role/MyUserS3AccessRole\",\"HomeDirectory\":\"/ \"}", "StatusCode": 200, "Message": "" } Lambda function templates You can deploy an AWS CloudFormation stack that uses a Lambda function for authentication. We provide several templates that authenticate and authorize your users using sign-in credentials. You can modify these templates or AWS Lambda code to further customize user access. Note You can create a FIPS-enabled AWS Transfer Family server through AWS CloudFormation by specifying a FIPS-enabled security policy in your template. Available security policies are described in Security policies for AWS Transfer Family servers To create an AWS CloudFormation stack to use for authentication 1. Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation. 2. Follow the instructions for deploying an AWS CloudFormation stack from an existing template in Selecting a stack template in the AWS CloudFormation User Guide. 3. Use one of the following templates to create a Lambda function to use for authentication in Transfer Family. Custom identity provider 199 AWS Transfer Family User Guide • Classic (Amazon Cognito) stack template A basic template for creating a AWS Lambda for use as a custom identity provider in AWS Transfer Family. It authenticates against Amazon Cognito for password-based authentication and public keys are returned from an Amazon S3 bucket if public key based authentication is used. After deployment, you can modify the Lambda function code to do something different. • AWS Secrets Manager stack template A basic template that uses AWS Lambda with an AWS Transfer Family server to integrate Secrets Manager as an identity provider. It authenticates against an entry in AWS Secrets Manager of the format aws/transfer/server-id/username. Additionally, the secret must hold the key-value pairs for all user properties returned to Transfer Family. After
transferfamily-ug-066
transferfamily-ug.pdf
66
provider in AWS Transfer Family. It authenticates against Amazon Cognito for password-based authentication and public keys are returned from an Amazon S3 bucket if public key based authentication is used. After deployment, you can modify the Lambda function code to do something different. • AWS Secrets Manager stack template A basic template that uses AWS Lambda with an AWS Transfer Family server to integrate Secrets Manager as an identity provider. It authenticates against an entry in AWS Secrets Manager of the format aws/transfer/server-id/username. Additionally, the secret must hold the key-value pairs for all user properties returned to Transfer Family. After deployment, you can modify the Lambda function code to do something different. • Okta stack template: A basic template that uses AWS Lambda with an AWS Transfer Family server to integrate Okta as a custom identity provider. • Okta-mfa stack template: A basic template that uses AWS Lambda with an AWS Transfer Family server to integrate Okta, with Multi Factor Authentication, as a custom identity provider. • Azure Active Directory template: details for this stack are described in the blog post Authenticating to AWS Transfer Family with Azure Active Directory and AWS Lambda. After the stack has been deployed, you can view details about it on the Outputs tab in the CloudFormation console. Deploying one of these stacks is the easiest way to integrate a custom identity provider into the Transfer Family workflow. Using Amazon API Gateway to integrate your identity provider This topic describes how to use an AWS Lambda function to back an API Gateway method. Use this option if you need a RESTful API to integrate your identity provider or if you want to use AWS WAF to leverage its capabilities for geo-blocking or rate-limiting requests. For most use cases, the recommended way to configure a custom identity provider is to use the Custom identity provider solution. Custom identity provider 200 AWS Transfer Family User Guide Limitations if using an API Gateway to integrate your identity provider • This configuration does not support custom domains. • This configuration does not support a private API Gateway URL. If you need either of these, you can use Lambda as an identity provider, without API Gateway. For details, see Using AWS Lambda to integrate your identity provider. Authenticating using an API Gateway method You can create an API Gateway method for use as an identity provider for Transfer Family. This approach provides a highly secure way for you to create and provide APIs. With API Gateway, you can create an HTTPS endpoint so that all incoming API operations are transmitted with greater security. For more details about the API Gateway service, see the API Gateway Developer Guide. API Gateway offers an authorization method named AWS_IAM, which gives you the same authentication based on AWS Identity and Access Management (IAM) that AWS uses internally. If you enable authentication with AWS_IAM, only callers with explicit permissions to call an API can reach that API's API Gateway method. To use your API Gateway method as a custom identity provider for Transfer Family, enable IAM for your API Gateway method. As part of this process, you provide an IAM role with permissions for Transfer Family to use your gateway. Note To improve security, you can configure a web application firewall. AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to an Amazon API Gateway. For details, see Add a web application firewall. To use your API Gateway method for custom authentication with Transfer Family 1. Create an AWS CloudFormation stack. To do this: Note The stack templates have been updated to use BASE64-encoded passwords: for details, see Improvements to the AWS CloudFormation templates. Custom identity provider 201 AWS Transfer Family User Guide a. Open the AWS CloudFormation console at https://console.aws.amazon.com/ cloudformation. b. Follow the instructions for deploying an AWS CloudFormation stack from an existing template in Selecting a stack template in the AWS CloudFormation User Guide. c. Use one of the following basic templates to create an AWS Lambda-backed API Gateway method for use as a custom identity provider in Transfer Family. • Basic stack template By default, your API Gateway method is used as a custom identity provider to authenticate a single user in a single server using a hard-coded SSH (Secure Shell) key or password. After deployment, you can modify the Lambda function code to do something different. • AWS Secrets Manager stack template By default, your API Gateway method authenticates against an entry in Secrets Manager of the format aws/transfer/server-id/username. Additionally, the secret must hold the key-value pairs for all user properties returned to Transfer Family. After deployment, you can modify the Lambda function code to do something different. For more information, see the blog postEnable password authentication for AWS Transfer
transferfamily-ug-067
transferfamily-ug.pdf
67
as a custom identity provider to authenticate a single user in a single server using a hard-coded SSH (Secure Shell) key or password. After deployment, you can modify the Lambda function code to do something different. • AWS Secrets Manager stack template By default, your API Gateway method authenticates against an entry in Secrets Manager of the format aws/transfer/server-id/username. Additionally, the secret must hold the key-value pairs for all user properties returned to Transfer Family. After deployment, you can modify the Lambda function code to do something different. For more information, see the blog postEnable password authentication for AWS Transfer Family using AWS Secrets Manager. • Okta stack template Your API Gateway method integrates with Okta as a custom identity provider in Transfer Family. For more information, see the blog post Using Okta as an identity provider with AWS Transfer Family. Deploying one of these stacks is the easiest way to integrate a custom identity provider into the Transfer Family workflow. Each stack uses the Lambda function to support your API method based on API Gateway. You can then use your API method as a custom identity provider in Transfer Family. By default, the Lambda function authenticates a single user called myuser with a password of MySuperSecretPassword. After deployment, you can edit these credentials or update the Lambda function code to do something different. Custom identity provider 202 AWS Transfer Family User Guide Important We recommend that you edit the default user and password credentials. After the stack has been deployed, you can view details about it on the Outputs tab in the CloudFormation console. These details include the stack's Amazon Resource Name (ARN), the ARN of the IAM role that the stack created, and the URL for your new gateway. Note If you are using the custom identity provider option to enable password–based authentication for your users, and you enable the request and response logging provided by API Gateway, API Gateway logs your users' passwords to your Amazon CloudWatch Logs. We don't recommend using this log in your production environment. For more information, see Set up CloudWatch API logging in API Gateway in the API Gateway Developer Guide. 2. Check the API Gateway method configuration for your server. To do this: a. Open the API Gateway console at https://console.aws.amazon.com/apigateway/. b. Choose the Transfer Custom Identity Provider basic template API that the AWS CloudFormation template generated. You might need to select your region to see your gateways. c. In the Resources pane, choose GET. The following screenshot shows the correct method configuration. Custom identity provider 203 AWS Transfer Family User Guide At this point, your API gateway is ready to be deployed. 3. For Actions, choose Deploy API. For Deployment stage, choose prod, and then choose Deploy. After the API Gateway method is successfully deployed, view its performance in Stages > Stage details, as shown in the following screenshot. Note Copy the Invoke URL address that appears at the top of the screen. You might need it for the next step. Custom identity provider 204 AWS Transfer Family User Guide 4. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. 5. A Transfer Family should have been created for you, when you created the stack. If not, configure your server using these steps. a. Choose Create server to open the Create server page. For Choose an identity provider, choose Custom, then select Use Amazon API Gateway to connect to your identity provider, as shown in the following screenshot. Custom identity provider 205 AWS Transfer Family User Guide b. c. In the Provide an Amazon API Gateway URL text box, paste the Invoke URL address of the API Gateway endpoint that you created in step 3 of this procedure. For Role, choose the IAM role that was created by the AWS CloudFormation template. This role allows Transfer Family to invoke your API gateway method. The invocation role contains the AWS CloudFormation stack name that you selected for the stack that you created in step 1. It has the following format: CloudFormation- stack-name-TransferIdentityProviderRole-ABC123DEF456GHI. d. Fill in the remaining boxes, and then choose Create server. For details on the remaining steps for creating a server, see Configuring an SFTP, FTPS, or FTP server endpoint. Implementing your API Gateway method To create a custom identity provider for Transfer Family, your API Gateway method must implement a single method that has a resource path of /servers/serverId/users/username/ Custom identity provider 206 AWS Transfer Family User Guide config. The serverId and username values come from the RESTful resource path. Also, add sourceIp and protocol as URL Query String Parameters in the Method Request, as shown in the following image. Note The username must be a minimum of 3 and a maximum of 100 characters. You can use the following characters in the username: a–z, A-Z, 0–9, underscore '_',
transferfamily-ug-068
transferfamily-ug.pdf
68
Implementing your API Gateway method To create a custom identity provider for Transfer Family, your API Gateway method must implement a single method that has a resource path of /servers/serverId/users/username/ Custom identity provider 206 AWS Transfer Family User Guide config. The serverId and username values come from the RESTful resource path. Also, add sourceIp and protocol as URL Query String Parameters in the Method Request, as shown in the following image. Note The username must be a minimum of 3 and a maximum of 100 characters. You can use the following characters in the username: a–z, A-Z, 0–9, underscore '_', hyphen '-', period '.' and at sign '@'. The username can't start with a hyphen '-', period '.' or at sign '@'. If Transfer Family attempts password authentication for your user, the service supplies a Password: header field. In the absence of a Password: header, Transfer Family attempts public key authentication to authenticate your user. When you are using an identity provider to authenticate and authorize end users, in addition to validating their credentials, you can allow or deny access requests based on the IP addresses of Custom identity provider 207 AWS Transfer Family User Guide the clients used by your end users. You can use this feature to ensure that data stored in your S3 buckets or your Amazon EFS file system can be accessed over the supported protocols only from IP addresses that you have specified as trusted. To enable this feature, you must include sourceIp in the Query string. If you have multiple protocols enabled for your server and want to provide access using the same username over multiple protocols, you can do so as long as the credentials specific to each protocol have been set up in your identity provider. To enable this feature, you must include the protocol value in the RESTful resource path. Your API Gateway method should always return HTTP status code 200. Any other HTTP status code means that there was an error accessing the API. Amazon S3 example response The example response body is a JSON document of the following form for Amazon S3. { "Role": "IAM role with configured S3 permissions", "PublicKeys": [ "ssh-rsa public-key1", "ssh-rsa public-key2" ], "Policy": "STS Assume role session policy", "HomeDirectory": "/amzn-s3-demo-bucket/path/to/home/directory" } Note The policy is escaped JSON as a string. For example: "Policy": "{ \"Version\": \"2012-10-17\", \"Statement\": [ {\"Condition\": {\"StringLike\": {\"s3:prefix\": [\"user/*\", \"user/\"]}}, \"Resource\": \"arn:aws:s3:::amzn-s3-demo-bucket\", Custom identity provider 208 AWS Transfer Family User Guide \"Action\": \"s3:ListBucket\", \"Effect\": \"Allow\", \"Sid\": \"ListHomeDir\"}, {\"Resource\": \"arn:aws:s3:::*\", \"Action\": [\"s3:PutObject\", \"s3:GetObject\", \"s3:DeleteObjectVersion\", \"s3:DeleteObject\", \"s3:GetObjectVersion\", \"s3:GetObjectACL\", \"s3:PutObjectACL\"], \"Effect\": \"Allow\", \"Sid\": \"HomeDirObjectAccess\"}] }" The following example response shows that a user has a logical home directory type. { "Role": "arn:aws:iam::123456789012:role/transfer-access-role-s3", "HomeDirectoryType":"LOGICAL", "HomeDirectoryDetails":"[{\"Entry\":\"/\",\"Target\":\"/amzn-s3-demo-bucket1\"}]", "PublicKeys":[""] } Amazon EFS example response The example response body is a JSON document of the following form for Amazon EFS. { "Role": "IAM role with configured EFS permissions", "PublicKeys": [ "ssh-rsa public-key1", "ssh-rsa public-key2" ], "PosixProfile": { "Uid": "POSIX user ID", "Gid": "POSIX group ID", "SecondaryGids": [Optional list of secondary Group IDs], }, "HomeDirectory": "/fs-id/path/to/home/directory" } Custom identity provider 209 AWS Transfer Family User Guide The Role field shows that successful authentication occurred. When doing password authentication (when you supply a Password: header), you don't need to provide SSH public keys. If a user can't be authenticated, for example, if the password is incorrect, your method should return a response without Role set. An example of such a response is an empty JSON object. The following example response shows a user that has a logical home directory type. { "Role": "arn:aws:iam::123456789012:role/transfer-access-role-efs", "HomeDirectoryType": "LOGICAL", "HomeDirectoryDetails":"[{\"Entry\":\"/\",\"Target\":\"/faa1a123\"}]", "PublicKeys":[""], "PosixProfile":{"Uid":65534,"Gid":65534} } You can include user policies in the Lambda function in JSON format. For more information about configuring user policies in Transfer Family, see Managing access controls. Default Lambda function To implement different authentication strategies, edit the Lambda function that your gateway uses. To help you meet your application's needs, you can use the following example Lambda functions in Node.js. For more information about Lambda, see the AWS Lambda Developer Guide or Building Lambda functions with Node.js. The following example Lambda function takes your username, password (if you're performing password authentication), server ID, protocol, and client IP address. You can use a combination of these inputs to look up your identity provider and determine if the login should be accepted. Note If you have multiple protocols enabled for your server and want to provide access using the same username over multiple protocols, you can do so as long as the credentials specific to the protocol have been set up in your identity provider. For File Transfer Protocol (FTP), we recommend maintaining separate credentials from Secure Shell (SSH) File Transfer Protocol (SFTP) and File Transfer Protocol over SSL (FTPS). We recommend maintaining separate credentials for FTP because, unlike SFTP and FTPS, FTP transmits credentials
transferfamily-ug-069
transferfamily-ug.pdf
69
of these inputs to look up your identity provider and determine if the login should be accepted. Note If you have multiple protocols enabled for your server and want to provide access using the same username over multiple protocols, you can do so as long as the credentials specific to the protocol have been set up in your identity provider. For File Transfer Protocol (FTP), we recommend maintaining separate credentials from Secure Shell (SSH) File Transfer Protocol (SFTP) and File Transfer Protocol over SSL (FTPS). We recommend maintaining separate credentials for FTP because, unlike SFTP and FTPS, FTP transmits credentials in clear text. By isolating FTP credentials from SFTP or FTPS, if FTP credentials are shared or exposed, your workloads using SFTP or FTPS remain secure. Custom identity provider 210 AWS Transfer Family User Guide This example function returns the role and logical home directory details, along with the public keys (if it performs public key authentication). When you create service-managed users, you set their home directory, either logical or physical. Similarly, we need the Lambda function results to convey the desired user physical or logical directory structure. The parameters you set depend on the value for the HomeDirectoryType field. • HomeDirectoryType set to PATH – the HomeDirectory field must then be an absolute Amazon S3 bucket prefix or Amazon EFS absolute path that is visible to your users. • HomeDirectoryType set to LOGICAL – Do not set a HomeDirectory field. Instead, we set a HomeDirectoryDetails field that provides the desired Entry/Target mappings, similar to the described values in the HomeDirectoryDetails parameter for service-managed users. The example functions are listed in Example Lambda functions. Lambda function for use with AWS Secrets Manager To use AWS Secrets Manager as your identity provider, you can work with the Lambda function in the sample AWS CloudFormation template. The Lambda function queries the Secrets Manager service with your credentials and, if successful, returns a designated secret. For more information about Secrets Manager, see the AWS Secrets Manager User Guide. To download a sample AWS CloudFormation template that uses this Lambda function, go to the Amazon S3 bucket provided by AWS Transfer Family. Improvements to the AWS CloudFormation templates Improvements to the API Gateway interface have been made to the published CloudFormation templates. The templates now use BASE64-encoded passwords with the API Gateway. Your existing deployments continue to work without this enhancement, but don't allow for passwords with characters outside the basic US-ASCII character set. The changes in the template that enable this capability are as follows: • The GetUserConfigRequest AWS::ApiGateway::Method resource has to have this RequestTemplates code (the line in italics is the updated line) RequestTemplates: application/json: | Custom identity provider 211 AWS Transfer Family { User Guide "username": "$util.urlDecode($input.params('username'))", "password": "$util.escapeJavaScript($util.base64Decode($input.params('PasswordBase64'))).replaceAll("\ \'","'")", "protocol": "$input.params('protocol')", "serverId": "$input.params('serverId')", "sourceIp": "$input.params('sourceIp')" } • The RequestParameters for the GetUserConfig resource must change to use the PasswordBase64 header (the line in italics is the updated line): RequestParameters: method.request.header.PasswordBase64: false method.request.querystring.protocol: false method.request.querystring.sourceIp: false To check if the template for your stack is the latest 1. Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation. 2. 3. 4. From the list of stacks, choose your stack. From the details panel, choose the Template tab. Look for the following: • Search for RequestTemplates, and make sure you have this line: "password": "$util.escapeJavaScript($util.base64Decode($input.params('PasswordBase64'))).replaceAll("\ \'","'")", • Search for RequestParameters, and make sure you have this line: method.request.header.PasswordBase64: false If you don't see the updated lines, edit your stack. For details on how to update your AWS CloudFormation stack, see Modifying a stack template in the AWS CloudFormation; User Guide. Custom identity provider 212 AWS Transfer Family User Guide Using multiple authentication methods The Transfer Family server controls the AND logic when you use multiple authentication methods. Transfer Family treats this as two separate requests to your custom identity provider: however, their effect is combined. Both requests must return successfully with the correct response to allow the authentication to complete. Transfer Family requires the two responses to be complete, meaning they contain all of the required elements (role, home directory, policy and the POSIX profile if you're using Amazon EFS for storage). Transfer Family also requires that the password response must not include public keys. The public key request must have a separate response from the identity provider. That behavior is unchanged when using Password OR Key or Password AND Key. The SSH/SFTP protocol challenges the software client first with a public key authentication, then requests a password authentication. This operation mandates both are successful before the user is allowed to complete the authentication. For custom identity provider options, you can specify any of the following options for how to authenticate. • Password OR Key – users can authenticate with either their password or their key. This is the default value. • Password ONLY –
transferfamily-ug-070
transferfamily-ug.pdf
70
The public key request must have a separate response from the identity provider. That behavior is unchanged when using Password OR Key or Password AND Key. The SSH/SFTP protocol challenges the software client first with a public key authentication, then requests a password authentication. This operation mandates both are successful before the user is allowed to complete the authentication. For custom identity provider options, you can specify any of the following options for how to authenticate. • Password OR Key – users can authenticate with either their password or their key. This is the default value. • Password ONLY – users must provide their password to connect. • Key ONLY – users must provide their private key to connect. • Password AND Key – users must provide both their private key and their password to connect. The server checks the key first, and then if the key is valid, the system prompts for a password. If the private key provided does not match the public key that is stored, authentication fails. Using AWS Directory Service for Microsoft Active Directory You can use AWS Transfer Family to authenticate your file transfer end users using AWS Directory Service for Microsoft Active Directory. It enables seamless migration of file transfer workflows that rely on Active Directory authentication without changing end users’ credentials or needing a custom authorizer. With AWS Managed Microsoft AD, you can securely provide AWS Directory Service users and groups access over SFTP, FTPS, and FTP for data stored in Amazon Simple Storage Service (Amazon Directory service for MS AD 213 AWS Transfer Family User Guide S3) or Amazon Elastic File System (Amazon EFS). If you use Active Directory to store your users’ credentials, you now have an easier way to enable file transfers for these users. You can provide access to Active Directory groups in AWS Managed Microsoft AD in your on- premises environment or in the AWS Cloud using Active Directory connectors. You can give users that are already configured in your Microsoft Windows environment, either in the AWS Cloud or in their on-premises network, access to an AWS Transfer Family server that uses AWS Managed Microsoft AD for identity. The AWS storage blog contains a post that details a solution for using Active Directory with Transfer Family: Simplify Active Directory authentication with a custom identity provider for AWS Transfer Family. Note • AWS Transfer Family does not support Simple AD. • Transfer Family does not support cross-region Active Directory configurations: we only support Active Directory integrations that are in the same region as that of the Transfer Family server. • Transfer Family does not support using either AWS Managed Microsoft AD or AD Connector to enable multi-factor authentication (MFA) for your existing RADIUS-based MFA infrastructure. • AWS Transfer Family does not support replicated regions of Managed Active Directory. To use AWS Managed Microsoft AD, you must perform the following steps: 1. Create one or more AWS Managed Microsoft AD directories using the AWS Directory Service console. 2. Use the Transfer Family console to create a server that uses AWS Managed Microsoft AD as its identity provider. 3. Set up AWS Directory using an Active Directory Connector. 4. Add access from one or more of your AWS Directory Service groups. 5. Although not required, we recommend that you test and verify user access. Topics • Before you start using AWS Directory Service for Microsoft Active Directory Directory service for MS AD 214 AWS Transfer Family User Guide • Working with Active Directory realms • Choosing AWS Managed Microsoft AD as your identity provider • Connecting to on-prem Microsoft Active Directory • Granting access to groups • Testing users • Deleting server access for a group • Connecting to the server using SSH (Secure Shell) • Connecting AWS Transfer Family to a self-managed Active Directory using forests and trusts Before you start using AWS Directory Service for Microsoft Active Directory Note AWS Transfer Family has a default limit of 100 Active Directory groups per server. If your use case requires more than 100 groups, consider using a custom identity provider solution as described in Simplify Active Directory authentication with a custom identity provider for AWS Transfer Family. Provide a unique identifier for your AD groups Before you can use AWS Managed Microsoft AD, you must provide a unique identifier for each group in your Microsoft AD directory. You can use the security identifier (SID) for each group to do this. The users of the group that you associate have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using AWS Transfer Family. Use the following Windows PowerShell command to retrieve the SID for a group, replacing YourGroupName with the name of the group. Get-ADGroup -Filter {samAccountName -like "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid Note If you
transferfamily-ug-071
transferfamily-ug.pdf
71
identifier for your AD groups Before you can use AWS Managed Microsoft AD, you must provide a unique identifier for each group in your Microsoft AD directory. You can use the security identifier (SID) for each group to do this. The users of the group that you associate have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using AWS Transfer Family. Use the following Windows PowerShell command to retrieve the SID for a group, replacing YourGroupName with the name of the group. Get-ADGroup -Filter {samAccountName -like "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid Note If you are using AWS Directory Service as your identity provider, and if userPrincipalName and SamAccountName have different values, AWS Transfer Family Directory service for MS AD 215 AWS Transfer Family User Guide accepts the value in SamAccountName. Transfer Family does not accept the value specified in userPrincipalName. Add AWS Directory Service permissions to your role You also need AWS Directory Service API permissions to use AWS Directory Service as your identity provider. The following permissions are required or suggested: • ds:DescribeDirectories is required for Transfer Family to look up the directory • ds:AuthorizeApplication is required to add authorization for Transfer Family • ds:UnauthorizeApplication is suggested to remove any resources that are provisionally created, in case something goes wrong during the server creation process Add these permissions to the role you are using for creating your Transfer Family servers. For more details on these permissions, see AWS Directory Service API permissions: Actions, resources, and conditions reference. Working with Active Directory realms When you are considering how to have your Active Directory users access AWS Transfer Family servers, keep in mind the user's realm, and their group's realm. Ideally, the user's realm and their group's realm should match. That is, both the user and the group are in the default realm, or both are in the trusted realm. If this is not the case, the user cannot be authenticated by Transfer Family. You can test the user to ensure the configuration is correct. For details, see Testing users. If there is a problem with the user/group realm, you receive the error, No associated access found for user's groups. Choosing AWS Managed Microsoft AD as your identity provider This section describes how to use AWS Directory Service for Microsoft Active Directory with a server. To use AWS Managed Microsoft AD with Transfer Family 1. Sign in to the AWS Management Console and open the AWS Directory Service console at https://console.aws.amazon.com/directoryservicev2/. Directory service for MS AD 216 AWS Transfer Family User Guide Use the AWS Directory Service console to configure one or more managed directories. For more information, see AWS Managed Microsoft AD in the AWS Directory Service Admin Guide. 2. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/, and choose Create server. 3. On the Choose protocols page, choose one or more protocols from the list. Note If you select FTPS, you must provide the AWS Certificate Manager certificate. 4. For Choose an identity provider, choose AWS Directory Service. Directory service for MS AD 217 AWS Transfer Family User Guide 5. The Directory list contains all the managed directories that you have configured. Choose a directory from the list, and choose Next. Note • Cross-Account and Shared directories are not supported for AWS Managed Microsoft AD. • To set up a server with Directory Service as your identity provider, you need to add some AWS Directory Service permissions. For details, see Before you start using AWS Directory Service for Microsoft Active Directory. 6. To finish creating the server, use one of the following procedures: • Create an SFTP-enabled server • Create an FTPS-enabled server • Create an FTP-enabled server In those procedures, continue with the step that follows choosing an identity provider. Important You can't delete a Microsoft AD directory in AWS Directory Service if you used it in a Transfer Family server. You must delete the server first, and then you can delete the directory. Connecting to on-prem Microsoft Active Directory This section describes how to set up an AWS Directory using an AD Connector To set up your AWS Directory using AD Connector 1. Open the Directory Service console and select Directories. 2. 3. 4. Select Set up directory. For directory type, choose AD Connector. Select a directory size, select Next, then select your VPC and Subnets. Directory service for MS AD 218 AWS Transfer Family User Guide 5. Select Next, then fill in the fields as follows: • Directory DNS name: enter the domain name you are using for your Microsoft Active Directory. • DNS IP addresses: enter you Microsoft Active Directory IP addresses. • Server account username and password: enter the details for the service account to use. 6. Complete the screens to create the directory service. The next step
transferfamily-ug-072
transferfamily-ug.pdf
72
2. 3. 4. Select Set up directory. For directory type, choose AD Connector. Select a directory size, select Next, then select your VPC and Subnets. Directory service for MS AD 218 AWS Transfer Family User Guide 5. Select Next, then fill in the fields as follows: • Directory DNS name: enter the domain name you are using for your Microsoft Active Directory. • DNS IP addresses: enter you Microsoft Active Directory IP addresses. • Server account username and password: enter the details for the service account to use. 6. Complete the screens to create the directory service. The next step is to create a Transfer Family server with the SFTP protocol, and the identity provider type of AWS Directory Service. From Directory drop down list, select the directory you added in the previous procedure. Granting access to groups After you create the server, you must choose which groups in the directory should have access to upload and download files over the enabled protocols using AWS Transfer Family. You do this by creating an access. Note AWS Transfer Family has a default limit of 100 Active Directory groups per server. If your use case requires more than 100 groups, consider using a custom identity provider solution as described in Simplify Active Directory authentication with a custom identity provider for AWS Transfer Family. Note Users must belong directly to the group to which you are granting access. For example, assume that Bob is a user and belongs to groupA, and groupA itself is included in groupB. • If you grant access to groupA, Bob is granted access. • If you grant access to groupB (and not to groupA), Bob does not have access. To grant access to a group 1. Open the AWS Transfer Family console at https://console.aws.amazon.com/transfer/. Directory service for MS AD 219 AWS Transfer Family User Guide 2. Navigate to your server details page. 3. 4. 5. 6. 7. In the Accesses section, choose Add access. Enter the SID for the AWS Managed Microsoft AD directory that you want to have access to this server. Note For information about how to find the SID for your group, see the section called “Before you start using AWS Directory Service for Microsoft Active Directory”. For Access, choose an AWS Identity and Access Management (IAM) role for the group. In the Policy section, choose a policy. The default setting is None. For Home directory, choose an Amazon S3 bucket that corresponds to the group's home directory. Note You can limit the portions of the bucket that users see by creating a session policy. For example, to limit users to their own folder under the /filetest directory, enter the following text in the box. /filetest/${transfer:UserName} To learn more about creating a session policy, see Creating a session policy for an Amazon S3 bucket. 8. Choose Add to create the association. 9. Choose your server. 10. Choose Add access. • Enter the SID for the group. Note For information about how to find the SID, see the section called “Before you start using AWS Directory Service for Microsoft Active Directory”. Directory service for MS AD 220 AWS Transfer Family 11. Choose Add access. User Guide In the Accesses section, the accesses for the server are listed. Testing users You can test whether a user has access to the AWS Managed Microsoft AD directory for your server. Note A user must be in exactly one group (an external ID) that is listed in the Access section of the Endpoint configuration page. If the user is in no groups, or is in more than a single group, that user is not granted access. To test whether a specific user has access 1. On the server details page, choose Actions, and then choose Test. 2. For Identity provider testing, enter the sign-in credentials for a user that is in one of the groups that has access. Directory service for MS AD 221 AWS Transfer Family 3. Choose Test. User Guide You see a successful identity provider test, showing that the selected user has been granted access to the server. If the user belongs to more than one group that has access, you receive the following response. "Response":"", "StatusCode":200, "Message":"More than one associated access found for user's groups." Deleting server access for a group To delete server access for a group 1. On the server details page, choose Actions, and then choose Delete Access. 2. In the dialog box, confirm that you want to remove access for this group. Directory service for MS AD 222 AWS Transfer Family User Guide When you return to the server details page, you see that the access for this group is no longer listed. Connecting to the server using SSH (Secure Shell) After you configure your server and users, you can connect to
transferfamily-ug-073
transferfamily-ug.pdf
73
"Message":"More than one associated access found for user's groups." Deleting server access for a group To delete server access for a group 1. On the server details page, choose Actions, and then choose Delete Access. 2. In the dialog box, confirm that you want to remove access for this group. Directory service for MS AD 222 AWS Transfer Family User Guide When you return to the server details page, you see that the access for this group is no longer listed. Connecting to the server using SSH (Secure Shell) After you configure your server and users, you can connect to the server using SSH and use the fully qualified username for a user that has access. sftp user@active-directory-domain@vpc-endpoint For example: [email protected]@vpce-0123456abcdef-789xyz.vpc- svc-987654zyxabc.us-east-1.vpce.amazonaws.com. This format targets the search of the federation, limiting the search of a potentially large Active Directory. Note You can specify the simple username. However, in this case, the Active Directory code has to search all the directories in the federation. This might limit the search, and authentication might fail even if the user should have access. After authenticating, the user is located in the home directory that you specified when you configured the user. Connecting AWS Transfer Family to a self-managed Active Directory using forests and trusts Users in your self-managed Active Directory (AD) can also use AWS IAM Identity Center for single sign-on access to AWS accounts and Transfer Family servers. To do that, AWS Directory Service has the following options available: • One-way forest trust (outgoing from AWS Managed Microsoft AD and incoming for on-premises Active Directory) works only for the root domain. • For child domains, you can use either of the following: • Use two-way trust between AWS Managed Microsoft AD and on-premises Active Directory • Use one-way external trust to each child domain. Directory service for MS AD 223 AWS Transfer Family User Guide When connecting to the server using a trusted domain, the user needs to specify the trusted domain, for example [email protected]. Using AWS Directory Service for Entra ID Domain Services Note the following: • To take advantage of your existing Active Directory forest for your SFTP Transfer needs, you can use Active Directory Connector. • If you want the benefits of Active Directory and high availability in a fully managed service, you can use AWS Directory Service for Microsoft Active Directory. For details, see Using AWS Directory Service for Microsoft Active Directory. This topic describes how to use an Active Directory Connector and Entra ID (formerly Azure AD) Domain Services to authenticate SFTP Transfer users with Entra ID. Topics • Before you start using AWS Directory Service for Entra ID Domain Services • Step 1: Adding Entra ID Domain Services • Step 2: Creating a service account • Step 3: Setting up AWS Directory using AD Connector • Step 4: Setting up AWS Transfer Family server • Step 5: Granting access to groups • Step 6: Testing users Before you start using AWS Directory Service for Entra ID Domain Services Note AWS Transfer Family has a default limit of 100 Active Directory groups per server. If your use case requires more than 100 groups, consider using a custom identity provider solution as described in Simplify Active Directory authentication with a custom identity provider for AWS Transfer Family. For AWS, you need the following: Directory service for Entra ID 224 AWS Transfer Family User Guide • A virtual private cloud (VPC) in an AWS region where you are using your Transfer Family servers • At least two private subnets in your VPC • The VPC must have internet connectivity • A customer gateway and Virtual private gateway for site-to-site VPN connection with Microsoft Entra For Microsoft Entra, you need the following: • An Entra ID and Active directory domain service • An Entra resource group • An Entra virtual network • VPN connectivity between your Amazon VPC and your Entra resource group Note This can be through native IPSEC tunnels or using VPN appliances. In this topic, we use IPSEC tunnels between an Entra Virtual network gateway and local network gateway. The tunnels must be configured to allow traffic between your Entra Domain Service endpoints and the subnets that house your AWS VPC. • A customer gateway and Virtual private gateway for site-to-site VPN connection with Microsoft Entra The following diagram shows the configuration needed before you begin. Directory service for Entra ID 225 AWS Transfer Family User Guide Step 1: Adding Entra ID Domain Services Entra ID does not support Domain joining instances by default. To perform actions like Domain Join, and to use tools such as Group Policy, administrators must enable Entra ID Domain Services. If you have not already added Entra DS, or your existing implementation is not associated with the domain that you want your SFTP
transferfamily-ug-074
transferfamily-ug.pdf
74
your AWS VPC. • A customer gateway and Virtual private gateway for site-to-site VPN connection with Microsoft Entra The following diagram shows the configuration needed before you begin. Directory service for Entra ID 225 AWS Transfer Family User Guide Step 1: Adding Entra ID Domain Services Entra ID does not support Domain joining instances by default. To perform actions like Domain Join, and to use tools such as Group Policy, administrators must enable Entra ID Domain Services. If you have not already added Entra DS, or your existing implementation is not associated with the domain that you want your SFTP Transfer server to use, you must add a new instance. For information about enabling Entra ID Domain Services, see Tutorial: Create and configure a Microsoft Entra Domain Services managed domain. Note When you enable Entra DS, make sure it is configured for the resource group and the Entra domain to which you are connecting your SFTP Transfer server. Directory service for Entra ID 226 AWS Transfer Family User Guide Step 2: Creating a service account Entra must have one service account that is part of an Admin group in Entra DS. This account is used with the AWS Active Directory connector. Make sure this account is in sync with Entra DS. Directory service for Entra ID 227 AWS Transfer Family Tip User Guide Multi-factor authentication for Entra ID is not supported for Transfer Family servers that use the SFTP protocol. The Transfer Family server cannot provide the MFA token after a user authenticates to SFTP. Make sure to disable MFA before you attempt to connect. Step 3: Setting up AWS Directory using AD Connector After you have configured Entra DS, and created a service account with IPSEC VPN tunnels between your AWS VPC and Entra Virtual network, you can test the connectivity by pinging the Entra DS DNS IP address from any AWS EC2 instance. After you verify the connection is active, you can continue below. To set up your AWS Directory using AD Connector 1. Open the Directory Service console and select Directories. 2. 3. 4. 5. Select Set up directory. For directory type, choose AD Connector. Select a directory size, select Next, then select your VPC and Subnets. Select Next, then fill in the fields as follows: • Directory DNS name: enter the domain name you are using for your Entra DS. • DNS IP addresses: enter your Entra DS IP addresses. • Server account username and password: enter the details for the service account you created in Step 2: Create a service account. Directory service for Entra ID 228 AWS Transfer Family User Guide 6. Complete the screens to create the directory service. Now the directory status should be Active, and it is ready to be used with an SFTP Transfer server. Step 4: Setting up AWS Transfer Family server Create a Transfer Family server with the SFTP protocol, and the identity provider type of AWS Directory Service. From Directory drop down list, select the directory you added in Step 3: Setup AWS Directory using AD Connector. Note You can't delete a Microsoft AD directory in AWS Directory Service if you used it in a Transfer Family server. You must delete the server first, and then you can delete the directory. Step 5: Granting access to groups After you create the server, you must choose which groups in the directory should have access to upload and download files over the enabled protocols using AWS Transfer Family. You do this by creating an access. Note Users must belong directly to the group to which you are granting access. For example, assume that Bob is a user and belongs to groupA, and groupA itself is included in groupB. Directory service for Entra ID 229 AWS Transfer Family User Guide • If you grant access to groupA, Bob is granted access. • If you grant access to groupB (and not to groupA), Bob does not have access. In order to grant access you need to retrieve the SID for the group. Use the following Windows PowerShell command to retrieve the SID for a group, replacing YourGroupName with the name of the group. Get-ADGroup -Filter {samAccountName -like "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid Grant access to groups 1. Open https://console.aws.amazon.com/transfer/. 2. Navigate to your server details page and in the Accesses section, choose Add access. 3. 4. 5. 6. Enter the SID you received from the output of the previous procedure. For Access, choose an AWS Identity and Access Management role for the group. In the Policy section, choose a policy. The default value is None. For Home directory, choose an Amazon S3 bucket that corresponds to the group's home directory. 7. Choose Add to create the association. The details from your Transfer server should look similar to the following: Directory
transferfamily-ug-075
transferfamily-ug.pdf
75
Select SamAccountName,ObjectSid Grant access to groups 1. Open https://console.aws.amazon.com/transfer/. 2. Navigate to your server details page and in the Accesses section, choose Add access. 3. 4. 5. 6. Enter the SID you received from the output of the previous procedure. For Access, choose an AWS Identity and Access Management role for the group. In the Policy section, choose a policy. The default value is None. For Home directory, choose an Amazon S3 bucket that corresponds to the group's home directory. 7. Choose Add to create the association. The details from your Transfer server should look similar to the following: Directory service for Entra ID 230 AWS Transfer Family User Guide Step 6: Testing users You can test (Testing users) whether a user has access to the AWS Managed Microsoft AD directory for your server. A user must be in exactly one group (an external ID) that is listed in the Access section of the Endpoint configuration page. If the user is in no groups, or is in more than a single group, that user is not granted access. Using logical directories to simplify your Transfer Family directory structures To simplify your AWS Transfer Family server directory structure, you can use logical directories. With logical directories, you can construct a virtual directory structure that uses user-friendly names that your users navigate when they connect to your Amazon S3 bucket or Amazon EFS file system. When you use logical directories, you can avoid disclosing absolute directory paths, Amazon S3 bucket names, and EFS file system names to your end users. Note You should use session policies so that your end users can only perform operations that you allow them to perform. You should use logical directories to create a user-friendly, virtual directory for your end users and abstract away bucket names. Logical directory mappings only allow users to access their designated logical paths and subdirectories, and forbid relative paths that traverse the logical roots. Use logical directories 231 AWS Transfer Family User Guide Transfer Family validates every path that might include relative elements and actively blocks these paths from resolving before we pass these paths to Amazon S3; this prevents your users from moving beyond their logical mappings. Even though Transfer Family prevents your end users from accessing directories outside of their logical directory, we recommend you also use unique roles or session policies to enforce least privilege at the storage level. You can use logical directories to set the user’s root directory to a desired location within your storage hierarchy, by performing what is known as a chroot operation. In this mode, users are not able to navigate to a directory outside of the home or root directory that you've configured for them. For example, although an Amazon S3 user has been scoped down to access only /amzn-s3-demo- bucket/home/${transfer:UserName}, some clients allow users to traverse up a folder to /amzn-s3-demo-bucket/home. In this situation, the user lands back on their intended home directory only after logging out of and back in to the Transfer Family server again. Performing a chroot operation can prevent this situation from occurring. You can create your own directory structure across buckets and prefixes. This feature is useful if you have a workflow that is expecting a specific directory structure that you can't replicate through bucket prefixes. You can also link to multiple non-contiguous locations within Amazon S3, similar to creating a symbolic link in a Linux file system where your directory path references a different location in the file system. Logical directory FILE mappings The HomeDirectoryMapEntry data type now includes a Type parameter. Before this parameter existed, you could have created a logical directory mapping where the target was a file. If you have previously created any of these kinds of logical directory mappings, you must explicitly set the Type to FILE, or these mappings won't work correctly going forward. One way to do this is to call the UpdateUser API, and set the Type to FILE for the existing mapping. Use logical directories 232 AWS Transfer Family User Guide Rules for using logical directories Before you build your logical directory mappings, you should understand the following rules: • When Entry is "/", you can have only one mapping because overlapping paths are not allowed. • Logical directories support mappings of up to 2.1 MB (for service-managed users, this limit is 2,000 entries). That is, the data structure that contains the mappings has a maximum size of 2.1 MB. If you have a lot of mappings, you can calculate the size of your mappings as follows: 1. Write out a typical mapping in the format {"Entry":"/entry- path","Target":"/target-path"}, where entry-path and target-path are the actual values that you will use. 2. Count the characters in that string, then add one (1). 3. Multiply that number by the approximate
transferfamily-ug-076
transferfamily-ug.pdf
76
one mapping because overlapping paths are not allowed. • Logical directories support mappings of up to 2.1 MB (for service-managed users, this limit is 2,000 entries). That is, the data structure that contains the mappings has a maximum size of 2.1 MB. If you have a lot of mappings, you can calculate the size of your mappings as follows: 1. Write out a typical mapping in the format {"Entry":"/entry- path","Target":"/target-path"}, where entry-path and target-path are the actual values that you will use. 2. Count the characters in that string, then add one (1). 3. Multiply that number by the approximate number of mappings that you have for your server. If the number that you estimated in step 3 is less than 2.1 MB, then your mappings are within the acceptable limit. • Targets can use the ${transfer:UserName} variable if the bucket or file system path has been parameterized based on the username. • Targets can be paths in different buckets or file systems, but you must make sure that the mapped AWS Identity and Access Management (IAM) role (the Role parameter in the response) provides access to those buckets or file systems. • Don't specify the HomeDirectory parameter, because this value is implied by the Entry Target pairs when you're using the LOGICAL value for the HomeDirectoryType parameter. • Targets must begin with a forward slash (/) character, but don't use trailing forward slashes (/) when you specify the Target. For example, /amzn-s3-demo-bucket/images is acceptable, but amzn-s3-demo-bucket/images and /amzn-s3-demo-bucket/images/ are not. • Amazon S3 is an object store, which means that folders are a virtual concept, and there is no actual directory hierarchy. If your application issues a stat operation from a client, everything is classified as a file when you're using Amazon S3 for storage. This behavior is described in Organizing objects in the Amazon S3 console using folders in the Amazon Simple Storage Service User Guide. If your application requires that stat accurately show whether something is a file or folder, you can use Amazon Elastic File System (Amazon EFS) as the storage option for your Transfer Family servers. • If you're specifying logical directory values for your user, the parameter that you use depends on the type of user: Rules for using logical directories 233 AWS Transfer Family User Guide • For service-managed users, provide logical directory values in HomeDirectoryMappings. • For custom identity provider users, provide logical directory values in HomeDirectoryDetails. Important Unless you choose to optimize performance for your Amazon S3 directories (when you create or update a server), the root directory must exist on startup. For Amazon S3, this means that you must have already created a zero-byte object ending with a forward slash (/) to create the root folder. Avoiding this issue is a reason to consider optimizing Amazon S3 performance. Implementing logical directories and chroot To use logical directories and chroot features, you must do the following: Turn on logical directories for each user. Do this by setting the HomeDirectoryType parameter to LOGICAL when you create or update your user. "HomeDirectoryType": "LOGICAL" chroot For chroot, create a directory structure that consists of a single Entry and Target pairing for each user. The root folder is the Entry point, and the Target is the location in your bucket or file system to map to. Example for Amazon S3 [{"Entry": "/", "Target": "/amzn-s3-demo-bucket/jane"}] Example for Amazon EFS [{"Entry": "/", "Target": "/fs-faa1a123/jane"}] Implementing logical directories and chroot 234 AWS Transfer Family User Guide You can use an absolute path as in the previous example, or you can use a dynamic substitution for the username with ${transfer:UserName}, as in the following example. [{"Entry": "/", "Target": "/amzn-s3-demo-bucket/${transfer:UserName}"}] In the preceding example, the user is locked to their root directory and cannot traverse up higher in the hierarchy. Virtual directory structure For a virtual directory structure, you can create multiple Entry Target pairings, with targets anywhere in your S3 buckets or EFS file systems, including across multiple buckets or file systems, as long as the user’s IAM role mapping has permissions to access them. In the following virtual structure example, when the user logs into AWS SFTP, they are in the root directory with sub-directories of /pics, /doc, /reporting, and /anotherpath/subpath/ financials. Note Unless you choose to optimize performance for your Amazon S3 directories (when you create or update a server), either the user or an administrator needs to create the directories if they don't already exist. Avoiding this issue is a reason to consider optimizing Amazon S3 performance. For Amazon EFS, you still need the administrator to create the logical mappings or the / directory. [ {"Entry": "/pics", "Target": "/amzn-s3-demo-bucket1/pics"}, {"Entry": "/doc", "Target": "/amzn-s3-demo-bucket1/anotherpath/docs"}, {"Entry": "/reporting", "Target": "/amzn-s3-demo-bucket2/Q1"}, {"Entry": "/anotherpath/subpath/financials", "Target": "/amzn-s3-demo-bucket2/ financials"}] Implementing logical directories and chroot 235 AWS Transfer Family Note User Guide You can
transferfamily-ug-077
transferfamily-ug.pdf
77
/reporting, and /anotherpath/subpath/ financials. Note Unless you choose to optimize performance for your Amazon S3 directories (when you create or update a server), either the user or an administrator needs to create the directories if they don't already exist. Avoiding this issue is a reason to consider optimizing Amazon S3 performance. For Amazon EFS, you still need the administrator to create the logical mappings or the / directory. [ {"Entry": "/pics", "Target": "/amzn-s3-demo-bucket1/pics"}, {"Entry": "/doc", "Target": "/amzn-s3-demo-bucket1/anotherpath/docs"}, {"Entry": "/reporting", "Target": "/amzn-s3-demo-bucket2/Q1"}, {"Entry": "/anotherpath/subpath/financials", "Target": "/amzn-s3-demo-bucket2/ financials"}] Implementing logical directories and chroot 235 AWS Transfer Family Note User Guide You can only upload files to the specific folders that you map. This means that in the previous example, you cannot upload to /anotherpath or anotherpath/subpath directories; only anotherpath/subpath/financials. You also cannot map to those paths directly, as overlapping paths are not allowed. For example, assume that you create the following mappings: { "Entry": "/pics", "Target": "/amzn-s3-demo-bucket/pics" }, { "Entry": "/doc", "Target": "/amzn-s3-demo-bucket/mydocs" }, { "Entry": "/temp", "Target": "/amzn-s3-demo-bucket" } You can only upload files to those buckets. When you first connect through sftp, you are dropped into the root directory, /. If you attempt to upload a file to that directory, the upload fails. The following commands show an example sequence: sftp> pwd Remote working directory: / sftp> put file Uploading file to /file remote open("/file"): No such file or directory To upload to any directory/sub-directory, you must explicitly map the path to the sub-directory. For more information about configuring logical directories and chroot for your users, including an AWS CloudFormation template that you can download and use, see Simplify your AWS SFTP Structure with chroot and logical directories in the AWS Storage Blog. Implementing logical directories and chroot 236 AWS Transfer Family User Guide Configure logical directories example In this example, we create a user and assign two logical directories. The following command creates a new user (for an existing Transfer Family server) with logical directories pics and doc. aws transfer create-user --user-name marymajor-logical --server-id s-11112222333344445 --role arn:aws:iam::1234abcd5678:role/marymajor-role --home-directory-type LOGICAL \ --home-directory-mappings "[{\"Entry\":\"/pics\", \"Target\":\"/amzn-s3-demo-bucket1/ pics\"}, {\"Entry\":\"/doc\", \"Target\":\"/amzn-s3-demo-bucket2/test/mydocs\"}]" \ --ssh-public-key-body file://~/.ssh/id_rsa.pub If marymajor is an existing user and her home directory type is PATH, you can change it to LOGICAL with a similar command as the previous one. aws transfer update-user --user-name marymajor-logical \ --server-id s-11112222333344445 --role arn:aws:iam::1234abcd5678:role/marymajor-role \ --home-directory-type LOGICAL --home-directory-mappings "[{\"Entry\":\"/pics\", \"Target\":\"/amzn-s3-demo-bucket1/pics\"}, \ {\"Entry\":\"/doc\", \"Target\":\"/amzn-s3-demo-bucket2/test/mydocs\"}]" Note the following: • If the directories /amzn-s3-demo-bucket1/pics and /amzn-s3-demo-bucket2/test/ mydocs don't already exist, the user (or an administrator) needs to create them. • When marymajor connects to the server, and runs the ls -l command, Mary sees the following: drwxr--r-- 1 - - 0 Mar 17 15:42 doc drwxr--r-- 1 - - 0 Mar 17 16:04 pics • marymajor cannot create any files or directories at this level. However, within pics and doc, she can add sub-directories. • Files that Mary adds to pics and doc are added to Amazon S3 paths /amzn-s3-demo- bucket1/pics and /amzn-s3-demo-bucket2/test/mydocs respectively. • In this example, we specify two different buckets to illustrate that possibility. However, you can use the same bucket for several or all of the logical directories that you specify for the user. Configure logical directories example 237 AWS Transfer Family User Guide Configure logical directories for Amazon EFS If your Transfer Family server uses Amazon EFS, the home directory for the user must be created with read and write access before the user can work in their logical home directory. The user cannot create this directory themselves, as they would lack permissions for mkdir on their logical home directory. If the user's home directory does not exist, and they run an ls command, the system responds as follows: sftp> ls remote readdir ("/"): No such file or directory A user with administrative access to the parent directory needs to create the user's logical home directory. Custom AWS Lambda response You can use logical directories with a Lambda function that connects to your custom identity provider. To do so, in your Lambda function, you specify the HomeDirectoryType as LOGICAL, and add Entry and Target values for the HomeDirectoryDetails parameter. For example: HomeDirectoryType: "LOGICAL" HomeDirectoryDetails: "[{\"Entry\": \"/\", \"Target\": \"/amzn-s3-demo-bucket/ theRealFolder"}]" The following code is an example of a successful response from a custom Lambda authentication call. aws transfer test-identity-provider --server-id s-1234567890abcdef0 --user-name myuser { "Url": "https://a1b2c3d4e5.execute-api.us-east-2.amazonaws.com/prod/servers/ s-1234567890abcdef0/users/myuser/config", "Message": "", "Response": "{\"Role\": \"arn:aws:iam::123456789012:role/bob-usa-role\", \"HomeDirectoryType\": \"LOGICAL\",\"HomeDirectoryDetails\": \"[{\\\"Entry\\\":\\\"/ myhome\\\",\\\"Target\\\":\\\"/amzn-s3-demo-bucket/theRealFolder\\\"}]\",\"PublicKeys \": \"[ssh-rsa myrsapubkey]\"}", "StatusCode": 200 } Configure logical directories for Amazon EFS 238 AWS Transfer Family Note User Guide The "Url": line is returned only if you are using an API Gateway method as your custom identity provider. Custom AWS Lambda response 239 AWS Transfer Family User Guide Transfer Family web apps You can create web apps to enable a simple interface for transferring data to and from Amazon Simple