A comprehensive web interface for SOC agents to view AWS Security Hub findings without requiring direct AWS console access. Built with Angular, AWS Lambda, and deployed via Terraform.
Status: β FULLY OPERATIONAL - Professional enterprise-grade interface deployed
- β AWS Console-Style Interface - Professional, enterprise-grade UI matching AWS Console design standards
- β Advanced Data Tables - Dense, information-rich tables with virtual scrolling for 367+ findings
- β Comprehensive Threat Intelligence - All GuardDuty behavioral analysis, network details, and anomaly detection properly organized
- β Professional Filtering - Multi-criteria filtering with real-time updates and bulk operations
- β Enhanced Finding Details - Tabbed interface with complete threat intelligence categorization
- β Export Functionality - Professional CSV/JSON export with metadata
- β Responsive Design - Desktop-optimized (1280px to 4K) with mobile considerations
- β Custom Angular Material Theme - AWS Console color palette with neutral grays
- β Professional Typography - Segoe UI font family matching AWS standards
- β 8px Grid System - Consistent spacing throughout the application
- β Subtle Elevation - Professional shadows and borders
- β Enterprise Components - Status chips, action menus, and professional cards
- β Zero Security Vulnerabilities - Updated to Angular 19.2.16 with all security patches
- β Embedded Authentication - Cognito configuration embedded at build time for improved security and performance
- β Optimized Bundle - 571KB initial bundle with lazy loading for optimal performance
- β Professional Caching - Optimized CloudFront caching strategy
- β Complete ENTRA (Azure AD) authentication integration
- β Embedded Cognito configuration for simplified deployment
- β Secure API Gateway with JWT authorization
- β Real-time Security Hub findings display
- β Automated deployment pipeline
- β Comprehensive monitoring and logging
- Frontend: Angular 19 SPA with professional AWS Console-style Material Design theme
- Backend: Python Lambda functions with comprehensive error handling
- API: API Gateway with Cognito JWT authorization
- Storage: S3 with CloudFront CDN and Origin Access Identity
- DNS: Route 53 with custom domain and SSL certificate
- Monitoring: CloudWatch logs, X-Ray tracing, and detailed metrics
- Infrastructure: Terraform modules for reproducible deployments
- Security: Zero vulnerabilities with embedded authentication configuration
- UI/UX: Tier 1 Enterprise Console-Class interface matching AWS Console standards
βββ frontend/ # Angular 19 application
β βββ src/app/
β β βββ core/ # Core services (auth, findings, open-cases)
β β β βββ services/ # Authentication, API & session services
β β βββ features/ # Feature modules (auth, findings)
β β β βββ auth/ # Login, callback components
β β β βββ findings/ # Dashboard, detail, open-cases components
β β βββ shared/ # Shared components & utilities
β βββ src/environments/ # Environment configurations
βββ backend/
β βββ lambda/ # Python Lambda functions
β βββ security_hub_processor.py # Security Hub API integration
β βββ error_handler.py # Error handling utilities
β βββ test_*.py # Property-based tests
βββ terraform/ # Infrastructure as Code
β βββ modules/ # Reusable Terraform modules
β β βββ s3/ # S3 + OAI + file uploads
β β βββ cloudfront/ # CDN with custom domain
β β βββ lambda/ # Lambda function + IAM
β β βββ api-gateway/ # REST API + Cognito auth
β β βββ route53/ # DNS configuration
β βββ frontend-dist/ # Built Angular artifacts (generated)
β βββ main.tf # Root configuration
β βββ variables.tf # Variable definitions
β βββ outputs.tf # Output values
β βββ terraform.tfvars # Configuration values
βββ deploy.sh # Automated deployment script
βββ AUTHENTICATION.md # Authentication architecture guide
βββ DEPLOYMENT.md # Deployment instructions
βββ ok.py # Reference Python implementation
βββ .kiro/specs/ # Project specifications
# Run the automated deployment script
./deploy.shThe script will:
- Check dependencies (Terraform, Node.js, AWS CLI)
- Build the Angular frontend with production optimizations
- Copy build artifacts to Terraform directory
- Update frontend configuration with existing API Gateway ID (if available)
- Create S3 bucket for Terraform state management
- Deploy infrastructure via Terraform
- Upload frontend files to S3 with proper content types and cache headers
- Create CloudFront invalidation to clear cache
- Provide deployment URLs and next steps
The deployment pipeline seamlessly integrates the Angular build process with Terraform infrastructure deployment:
# Clear Angular cache for fresh build
rm -rf frontend/.angular/cache frontend/dist
# Install dependencies if needed
npm install
# Build production bundle with optimizations
npm run build:prodOutput: Optimized, minified files in frontend/dist/security-hub-findings-app/
# Copy build artifacts to Terraform directory
cp -r frontend/dist/security-hub-findings-app/* terraform/frontend-dist/Purpose: Makes build artifacts available to Terraform for S3 upload
# Create Terraform state bucket (if needed)
aws s3api create-bucket --bucket security-hub-findings-terraform-state-bucket
# Deploy infrastructure
terraform init && terraform applyKey Integration Points:
- Dynamic Configuration: API Gateway ID is injected into frontend files during deployment
- File Upload: All frontend files are uploaded to S3 with proper content types and cache headers
- Cache Management: CloudFront invalidation ensures users get the latest version
The pipeline includes an optimized configuration injection mechanism:
- Build artifacts are copied to the Terraform directory
- Deploy script checks for existing API Gateway ID from previous deployments
- Configuration is updated before Terraform runs (eliminates timing issues)
- Terraform deploys infrastructure and uploads pre-configured files
- CloudFront cache is invalidated to serve updated files immediately
graph TD
A[Angular Build] --> B[Copy to terraform/frontend-dist/]
B --> C[Update Config with API Gateway ID]
C --> D[Terraform Apply]
D --> E[Create AWS Resources]
E --> F[Upload Pre-configured Files to S3]
F --> G[Invalidate CloudFront]
G --> H[Application Ready]
Key Improvements:
- Eliminates timing conflicts between file modification and upload
- Consistent file hashes for reliable change detection
- Faster deployments with fewer Terraform resource dependencies
- More reliable configuration injection process
- Content Types: Automatically set based on file extensions (HTML, CSS, JS, ICO)
- Cache Headers: Optimized for performance:
- HTML files:
no-cache(always fresh) - CSS/JS files:
max-age=31536000(1 year cache) - Other files:
max-age=3600(1 hour cache)
- HTML files:
- Change Detection: Uses consistent MD5 file hashes for reliable change detection
- Upload Optimization: Only modified files are uploaded to S3
- Configuration Timing: API Gateway ID injection happens before file upload (eliminates hash inconsistencies)
- Terraform State: Stored in dedicated S3 bucket with versioning and encryption
- Build Artifacts: Managed through Terraform for consistent deployments
- Configuration: Environment-specific settings injected at deployment time
For more control over the deployment process:
-
Configure AWS credentials:
aws configure
-
Set up Terraform variables:
cp terraform/terraform.tfvars.example terraform/terraform.tfvars # Edit terraform.tfvars with your values -
Build frontend:
cd frontend npm install npm run build:prod cd ..
-
Prepare artifacts:
# Copy build artifacts to Terraform directory cp -r frontend/dist/security-hub-findings-app/* terraform/frontend-dist/ # Update configuration with API Gateway ID (if exists) cd terraform API_GATEWAY_ID=$(terraform output -raw api_gateway_id 2>/dev/null || echo "") if [ -n "$API_GATEWAY_ID" ]; then find ../terraform/frontend-dist -type f \( -name "*.js" -o -name "*.html" \) -exec sed -i "s/{{API_GATEWAY_ID}}/$API_GATEWAY_ID/g" {} \; fi cd ..
-
Create state bucket:
aws s3api create-bucket --bucket security-hub-findings-terraform-state-bucket --region us-east-1 aws s3api put-bucket-versioning --bucket security-hub-findings-terraform-state-bucket --versioning-configuration Status=Enabled
-
Deploy infrastructure:
cd terraform terraform init terraform plan terraform apply -
Invalidate CloudFront cache:
aws cloudfront create-invalidation --distribution-id $(terraform output -raw cloudfront_distribution_id) --paths "/*"
sequenceDiagram
participant Dev as Developer
participant Script as deploy.sh
participant Angular as Angular CLI
participant TF as Terraform
participant AWS as AWS Services
Dev->>Script: ./deploy.sh
Script->>Angular: npm run build:prod
Angular-->>Script: Build artifacts
Script->>Script: Copy to terraform/frontend-dist/
Script->>AWS: Create state bucket (if needed)
Script->>TF: terraform init & apply
TF->>AWS: Create infrastructure
TF->>TF: Inject API Gateway ID
TF->>AWS: Upload files to S3
TF->>AWS: Create CloudFront invalidation
AWS-->>Dev: Application ready
- Build System: Angular CLI with production optimizations
- Configuration Management: Pre-deployment API endpoint injection (eliminates timing issues)
- Infrastructure as Code: Terraform modules for AWS resources
- Content Delivery: S3 + CloudFront with optimized caching
- State Management: Remote state in S3 with versioning
- Cache Invalidation: Automatic CloudFront cache clearing
- Reliability: Consistent file hashing and change detection
The application includes comprehensive API endpoints for managing analyst session tracking:
GET /findings/{findingId}/session/status
Authorization: Bearer {jwt-id-token}Response:
{
"hasActiveSession": true,
"sessionExists": true,
"openerEmail": "claudio@chinicz.com",
"openTimestamp": "2026-01-04T12:59:02.537Z",
"resolverEmail": "",
"resolutionTimestamp": "",
"findingId": "extracted-finding-id"
}POST /findings/{findingId}/session/start
Authorization: Bearer {jwt-id-token}
Content-Type: application/json
{
"findingId": "f64d5ee8-6f7a-48e8-9b59-12a750361",
"analystEmail": "analyst@company.com",
"timestamp": "2024-12-29T10:30:00Z"
}Response:
{
"statusCode": 200,
"message": "Session started successfully"
}POST /findings/{findingId}/session/end
Authorization: Bearer {jwt-id-token}
Content-Type: application/json
{
"findingId": "f64d5ee8-6f7a-48e8-9b59-12a750361",
"status": "RESOLVED",
"resolverEmail": "analyst@company.com",
"timestamp": "2024-12-29T11:45:00Z"
}Response:
{
"statusCode": 200,
"message": "Session ended successfully"
}- GET
/findings- Retrieve findings list with session data - PUT
/findings- Update workflow status and end sessions - OPTIONS
/findings- CORS preflight for the above methods
- GET
/findings/{proxy+}- Session status checks (e.g.,/findings/arn:aws:.../session/status) - POST
/findings/{proxy+}- Session start/end (e.g.,/findings/arn:aws:.../session/start) - OPTIONS
/findings/{proxy+}- CORS preflight for session endpoints
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,Accept,Origin,Referer
Access-Control-Allow-Methods: GET,PUT,POST,OPTIONS,DELETE
Access-Control-Allow-Credentials: false
The OPTIONS methods handle browser preflight requests that occur before actual API calls, ensuring proper cross-origin access from the frontend domain to the API Gateway domain.
The existing /findings endpoint now includes session information:
GET /findings
Authorization: Bearer {jwt-id-token}Enhanced Response:
{
"findings": [
{
"id": "f64d5ee8-6f7a-48e8-9b59-12a750361",
"title": "S3 bucket encryption not enabled",
"severity": "HIGH",
"status": "NEW",
"description": "S3 bucket does not have encryption enabled",
"resources": [...],
"activeSession": {
"analystEmail": "analyst@company.com",
"openedAt": "2024-12-29T10:30:00Z"
}
},
{
"id": "another-finding-id",
"title": "Another security finding",
"severity": "CRITICAL",
"status": "NEW",
"description": "Another security issue",
"resources": [...]
// No activeSession field means no analyst is currently reviewing
}
]
}{
"finding_id": "f64d5ee8-6f7a-48e8-9b59-12a750361",
"opener_email": "analyst1@company.com",
"open_timestamp": "2024-12-29T10:30:00Z",
"resolver_email": "analyst1@company.com",
"resolution_timestamp": "2024-12-29T11:45:00Z",
"ttl": 1735574700
}- Primary Key:
finding_id(extracted from Security Hub ARN) - Global Secondary Indexes:
analyst-email-indexonopener_emailresolver-email-indexonresolver_email
- TTL: Automatic cleanup of old records
- Active Sessions: Records without
resolution_timestamp
All session tracking endpoints require:
- JWT ID Token in Authorization header
- Valid Cognito User Pool token with email claim
- API Gateway Cognito Authorizer validation
The session tracking system includes comprehensive error handling:
- If DynamoDB is unavailable, findings retrieval continues without session data
- Session tracking failures don't affect core finding display functionality
- Error responses include detailed messages for troubleshooting
// Invalid finding ID format
{
"statusCode": 400,
"error": "Invalid finding ID format"
}
// DynamoDB service error
{
"statusCode": 500,
"error": "Session tracking temporarily unavailable"
}
// Unauthorized access
{
"statusCode": 401,
"error": "Invalid or expired token"
}Before deployment, ensure you have:
-
Cognito User Pool with these settings:
- Client ID:
4a2vb2k79v0niig5o1vj6vev00 - Client Secret: Required for Basic Authentication
- Domain:
https://us-east-14qcl4rqho.auth.us-east-1.amazoncognito.com - Scopes:
aws.cognito.signin.user.admin email openid phone profile - Authentication Flow: Authorization Code Grant with client secret
- Identity Providers: Supports ENTRA (Azure AD) integration
- Client ID:
-
SSL Certificate in ACM (us-east-1):
- ARN:
arn:aws:acm:us-east-1:641484007123:certificate/4255f88a-5222-4983-b877-c55358ed5e44
- ARN:
-
Route 53 Hosted Zone for
chinicz.com
Update terraform/terraform.tfvars:
aws_region = "us-east-1"
environment = "prod"
project_name = "security-hub-findings"
# Custom domain configuration
domain_name = "aws.sechub.findings.chinicz.com"
ssl_certificate_arn = "arn:aws:acm:us-east-1:641484007123:certificate/4255f88a-5222-4983-b877-c55358ed5e44"
# Cognito configuration
cognito_user_pool_arn = "arn:aws:cognito-idp:us-east-1:641484007123:userpool/us-east-1_XXXXXXXXX"
cognito_client_id = "4a2vb2k79v0niig5o1vj6vev00"cd frontend
npm install
npm start # Development server on http://localhost:4200Authentication Configuration:
- Embedded Cognito configuration: Client credentials embedded at build time for improved security and performance
- No external API dependencies: Authentication works without additional API calls to fetch configuration
- ID Token Usage: Uses ID tokens for API Gateway calls (critical for authorization)
- Uses Basic Authentication (RFC 7617) for token exchange with embedded client secret
- Automatic token refresh with 15-minute expiration handling
- ENTRA (Azure AD) integration support
- Build-time configuration injection for optimal security
cd backend/lambda
pip install -r requirements.txt
python -m pytest test_*.py # Run property-based testsLambda Configuration:
- Security Hub Function: Main API handler with Security Hub read permissions
- Python 3.9 runtime with AWS SDK
- X-Ray tracing enabled for both functions
- CloudWatch structured logging
- Minimal IAM permissions for security
The project includes comprehensive property-based tests:
# Frontend tests
cd frontend && npm test
# Backend property-based tests
cd backend/lambda && python -m pytest test_*.py -v
# Infrastructure tests
cd terraform/modules/s3 && python -m pytest test_s3_security.py -v- π Dedicated Open Cases Page - Centralized view of all findings currently being reviewed by analysts
- π Active Session Management - Real-time display of which analysts are working on which findings
- π Session Analytics - Track session duration, analyst workload, and case resolution patterns
- π― Quick Navigation - Direct links from Open Cases to detailed finding views
- π Workload Distribution - Visual indicators of analyst activity and case assignments
- π Real-time Updates - Automatic refresh of open cases status with existing 60-second cycle
- π§ Improved Navigation - New "Open Cases" button in main dashboard header
- π Seamless Integration - Smooth navigation between findings dashboard and open cases view
- π± Consistent Design - Open Cases page follows same AWS Console-style design standards
- β‘ Performance Optimized - Efficient API calls and data management for open cases
- π§ Complete ARN Support - Fixed finding detail links to work with complete Security Hub ARNs
- π URL Decoding - Proper handling of URL-encoded finding IDs in navigation
- π― Direct API Queries - Eliminated dependency on "last 100 findings" window for finding details
- π Persistent Links - Finding detail links now work regardless of finding age (within 90-day retention)
- β‘ Improved Performance - Direct Security Hub API queries instead of search-based lookups
- π Analyst Session Management - Track which analysts are currently reviewing specific findings
- π« Duplicate Work Prevention - Visual indicators prevent multiple analysts from working on the same critical/high findings
- π₯ Active Session Display - Red email indicators show which analyst is currently reviewing each finding
- π Complete Audit Trail - Full tracking of who opened and resolved findings with timestamps
- β‘ Real-time Updates - Session information updates automatically with existing 60-second refresh cycle
- ποΈ Persistent Storage - Session data stored in DynamoDB with automatic cleanup via TTL
- π Session Tracking API - New endpoints for starting and ending finding review sessions
- π Enriched Findings Data - Existing
/findingsendpoint now includes active session information - π’ Open Cases API - New
/open-casesendpoint for retrieving active analyst sessions - οΏ½ BEackward Compatibility - All existing functionality preserved while adding session features
- π‘οΈ Error Handling - Graceful degradation when session tracking is unavailable
- π¨ Tier 1 Enterprise Console-Class - Custom Angular Material theme with AWS Console design standards
- π Professional Data Tables - Dense, information-rich tables with virtual scrolling for large datasets
- π― Advanced Filtering - Multi-criteria filtering with real-time updates and bulk operations
- π± Responsive Design - Desktop-optimized interface (1280px to 4K) with professional styling
- ποΈ Professional Components - Status chips, action menus, and enterprise-grade cards
- π Complete Data Organization - All GuardDuty threat intelligence properly categorized and displayed
- π Network Information - IP addresses, geolocation, ISP details, and ASN information
- π€ Behavioral Analysis - Profiled behavior patterns and historical analysis
β οΈ Anomaly Detection - Unusual patterns and anomalous behavior identification- π§ Action Details - API calls, authentication methods, and service interactions
- π Tabbed Organization - Overview, Threat Intelligence, and Resources tabs
- π Two-Column Layout - Main content area with professional sidebar
- π·οΈ Complete Resource Information - All resource details with tags and properties
- π Professional Cards - Clean, organized information display with consistent styling
- π AWS Console Integration - Direct links to AWS console for detailed investigation
- πΎ Professional Export - CSV and JSON export with metadata and timestamps
- π Bulk Operations - Multi-select with batch status updates
- π Performance Optimized - Virtual scrolling for 367+ findings
- π― Smart Filtering - Real-time filtering with clear status indicators
- π AWS Cognito JWT authentication with embedded configuration for enhanced security
- π― ID Token Authorization: Uses ID tokens for API Gateway (critical implementation detail)
- π‘οΈ API Gateway with Cognito User Pool authorizer
- π Private S3 bucket with Origin Access Identity
- π HTTPS-only access with custom SSL certificate
- β‘ Embedded Authentication: Build-time configuration injection eliminates external API dependencies
- π Comprehensive logging and monitoring
- π± Professional AWS Console-style Angular Material Design interface
- π Real-time findings display with 60-second auto-refresh
- π Advanced filtering with multi-criteria support (Enhanced in v2.0)
- π Professional finding details with comprehensive threat intelligence (Redesigned in v2.0)
- πΎ Professional export functionality with CSV/JSON options (Enhanced in v2.0)
- π Open Cases Dashboard for active session management (New in v2.3)
- π― Direct finding navigation with persistent links (Fixed in v2.2)
- β‘ Optimized performance with CloudFront CDN and virtual scrolling
- π― Property-based testing for reliability
- π¨ Tier 1 Enterprise Console-Class UI (New in v2.0)
- π CloudWatch detailed metrics and custom dashboards
- π X-Ray distributed tracing for API Gateway and Lambda
- π Structured logging with request correlation IDs
- π¨ Error tracking and alerting capabilities
-
Dedicated Open Cases Dashboard: New centralized page for managing active analyst sessions
- Accessible via "Open Cases" button in main dashboard header
- Real-time display of all findings currently being reviewed by analysts
- Professional AWS Console-style interface matching main dashboard design
-
Enhanced Session Visibility: Comprehensive view of analyst activity
- Session duration tracking with real-time updates
- Analyst workload distribution and case assignment overview
- Quick navigation from open cases to detailed finding views
- Visual indicators for session status and analyst activity
-
Improved Navigation & User Experience: Seamless integration with existing interface
- New routing configuration for
/open-casesendpoint - Consistent design language across all dashboard components
- Optimized API calls for efficient open cases data retrieval
- Enhanced user workflow for case management
- New routing configuration for
- New API Endpoint:
/open-casesfor retrieving active sessions- Dedicated service for open cases data management
- Integration with existing session tracking infrastructure
- Backward compatibility maintained for all existing functionality
-
Analyst Session Management: Track which analysts are currently reviewing specific findings
- Automatic session start when opening finding details
- Session end tracking when changing finding status to RESOLVED/SUPPRESSED
- Real-time session display with visual indicators (red email text)
-
Duplicate Work Prevention: Prevent multiple analysts from working on same critical/high findings
- Visual indicators show active sessions in findings list
- Complete audit trail for accountability and compliance
- Automatic session cleanup with TTL for data management
-
Enhanced API Endpoints: New session tracking functionality
GET /findings/{id}/session/status- Check session status for a findingPOST /findings/{id}/session/start- Start analyst session trackingPOST /findings/{id}/session/end- End session with resolution data- Enhanced
GET /findings- Now includes active session information - Backward compatibility maintained for existing functionality
-
DynamoDB Workflow Tracker: New table for session audit trail
- Primary key on
finding_idfor efficient lookups - Global Secondary Indexes for analyst queries
- TTL enabled for automatic data cleanup
- Integrated with existing Terraform infrastructure
- Primary key on
-
API Gateway CORS Improvements: Enhanced cross-origin support
- Added GET method to
/findings/{proxy+}for session status checks - Comprehensive CORS headers for all session tracking endpoints
- Proper OPTIONS preflight handling for all endpoints
- Added GET method to
-
Reduced Console Noise: Cleaned up verbose logging in session tracking
- Removed excessive debug logging (π emojis and verbose token logs)
- Silent handling of expected 404 errors (no session exists)
- Only log unexpected errors, not normal flow scenarios
-
CORS Error Resolution: Fixed cross-origin request blocking
- Added missing GET method for session status endpoint
- Proper CORS preflight handling for all session endpoints
- Eliminated "Access-Control-Allow-Origin header is present" errors
- Graceful Error Handling: Session tracking failures don't affect core functionality
- Findings display continues even if session tracking is unavailable
- Comprehensive error logging and monitoring
- Proper JWT token validation for all session endpoints
-
Analyst Session Management: Track which analysts are currently reviewing specific findings
- Automatic session start when opening finding details
- Session end tracking when changing finding status to RESOLVED/SUPPRESSED
- Real-time session display with visual indicators (red email text)
-
Duplicate Work Prevention: Prevent multiple analysts from working on same critical/high findings
- Visual indicators show active sessions in findings list
- Complete audit trail for accountability and compliance
- Automatic session cleanup with TTL for data management
-
Enhanced API Endpoints: New session tracking functionality
POST /findings/{id}/session/start- Start analyst session trackingPOST /findings/{id}/session/end- End session with resolution data- Enhanced
GET /findings- Now includes active session information - Backward compatibility maintained for existing functionality
-
DynamoDB Workflow Tracker: New table for session audit trail
- Primary key on
finding_idfor efficient lookups - Global Secondary Indexes for analyst queries
- TTL enabled for automatic data cleanup
- Integrated with existing Terraform infrastructure
- Primary key on
-
Enhanced Deployment Pipeline: Updated deployment script
- Automatic DynamoDB table verification
- Enhanced schema validation and status reporting
- Comprehensive deployment feedback with session tracking status
- Backward compatibility ensured throughout deployment process
- Graceful Error Handling: Session tracking failures don't affect core functionality
- Findings display continues even if session tracking is unavailable
- Comprehensive error logging and monitoring
- Proper JWT token validation for all session endpoints
-
Tier 1 Enterprise Console-Class Interface: Complete UI redesign following AWS Console design standards
- Custom Angular Material theme with AWS Console color palette
- Professional typography with Segoe UI font family
- 8px grid system for consistent spacing
- Subtle elevation and shadows matching AWS design language
-
Advanced Data Tables: Professional, dense information display
- Virtual scrolling capability for large datasets (367+ findings)
- Multi-criteria filtering with real-time updates
- Bulk selection and batch operations
- Sortable columns with professional styling
-
Comprehensive Threat Intelligence Display: All GuardDuty data properly organized
- Network Information (IP addresses, geolocation, ISP details)
- Behavioral Analysis (profiled behavior patterns, historical analysis)
- Anomaly Detection (unusual patterns and anomalous behavior)
- Action Details (API calls, authentication methods, service interactions)
-
Embedded Authentication: Cognito configuration embedded at build time for enhanced security
- Eliminated external API dependencies for configuration
- Improved performance with no runtime configuration calls
- Enhanced security by removing configuration endpoints
-
Zero Vulnerabilities: Complete security cleanup
- Updated Angular from v17 to v19.2.16
- Fixed 21 vulnerabilities (11 high, 6 moderate, 4 low)
- Updated all dependencies to secure versions
- Enhanced build security with latest tools
- Professional Export: CSV and JSON export with metadata and timestamps
- Advanced Filtering: Multi-criteria filtering with status indicators
- Responsive Design: Desktop-optimized (1280px to 4K) with mobile considerations
- Performance Optimization: Lazy loading and optimized bundle size
- Complete ENTRA (Azure AD) authentication integration
- Dynamic Cognito configuration fetching
- Secure API Gateway with JWT authorization
- Real-time Security Hub findings display
- Automated deployment pipeline
- Comprehensive monitoring and logging
After deployment:
- Main Application:
https://aws.sechub.findings.chinicz.com - Open Cases Dashboard:
https://aws.sechub.findings.chinicz.com/open-cases - CloudFront:
https://{distribution-id}.cloudfront.net - API Gateway:
https://{api-id}.execute-api.us-east-1.amazonaws.com/prod
Previous State (v1.0):
- β 21 total vulnerabilities (11 high, 6 moderate, 4 low)
- β Angular 17 with known security issues
- β Outdated dependencies with security flaws
Current State (v2.0):
- β 0 vulnerabilities - Complete security cleanup
- β Angular 19.2.16 - Latest stable with all security patches
- β Updated Dependencies - All packages updated to secure versions
# Updated from vulnerable versions to secure versions
@angular/common: ^17.0.0 β ^19.2.16 # Fixed XSRF Token Leakage
@angular/compiler: ^17.0.0 β ^19.2.16 # Fixed Stored XSS vulnerability
@angular/core: ^17.0.0 β ^19.2.16 # Multiple security patches- zone.js: Updated to v0.15.0 for Angular 19 compatibility
- TypeScript: Updated to v5.6.0 for security and compatibility
- Build Tools: Updated webpack, esbuild, and other build dependencies
- Development Dependencies: Updated all dev tools to secure versions
-
High Severity (11 fixed):
- Angular XSRF Token Leakage via Protocol-Relative URLs
- Angular Stored XSS Vulnerability via SVG Animation, SVG URL and MathML Attributes
- Multiple dependency chain vulnerabilities
-
Moderate Severity (6 fixed):
- esbuild development server vulnerabilities
- http-proxy-middleware security issues
- webpack-dev-server source code exposure risks
-
Low Severity (4 fixed):
- Various dependency security improvements
# Verify zero vulnerabilities
npm audit
# Output: found 0 vulnerabilities
# Check Angular version
ng version
# Output: Angular CLI: 19.2.16, Angular: 19.2.16- π Regular Updates - Automated dependency scanning
- π‘οΈ Security Audits - Pre-deployment vulnerability checks
- π Monitoring - Continuous security monitoring in production
- π Best Practices - Following Angular security guidelines
- API Gateway Access Logs:
/aws/apigateway/security-hub-findings/access-logs - API Gateway Execution Logs:
API-Gateway-Execution-Logs_{api-id}/prod - Lambda Logs:
/aws/lambda/security-hub-findings-security-hub-function
- Service Map: View request flow from API Gateway β Lambda β Security Hub
- Trace Analysis: Identify performance bottlenecks and errors
- Error Analysis: Root cause analysis for failed requests
- Build Errors: Ensure Node.js >= 18 and run
npm install - Terraform Errors: Check AWS credentials and permissions
- Authentication Issues: Verify Cognito configuration and scopes
- API Errors: Check CloudWatch logs and X-Ray traces
- Configuration Issues: Ensure API Gateway ID is properly injected into frontend files
- Cache Issues: Wait 2-3 minutes after deployment for CloudFront invalidation to complete
Problem: Files not updating after deployment Solution:
# Force CloudFront invalidation
aws cloudfront create-invalidation --distribution-id $(cd terraform && terraform output -raw cloudfront_distribution_id) --paths "/*"
# Hard refresh browser (Ctrl+F5 or Cmd+Shift+R)Problem: API Gateway ID not found in frontend
Status: β
RESOLVED - API Gateway ID properly injected
Current API Gateway ID: rshuboi4oh
Verification Commands:
# 1. Verify API Gateway ID injection worked
grep -r "{{API_GATEWAY_ID}}" terraform/frontend-dist/
# Should return no results (no placeholders remaining)
# 2. Confirm correct API Gateway ID is present
grep -r "rshuboi4oh" terraform/frontend-dist/
# Should find the API Gateway ID in JavaScript files
# 3. Test deployed application
curl -s https://aws.sechub.findings.chinicz.com/main.*.js | grep -o "rshuboi4oh"
# Should return the API Gateway ID
# 4. Verify application functionality
# Visit https://aws.sechub.findings.chinicz.com
# Should load correctly and allow authenticationIf issues arise in future deployments:
# Manual update process (if needed)
cd terraform
find frontend-dist -type f \( -name "*.js" -o -name "*.html" \) -exec sed -i "s/{{API_GATEWAY_ID}}/rshuboi4oh/g" {} \;
aws s3 sync frontend-dist/ "s3://$(terraform output -raw app_bucket_name)/" --delete
aws cloudfront create-invalidation --distribution-id $(terraform output -raw cloudfront_distribution_id) --paths "/*"Problem: Authentication fails with "Configuration not found" Solution: Verify embedded Cognito configuration:
# Verify build process embedded configuration correctly
cd frontend
npm run build
# Check that environment files contain proper Cognito configuration
# Ensure application was built with correct environment
# Client ID: 4a2vb2k79v0niig5o1vj6vev00
# User Pool ID: us-east-1_4QCl4RqHOProblem: API Gateway returns 401 Unauthorized for /findings Status: β RESOLVED - Application working correctly in v2.0
Solution Applied:
- β Authentication flow works correctly with embedded configuration
- β ID tokens are properly generated and used for API calls
- β Auth interceptor correctly uses ID tokens (not access tokens)
- β API Gateway Cognito authorizer accepts valid ID tokens
- β Frontend configuration properly injected with API Gateway ID
- β CloudFront serves updated files correctly
- β Professional UI displays comprehensive threat intelligence
Verification Commands:
# 1. Verify API Gateway ID is correctly injected in frontend
cd terraform && terraform output -raw api_gateway_id
# Returns: rshuboi4oh
# 2. Confirm frontend files have correct API Gateway ID
curl -s https://aws.sechub.findings.chinicz.com/main.*.js | grep -o "rshuboi4oh"
# Should return the API Gateway ID
# 3. Test application functionality
# Visit https://aws.sechub.findings.chinicz.com
# Authentication should work immediately with embedded configuration
# 4. Verify successful authentication and API calls
# Visit https://aws.sechub.findings.chinicz.com
# Login with ENTRA credentials
# Should see professional Security Hub findings interface with comprehensive dataProblem: ENTRA (Azure AD) authentication issues Solution:
- Verify ENTRA redirect URI:
https://us-east-14qcl4rqho.auth.us-east-1.amazoncognito.com/oauth2/idpresponse - Check attribute mapping in Cognito Identity Provider settings
- Ensure ENTRA app has correct scopes:
openid email profile
# Check Terraform state
terraform show
# View CloudWatch logs
aws logs tail /aws/lambda/security-hub-findings-security-hub-function --follow
# Test API Gateway
curl -H "Authorization: Bearer {jwt-token}" https://{api-id}.execute-api.us-east-1.amazonaws.com/prod/findings
# Invalidate CloudFront cache
aws cloudfront create-invalidation --distribution-id {distribution-id} --paths "/*"After running ./deploy.sh, verify the application is working:
-
Authentication Flow:
# Authentication uses embedded configuration - no API calls needed # Visit application URL and test login flow directly
-
Application Access:
- Visit:
https://aws.sechub.findings.chinicz.com - Click "Sign In with AWS Cognito"
- Complete ENTRA authentication
- β Security Hub findings are displayed successfully
- Visit:
-
Browser Dev Tools Verification:
- Network Tab:
/findingsrequests return 200 OK with Security Hub data - Console: Shows "Auth Interceptor: Adding Authorization header with ID token"
- Application β Session Storage: Contains
security_hub_tokenswith all three tokens (access, ID, refresh)
- Network Tab:
-
Token Verification:
# Decode ID token from session storage python3 test_jwt.py <ID_TOKEN> # Should show: "token_use": "id" and correct issuer
- β Application loads with embedded Cognito configuration
- β ENTRA authentication completes successfully
- β API Gateway accepts ID tokens and returns Security Hub findings
- β Lambda functions execute without errors
- β Security Hub findings are displayed in the UI
- Authentication: β Working - Users can successfully authenticate via ENTRA
- Token Generation: β Working - ID tokens are properly generated and stored
- Frontend Configuration: β Working - API Gateway ID properly injected in deployed files
- API Authorization: β Working - API Gateway Cognito authorizer accepts valid ID tokens
- Security Hub Integration: β Working - Lambda successfully fetches and returns findings
- Cache Management: β Working - CloudFront serves updated files correctly
- Authentication Architecture - Detailed authentication flow and configuration
- Deployment Guide - Step-by-step deployment instructions
- Open Cases User Guide - Complete guide for using the Open Cases dashboard
- Session Tracking User Guide - Guide for analyst session management
- AWS Security Hub Documentation
- Angular Material Components
- Terraform AWS Provider
- OAuth 2.0 Authorization Code Grant
- Basic Authentication (RFC 7617)
- AWS Cognito User Pool
- ENTRA (Azure AD) Integration
- Fork the repository
- Create a feature branch
- Run tests:
npm testandpython -m pytest - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
