How karanjeet-kumar/cybersecurity-capstone-project works
This repository is a five-part AI identity security capstone: threat modeling, an Auth0-backed web/API application, simulated red-team attacks, blue-team controls and detection, and compliance governance. The primary runtime path is browser login through the web app’s OAuth/PKCE callback and session, then scope-checked chat/admin requests to the protected API. Separate project scripts demonstrate attacks and defenses rather than forming one deployed pipeline. Some capability nodes are based on README requirements and tree paths; their implementation details and connections were not sampled.
Main entry points: app.js Web Portal · guardrails.py Input and Output Guardrails · agent.py Simulated Agent · rotate.js M2M Token Test
Components 23
Threat Modeling
- Identity Threat Model
01-threat-model/README.md - Attack Trees
01-threat-model/Draw IO - ATLAS Risk Register
01-threat-model/MITRE ATLAS Technique/risk_register.csv
Identity Application
- Web Portal
02-iam-design/app.js - Session and Scope Checks
02-iam-design/middleware/auth.js - Protected API
02-iam-design/api.js - Auth0
- M2M Token Test
02-iam-design/rotate.js
Red Team
- Simulated Agent
03-red-team/agent.py - Indirect Injection
03-red-team/attack1_indirect_injection.py - Agent Spoofing
03-red-team/attack2_agent_spoofing.py - Prompt Extraction
03-red-team/attack3_prompt_extraction.py - RAG and MCP Poisoning
03-red-team/attack4_rag_poisoning.py
Blue Team
- Hardened Agent
04-blue-team/agent.py - Input and Output Guardrails
04-blue-team/guardrails.py - NeMo Guardrails
04-blue-team/task1_nemoguardrails/run_guardrails.py - Guardrail Actions
04-blue-team/task1_nemoguardrails/config/actions.py - Signed Agent Identity
04-blue-team/identity_binding.py - Anomaly Detection
04-blue-team/anomaly_detection.py - Before and After
04-blue-team/before_after.py
Governance
- Identity Security Policy
05-policy - Compliance Mapping
05-policy/compliance_mapping.xlsx
Other components
- User
Connections 20
- User → Web Portal: uses
README.md - Web Portal → Auth0: authenticates with
02-iam-design/app.js - Auth0 → Web Portal: returns tokens
02-iam-design/app.js - Web Portal → Session and Scope Checks: checks access
02-iam-design/app.js - Web Portal → Protected API: forwards API request
02-iam-design/app.js - M2M Token Test → Auth0: requests M2M token
02-iam-design/rotate.js - M2M Token Test → Protected API: replays token
02-iam-design/rotate.js - Identity Threat Model → Attack Trees: documents threats as
README.md - Attack Trees → ATLAS Risk Register: maps risks to
README.md - Indirect Injection → Simulated Agent: invokes
03-red-team/attack1_indirect_injection.py - Prompt Extraction → Simulated Agent: invokes
03-red-team/attack3_prompt_extraction.py - Simulated Agent → Input and Output Guardrails: agent used by
04-blue-team/guardrails.py - Input and Output Guardrails → Hardened Agent: guards responses from
04-blue-team/guardrails.py - NeMo Guardrails → Guardrail Actions: loads configured rails
- Agent Spoofing → Signed Agent Identity: mitigated by
README.md - RAG and MCP Poisoning → Input and Output Guardrails: tested against
- Anomaly Detection → Hardened Agent: monitors identity events
- Before and After → Input and Output Guardrails: evaluates controls
04-blue-team/before_after.py - Before and After → Signed Agent Identity: evaluates controls
04-blue-team/before_after.py - Identity Security Policy → Compliance Mapping: mapped as evidence
README.md