-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KendraにACLを設定しCognitoのユーザーグループと連携したい #765
Comments
Kendra から情報を取得する際には retrieveKendra.ts が使われます。 以下の RetrieveCommand 内に UserContext -> Groups が設定できるので そちらで動作でするか確認していただくのはどうでしょうか? congito:groups は以下の要領で取得できると思います。 まとめると、以下のような実装を追加することになるかと思います。(動作未確認です。) const groups: string[] = event.requestContext.authorizer!.claims['cognito:groups'].split(',');
...
const retrieveCommand = new RetrieveCommand({
IndexId: INDEX_ID,
QueryText: query,
AttributeFilter: attributeFilter,
UserContext: {
Groups: groups,
},
}); |
回答ありがとうございます。 一方で需要が多そうな機能とも思うので、 |
このACLのやり方とかどうですか? rag.tsを |
This issue is stale because it has been open for 30 days with no activity. |
機能リクエストは何か問題に関連していますか?背景を説明してください
1つのKendraインデックスをAccess Conteol List(以下ACL)で論理的に分割し、
Cognitoのユーザーグループ単位でアクセス制限したいと考えています。
これが可能になると1つのGenU環境を、セキュリティを確保しながら
多数の部門で評価することができ、Kendaコストも削減できるので、
当方としては非常にありがたい機能になります。
追加 or 改善したい機能について
機能追加要望として以下を挙げさせていただきます。
「S3データソースからmetadata.json等で生成したKendraのACLに対し
Cognitoユーザーグループ単位でRAG生成できるようにする」
(詳細)
GenUのデプロイで生成したKendraの「User Access Control」の設定は既定で
Token type: OpenID
Signing key object: cognitoユーザープールのURL
Username: cognito:username
Groups: cognito:groups
となっており、すぐにも連携できそうに見えますが
{
"AccessControlList": [
{ "Access": "ALLOW", "Name": "Group1", "Type": "GROUP" }
]
}
のようなmetadata.jsonを作ってACLを認識させても、
GenUからは正しく検索できません。
Amazonの技術担当の人に調べてもらったところ、
queryKendra.tsがkenrdaにQueryを投げるところでCognitoの情報を渡していないので
ACLが付いたものはRAG対象外になってしまうようです。
これを可能にしてほしいという要望になります。
The text was updated successfully, but these errors were encountered: