0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Bedrock のモデルアクセス拒否設定を入れる

Last updated at Posted at 2025-10-03

概要

2025年9月29日からBedrockモデルアクセスが自動的に有効化されたとのこと
今まではリクエストしたモデルのみ使用可能であったが、デフォルトではすべてのモデルにアクセスできるように仕様が変わったらしい

Bedrockページ
image.png

image.png

企業ポリシーでDeepSeekにはアクセスさせたくないのでIAMロールに拒否設定を入れる

手順

IAMポリシーを変更

変更前
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "bedrock:InvokeModel",
                "bedrock:InvokeModelWithResponseStream",
                "bedrock:ListFoundationModels",
                "bedrock:Rerank"
            ],
            "Resource": "*"
        }
    ]
}

変更後
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "bedrock:InvokeModel",
                "bedrock:InvokeModelWithResponseStream",
                "bedrock:ListFoundationModels",
                "bedrock:Rerank"
            ],
            "Resource": "*"
-       }
+       },
+       {
+           "Sid": "DenyInference",
+           "Effect": "Deny",
+           "Action": [
+               "bedrock:InvokeModel",
+               "bedrock:InvokeModelWithResponseStream",
+               "bedrock:CreateModelInvocationJob"
+           ],
+           "Resource": "arn:aws:bedrock:*::foundation-model/*deepseek*"
+       }
    ]
}

DeepSeekの拒否(Deny)ポリシーを入れることで拒否される。

"Resource": "arn:aws:bedrock:*::foundation-model/deepseek.v3-v1:0"
※model-idをフルで指定してもうまく拒否されませんでした。
 指定方法が間違っている?(詳しい人教えてください:pray:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?