README

Biometric Scan App

A serverless biometric identity verification pipeline on AWS. The system accepts an ID image and a selfie, compares faces with Amazon Rekognition, and stores verification state in DynamoDB.

Python 3.13 AWS Lambda Amazon Rekognition DynamoDB S3 API Gateway Secrets Manager AWS SAM AWS WAF v2

Architecture Overview

Upload Subservice (API Lambda)

Exposes POST /upload, accepts base64 image payloads, stores images in S3, and triggers the verification worker asynchronously after selfie upload.

Verification Worker (Background Lambda)

Calls Rekognition CompareFaces and writes verification status and similarity score to DynamoDB.

AWS Resources (SAM)

The SAM template provisions:

Authentication Model

API Contract

Endpoint: POST /upload

Supported actions

Notes: user_id must match ^[a-zA-Z0-9_\-]{3,64}$. CORS is currently restricted to https://app.joesparkman.com. If Rekognition processing fails, the worker writes a terminal ERROR status to DynamoDB to avoid indefinite PENDING states.

Frontend Configuration

Important security note: short-lived tokens reduce exposure, but browser-visible tokens are still bearer credentials. Production would add user authentication and issue scoped server-side sessions.

Deployment

Prerequisites: AWS CLI configured (aws configure) and the AWS SAM CLI installed.

sam build
sam deploy --guided

After deployment: copy the output ApiEndpoint value, update frontend/config.js's API_URL, and ensure the Secrets Manager secret contains the signing secret used by the session token system.

Security tuning knobs (template parameters)

Local / Integration Test Script

upload_subservice/test_api.py reads the local environment variable API_URL.

Security & Repository Hygiene

Open App Story Visual Diagram Back to Portfolio