File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
aws_sra_examples/solutions/genai/bedrock_org/lambda/rules/sra_bedrock_check_kb_ingestion_encryption Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def check_data_sources(kb_id: str, kb_name: str) -> str | None: # type: ignore
7878 continue
7979
8080 if unencrypted_sources :
81- return f"{ kb_name } (sources without KMS encryption : { ', ' .join (unencrypted_sources )} )"
81+ return f"{ kb_name } (sources using default AWS-managed key instead of Customer Managed Key : { ', ' .join (unencrypted_sources )} )"
8282 return None
8383 except ClientError as e :
8484 LOGGER .error (f"Error checking data sources for knowledge base { kb_name } : { str (e )} " )
@@ -109,8 +109,12 @@ def evaluate_compliance(rule_parameters: dict) -> tuple[str, str]: # noqa: U100
109109 non_compliant_kbs .append (error )
110110
111111 if non_compliant_kbs :
112- return "NON_COMPLIANT" , f"The following knowledge bases have unencrypted data sources: { '; ' .join (non_compliant_kbs )} "
113- return "COMPLIANT" , "All knowledge base data sources are encrypted with KMS"
112+ msg = (
113+ "The following knowledge bases are using default AWS-managed keys "
114+ + f"instead of Customer Managed Keys: { '; ' .join (non_compliant_kbs )} "
115+ )
116+ return "NON_COMPLIANT" , msg
117+ return "COMPLIANT" , "All knowledge base data sources are encrypted with Customer Managed Keys"
114118
115119 except Exception as e :
116120 LOGGER .error (f"Error evaluating Bedrock Knowledge Base encryption: { str (e )} " )
You can’t perform that action at this time.
0 commit comments