Skip to content

Commit 0e65503

Browse files
committed
fix annotation language
1 parent 71ecfd6 commit 0e65503

File tree

1 file changed

+7
-3
lines changed
  • aws_sra_examples/solutions/genai/bedrock_org/lambda/rules/sra_bedrock_check_kb_ingestion_encryption

1 file changed

+7
-3
lines changed

aws_sra_examples/solutions/genai/bedrock_org/lambda/rules/sra_bedrock_check_kb_ingestion_encryption/app.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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)}")

0 commit comments

Comments
 (0)