-
Notifications
You must be signed in to change notification settings - Fork 0
Security Hardening + AI Pentest Framework #31
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # AI Pentest Framework | ||
|
|
||
| This directory contains the infrastructure for AI agents to actively pentest the Queue application. | ||
|
|
||
| ## Structure | ||
|
|
||
| ``` | ||
| pentest/ | ||
| ├── harness/ # Execution harness for running attacks | ||
| │ ├── README.md # This file | ||
| │ ├── index.ts # Main pentest runner | ||
| │ ├── convex-agent.ts # Convex API client for agents | ||
| │ └── attack-suite.ts # Attack templates | ||
| ├── inventory/ # Auto-generated API surface inventory | ||
| │ └── CONVEX_INVENTORY.md | ||
| └── templates/ # Attack templates per vulnerability class | ||
| ├── idor.md | ||
| ├── rate-limit.md | ||
| ├── auth-bypass.md | ||
| ├── data-exposure.md | ||
| ├── payment-attacks.md | ||
| └── injection.md | ||
| ``` | ||
|
|
||
| ## Quick Start for AI Agents | ||
|
|
||
| ### 1. Connect to Convex | ||
|
|
||
| ```typescript | ||
| import { createConvexAgent } from "./harness/convex-agent"; | ||
|
|
||
| const convex = createConvexAgent({ | ||
| deploymentUrl: process.env.CONVEX_DEPLOYMENT_URL!, | ||
| adminKey: process.env.CONVEX_ADMIN_KEY!, // Only for pentest env | ||
| }); | ||
|
|
||
| // List all attack surfaces | ||
| await convex.listFunctions(); | ||
| ``` | ||
|
|
||
| ### 2. Run Attack Suite | ||
|
|
||
| ```typescript | ||
| import { runAttackSuite } from "./harness/attack-suite"; | ||
|
|
||
| const results = await runAttackSuite(convex, { | ||
| targets: ["idor", "rate-limit", "auth-bypass", "data-exposure"], | ||
| testUserA: { email: "attacker@test.com", role: "instructor" }, | ||
| testUserB: { email: "victim@test.com", role: "instructor" }, | ||
| }); | ||
| ``` | ||
|
|
||
| ### 3. Run Individual Attack | ||
|
|
||
| ```typescript | ||
| import { IDORAttacker } from "./templates/idorttack"; | ||
|
|
||
| const attacker = new IDORAttacker(convex); | ||
| const results = await attacker.attack({ | ||
| functionName: "getGoogleIntegrationForUser", | ||
| vulnerableArg: "userId", | ||
| victimId: await convex.query("users", { email: "victim@test.com" }), | ||
| }); | ||
| ``` | ||
|
|
||
| ## Environment Variables Required | ||
|
|
||
| ```env | ||
| CONVEX_DEPLOYMENT_URL=https://your-project.convex.cloud | ||
| CONVEX_ADMIN_KEY=... # Pentest environment only | ||
| TEST_ATTACKER_EMAIL=attacker@test.com | ||
| TEST_ATTACKER_PASSWORD=... | ||
| TEST_VICTIM_EMAIL=victim@test.com | ||
| TEST_VICTIM_PASSWORD=... | ||
| ``` | ||
|
|
||
| ## Security Notes | ||
|
|
||
| - **ONLY run against a dedicated pentest/staging environment** | ||
| - Admin key gives full access — never use production credentials | ||
| - Some attacks (rate limiting, DoS) may degrade service for other testers | ||
| - Clean up test data after each run | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 The Roast: This import path is so wrong it might actually work if you believe in UFOs.
./templates/idorttackdoesn't exist —IDORAttackeris actually exported from./harnesses/attack-suite. Also, the file is namedidorttack.md(typo in filename).🩹 The Fix:
📏 Severity: warning