Privately access code commit repo

0

Hi all,

I have a scenario where I want to let the user to only access Code Commit repo privately. So i configured a VPC, VPN, Code Commit VPC Endpoint that are within the private subnet of the VPC, and Code Commit repo.

My plan is to have the user connected to the VPN connection into my VPC only then they can do their work with the Code Commit (git push etc.).

When i tested this setup I am still able to access the repo when i am not connected to the VPN at all.

What is the main problem in my setup? Is it possible to do this?

質問済み 1ヶ月前240ビュー
2回答
1
承認された回答

Hello.

Try adding the following policy to the IAM user's policy.
If you add this, you will not be able to access CodeCommit unless you go through the VPC endpoint.

{
  "Version": "2012-10-17",
  "Statement": [
      {
          "Effect": "Allow",
          "Action": [
              "codecommit:*"
          ],
          "Resource": [
              "*"
          ],
          "Condition": {
              "StringEquals": {
                  "aws:sourceVpce": [
                      "VPC EndPoint ID"
                  ]
              }
          }
      }
  ]
}
profile picture
エキスパート
回答済み 1ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前
0

Apart finding a proper resource policy, you could use security groups on the vpc interface endpoint and whitelist only IPs you need.

profile picture
エキスパート
回答済み 1ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ