A PoC AWS Bedrock GenAI-powered security self-service chatbot
Published on June 10, 2024 by Dai Tran
project selfservice-security ai-powered-application blog
5 min READ
This proof-of-concept (PoC) investigates the application of generative AI within the realm of security enablement and self-service. The primary objective is to harness the capabilities of generative AI alongside front-end chatbots to enhance the user experience for security consumers, particularly in extensive enterprise settings. By equipping these chatbots with specialized security knowledge, they can educate and mentor users on security principles, protocols, and procedures, ultimately facilitating their ability to independently address their security needs through GitOps workflows, such as managing git pull requests. While Cloudflare serves as an example of security technology utilized in this PoC, this methodology is broadly applicable across various self-service workflows that involve coding security configurations, compliance, and governance processes onto a version control system.
The PoC generative AI powered security self-service chatbot is built upon the following building blocks:
This OIDC provider authenticates the GitHub Actions Knowledge Base update workflow and authorize it to assume the IAM role GitHubActionsAssumeRoleForSelfServiceChatBot
that is assigned to the OIDC provider.
AWS Bedrock Knowledge Base is the AWS Bedrock orchestration service that co-ordinates the following AWS services to convert data from data source to indexed vectors in the vector database:
main
branch of the code repositorymain
branchWhat does Cloudflare web application firewall do?
and What does Cloudflare rate limit do?
to gain understanding of the security technlogies in questionTerraform
to get the suggested sample code. Some examples of the questions are Tell me how to create Cloudflare WAF managed ruleset in Terraform
and Show me Terraform code to create a Cloudflare HTTP rate limit resource
createpr->resource "cloudflare_rate_limit" "example" { zone_id = "your_zone_id" name = "example-rate-limit" description = "Example rate limit" disabled = false match { request { methods = ["GET", "POST"] schemes = ["HTTP", "HTTPS"] path { values = ["/example/*"] } } } threshold = 10 period = 1 action { mode = "simulate" } }
Set up the following environment variables:
SET GITHUB_PAT=ghp_*******************
SET AWS_ACCESS_KEY_ID=*******************
SET AWS_SECRET_ACCESS_KEY=*******************
SET AWS_SESSION_TOKEN=*******************
export GITHUB_PAT=ghp_*******************
export AWS_ACCESS_KEY_ID=*******************
export AWS_SECRET_ACCESS_KEY=*******************
export AWS_SESSION_TOKEN=*******************
Install Python packages:
pip install -r requirements.txt
Run the chatbot:
streamlit run selfservicebot.py
TBD