Connecting to AWS Transfer for SFTP

前端 未结 5 508
终归单人心
终归单人心 2020-12-08 20:51

I am having trouble connecting to AWS Transfer for SFTP. I successfully set up a server and tried to connect using WinSCP.

I set up an IAM role with trust relationsh

5条回答
  •  被撕碎了的回忆
    2020-12-08 21:37

    Can't comment, sorry if I'm posting incorrectly.

    Careful with AWS's default policy!

    This solution did work for me in that I was able to use scope-down policies for SFTP users as expected. However, there's a catch:

    {
                "Sid": "AWSTransferRequirements",
                "Effect": "Allow",
                "Action": [
                    "s3:ListAllMyBuckets",
                    "s3:GetBucketLocation"
                ],
                "Resource": "*"
            },
    

    This section of the policy will enable SFTP users using this policy to change directory to root and list all of your account's buckets. They won't have access to read or write, but they can discover stuff which is probably unnecessary. I can confirm that changing the above to:

    {
                "Sid": "AWSTransferRequirements",
                "Effect": "Allow",
                "Action": [
                    "s3:ListAllMyBuckets",
                    "s3:GetBucketLocation"
                ],
                "Resource": "${transfer:HomeBucket}"
            },
    

    ... appears to prevent SFTP users from listing buckets. However, they can still cd to directories if they happen to know buckets that exist -- again they dont' have read/write but this is still unnecessary access. I'm probably missing something to prevent this in my policy.

    Proper jailing appears to be a backlog topic: https://forums.aws.amazon.com/thread.jspa?threadID=297509&tstart=0

提交回复
热议问题