Skip to content
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

feat(aws): add checks for Bedrock logging configuration and CloudTrail LLM Jacking detection #5314

Conversation

sergargar
Copy link
Member

@sergargar sergargar commented Oct 7, 2024

Context

This pull request introduces two new security checks aimed at enhancing AWS Bedrock and CloudTrail monitoring to detect and prevent LLMJacking attacks.

These attacks involve the exploitation of stolen credentials to hijack cloud-hosted large language models (LLMs), such as those provided by AWS Bedrock, leading to unauthorized access, excessive financial costs, and potential data exfiltration.

The two proposed checks bedrock_model_invocation_logging_enabled and cloudtrail_threat_detection_llm_jacking are designed to ensure proper logging configurations are in place and monitor for suspicious activities related to potential LLMJacking threats.

Description

  1. bedrock_model_invocation_logging_enabled:

This check ensures that AWS Bedrock model invocation logging is properly enabled across all active regions. Logging model usage is essential for visibility into AI operations, capturing inputs and outputs, and detecting unauthorized access or misuse of resources. It ensures that logs are being routed to CloudWatch or S3 for detailed monitoring and analysis.

  1. cloudtrail_threat_detection_llm_jacking:

This check monitors CloudTrail logs for suspicious API calls related to AWS Bedrock, such as InvokeModel, PutUseCaseForModelAccess, and GetFoundationModelAvailability. These API calls can be used by attackers in LLMJacking attempts to hijack AI model resources. This check helps detect unauthorized access attempts, abnormal usage patterns, and possible resource hijacking incidents.

Together, these checks provide a comprehensive approach to securing AI model operations in AWS, ensuring proper logging and detecting threats in real-time.

Checklist

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

github-actions bot commented Oct 7, 2024

You can check the documentation for this PR here -> Prowler Documentation

@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label Oct 7, 2024
Copy link
Contributor

github-actions bot commented Oct 7, 2024

You can check the documentation for this PR here -> Prowler Documentation

Copy link
Contributor

github-actions bot commented Oct 8, 2024

You can check the documentation for this PR here -> Prowler Documentation

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 95.78947% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.38%. Comparing base (4181ca5) to head (b79f056).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
.../providers/aws/services/bedrock/bedrock_service.py 90.90% 2 Missing ⚠️
...jacking/cloudtrail_threat_detection_llm_jacking.py 95.74% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5314   +/-   ##
=======================================
  Coverage   89.38%   89.38%           
=======================================
  Files        1018     1022    +4     
  Lines       31278    31373   +95     
=======================================
+ Hits        27959    28044   +85     
- Misses       3319     3329   +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Oct 9, 2024

You can check the documentation for this PR here -> Prowler Documentation

Copy link
Member

@puchy22 puchy22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@sergargar sergargar merged commit 3c929bd into master Oct 11, 2024
12 checks passed
@sergargar sergargar deleted the PRWLR-4990-create-check-to-prevent-hijacking-on-aws-gen-ai-service branch October 11, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants