A comprehensive, AI-powered solution for automating data access management across GCP Cloud SQL (PostgreSQL) and Looker Studio, built with modern technologies and best practices.
- AI-Powered Access Analysis: Real-time risk assessment using Mistral LLM
- Unified Access Management: Single interface for Cloud SQL and Looker Studio
- Visual Workflow Orchestration: n8n-powered approval workflows
- Intelligent Policy Enforcement: Hugging Face embeddings for semantic policy matching
- Comprehensive Audit Trail: Full traceability of all access operations
- Modern Angular UI: Responsive, accessible interface with Material Design
- Local-First Architecture: Complete data sovereignty with Ollama and local services
- Vector-Based Policy Search: Semantic policy matching using ChromaDB
- Real-Time AI Insights: Live risk assessment and recommendations
- Scalable Microservices: Docker-based deployment with service orchestration
- Enterprise-Grade Security: Role-based access control and audit logging
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Angular UI โ โ FastAPI App โ โ n8n Workflows โ
โ (Port 4200) โโโโโบโ (Port 8000) โโโโโบโ (Port 5678) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ PostgreSQL โ โ Ollama LLM โ โ ChromaDB โ
โ (Port 5432) โ โ (Port 11434) โ โ (Port 8001) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Redis โ โ Prometheus โ โ Grafana โ
โ (Port 6379) โ โ (Port 9090) โ โ (Port 3000) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
- FastAPI: High-performance Python web framework
- Pydantic: Data validation and settings management
- LangChain: AI/LLM orchestration framework
- Hugging Face: Sentence transformers for embeddings
- PostgreSQL: Primary database with SQLAlchemy ORM
- Redis: Caching and session management
- Ollama: Local LLM server with Mistral model
- ChromaDB: Vector database for semantic search
- Sentence Transformers: Hugging Face embeddings
- LangChain: AI workflow orchestration
- Angular 17: Modern TypeScript framework
- Angular Material: UI component library
- RxJS: Reactive programming
- TypeScript: Type-safe development
- Docker & Docker Compose: Container orchestration
- n8n: Visual workflow automation
- Prometheus: Metrics collection
- Grafana: Monitoring dashboards
- Nginx: Reverse proxy and load balancing
- Google Cloud SDK: GCP service integration
- Cloud SQL Admin API: PostgreSQL user management
- Looker Studio API: Dashboard access management
- IAM API: Role and permission management
- Docker and Docker Compose
- Node.js 18+ (for local development)
- Python 3.11+ (for local development)
- Google Cloud Project with enabled APIs
- Service account with appropriate permissions
git clone <repository-url>
cd lore_interview
# Copy environment template
cp .env.example .env
# Edit environment variables
nano .env
Required environment variables:
GCP_PROJECT_ID=your-gcp-project-id
GCP_SERVICE_ACCOUNT_PATH=./credentials/service-account.json
DATABASE_URL=postgresql://postgres:password@postgres:5432/access_management
REDIS_URL=redis://redis:6379
OLLAMA_BASE_URL=http://ollama:11434
# Create credentials directory
mkdir credentials
# Download your service account key from GCP Console
# and save it as credentials/service-account.json
# Build and start all services
docker-compose up -d
# Check service status
docker-compose ps
# View logs
docker-compose logs -f app
- Main Application: http://localhost:4200
- API Documentation: http://localhost:8000/docs
- n8n Workflows: http://localhost:5678 (admin/admin123)
- Grafana Monitoring: http://localhost:3000 (admin/admin123)
- Prometheus Metrics: http://localhost:9090
- Navigate to the Access Request form
- Fill in requester details and resource information
- AI will analyze the request in real-time
- Review AI suggestions and risk assessment
- Submit the request for approval
- Approvers receive notifications via n8n workflows
- Review request details and AI analysis
- Approve, reject, or request modifications
- Automated provisioning upon approval
- Cloud SQL: Automatic user creation and role assignment
- Looker Studio: Dashboard sharing and permission management
- Audit Logging: All actions logged with full traceability
{
"resource": "sales-dashboard",
"service_type": "looker_studio",
"roles": [
{
"name": "read_only",
"permissions": ["view"],
"conditions": {
"department": "sales",
"data_sensitivity": "internal"
}
}
],
"approval_workflow": {
"approval_required": true,
"approvers": ["data-owner@company.com"]
},
"access_duration": "30d",
"audit": {
"enabled": true,
"log_level": "detailed"
}
}
- Semantic policy matching using embeddings
- Risk assessment based on historical patterns
- Compliance validation against regulations
- Automated policy recommendations
- Request processing times
- Approval rates and delays
- Policy compliance scores
- Security incident detection
- Risk trend analysis
- Anomaly detection
- Access pattern insights
- Compliance reporting
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run development server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
cd frontend
# Install dependencies
npm install
# Run development server
ng serve --host 0.0.0.0 --port 4200
# Create migration
alembic revision --autogenerate -m "Description"
# Apply migrations
alembic upgrade head
# Backend tests
pytest
# Frontend tests
ng test
# E2E tests
ng e2e
- JWT-based authentication
- Role-based access control (RBAC)
- Multi-factor authentication support
- Session management with Redis
- Encrypted data transmission (HTTPS)
- Secure password generation
- IP-based access restrictions
- Time-based access controls
- Comprehensive audit logging
- Immutable audit trail
- Compliance reporting (GDPR, SOX, HIPAA)
- Real-time security monitoring
- Request latency and throughput
- Error rates and availability
- Resource utilization
- Custom business metrics
- Automated anomaly detection
- Policy violation alerts
- System health notifications
- Security incident alerts
- Real-time system status
- Access request analytics
- Security posture overview
- Compliance reporting
# Build production images
docker-compose -f docker-compose.prod.yml build
# Deploy to production
docker-compose -f docker-compose.prod.yml up -d
# Scale services
docker-compose -f docker-compose.prod.yml up -d --scale app=3
# Apply Kubernetes manifests
kubectl apply -f k8s/
# Check deployment status
kubectl get pods -n access-management
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation at
/docs
- โ Core access management functionality
- โ AI-powered risk assessment
- โ Basic workflow automation
- โ Audit logging
- ๐ Advanced workflow customization
- ๐ Machine learning for anomaly detection
- ๐ Integration with additional GCP services
- ๐ Mobile application
- ๐ Multi-cloud support
- ๐ Advanced AI capabilities
- ๐ Zero-trust architecture
- ๐ Blockchain-based audit trail
Built with โค๏ธ for secure, scalable data access management # access_management_automation