National-grade PII sanitization engine designed to meet SBP requirements for fintech infrastructure.
PakShield is a high-performance middleware and security dashboard designed for the Pakistani fintech ecosystem. It provides automated PII (Personally Identifiable Information) masking and implements RFC 9449 (DPoP) to satisfy the State Bank of Pakistan (SBP) Technology Risk Management (TRM) Framework.
Advanced recursive regex engine designed to detect and mask Pakistani-specific sensitive data patterns:
- CNIC Masking: Automatically identifies and obfuscates Computerized National Identity Card numbers (
42101-*******-1). - Bank Account Sanitization: Detects and masks standard 14-16 digit bank account numbers.
- Recursive Processing: Deep-scans nested JSON objects in API requests/responses.
Hardened application-layer security to prevent token theft and replay attacks:
- Asymmetric Binding: Cryptographically binds access tokens to the client's private key.
- RFC 9449 Compliant: Uses ES256 Elliptic Curve signatures for request verification.
- Replay Protection: Validates
htu(target URL) andhtm(HTTP method) for every sensitive transaction.
A live, traceable log of all security events within the system:
- Audit Trail: Every masking action and DPoP handshake is logged with a unique Verification ID.
- SBP Mapping: Aligns system actions directly with TRM Framework mandates (e.g., Section 4.2).
- Runtime: Node.js (Full-stack Express + Vite)
- Backend: Express.js with custom DPoP middleware
- Frontend: React 19 + Tailwind CSS
- Cryptography:
jose(JWT/JWS library) - Icons:
lucide-react - Animations:
motion
- Node.js (v18 or higher)
- npm (v9 or higher)
-
Clone the repository:
git clone https://github.com/your-org/pakshield.git cd pakshield -
Install dependencies:
npm install
Start the full-stack development server (Backend + Frontend):
npm run devThe application will be accessible at http://localhost:3000.
npm run buildThis will compile the frontend assets into the dist/ folder, which the Express server serves in production mode.
├── src/ # React Frontend
│ ├── components/ # UI Components (Detection, Audit, Secure Portal)
│ ├── lib/ # Utility functions (cn, tailwind-merge)
│ ├── App.tsx # Main entry component & Global State
│ └── main.tsx # React mounting
├── server.ts # Express Backend & Security Middleware
├── package.json # Dependencies and Scripts
└── tsconfig.json # TypeScript configuration
PakShield is designed as a prototype demonstration of high-grade fintech security patterns. In a production environment, ensure that:
- Private keys for DPoP are stored securely (e.g., via Hardware Security Modules or secure TEEs).
- All API endpoints are served over TLS 1.3.
- The regex engine is regularly audited for new PII patterns unique to the region.