Policy Enforcement Methods
Choose the right enforcement approach for your infrastructure: network gateway, database proxy, or library integration
Policy Enforcement Methods
After testing and validation, itβs time to enforce your FGA policies in production. Authonomy provides three primary enforcement methods, each optimized for different architectural patterns and deployment scenarios.
Enforcement Architecture Overview
graph TB U[User Request] --> GW[Network Gateway] GW --> APP[Application] APP --> DB[Database Proxy] DB --> DATA[Database] GW -.-> FGA[FGA Policy Engine] APP -.-> FGA DB -.-> FGA FGA --> LOG[Audit Logs] FGA --> SYNC[Policy Sync]
Choose the enforcement method that best fits your infrastructure and security requirements. Many organizations use multiple methods for different systems.
π Network Gateway Enforcement
Best for: Web applications, API protection, microservices
Intercept and authorize requests at the network layer before they reach your applications.
Key Capabilities
- API endpoint protection: Authorize REST, GraphQL, and RPC calls
- Web application filtering: Control access to pages and resources
- Response modification: Filter sensitive data in API responses
- Protocol support: HTTP/HTTPS, WebSocket, gRPC
Deployment Patterns
- Reverse proxy: Deploy in front of existing load balancers
- Sidecar proxy: Istio/Envoy integration for microservices
- Edge gateway: Cloudflare Worker or AWS Lambda@Edge integration
- API gateway: Kong, Zuul, or AWS API Gateway plugins
Learn more about Network Gateway Enforcement β
ποΈ Database Proxy Enforcement
Best for: Legacy applications, data-centric security, compliance requirements
Enforce fine-grained permissions at the database layer without changing application code.
Key Capabilities
- Row-level security: Control access to specific data rows
- Query rewriting: Automatically add WHERE clauses for authorization
- Multi-database support: PostgreSQL, MySQL, SQL Server, Oracle
- Dynamic filtering: Real-time data filtering based on user context
Use Cases
- Legacy applications: Add modern authorization without code changes
- Data compliance: Implement GDPR, HIPAA data access controls
- Multi-tenant isolation: Ensure tenant data separation
- Audit requirements: Comprehensive data access logging
Learn more about Database Proxy Enforcement β
π Library Integration Enforcement
Best for: Modern applications, new development, fine-grained control
Integrate FGA authorization directly into your application code with minimal changes.
Key Capabilities
- Framework adapters: Spring Security, ASP.NET, Django, Express.js
- Runtime injection: Aspect-oriented programming for existing code
- SDK integration: Native SDKs for popular languages
- Middleware support: Pluggable authorization middleware
Integration Patterns
- Annotation-based:
@Authorize("can_edit", "document")
- Middleware chain: Express.js, Django, Rails middleware
- Aspect-oriented: Spring AOP, PostSharp, aspect-oriented injection
- Manual integration: Direct SDK calls for custom scenarios
Learn more about Library Integration Enforcement β
Choosing the Right Enforcement Method
π― Decision Matrix
Factor | Network Gateway | Database Proxy | Library Integration |
---|---|---|---|
Implementation Speed | Fast | Medium | Slow |
Application Changes | None | Minimal | Some |
Performance Impact | Low | Medium | Minimal |
Granularity Control | Medium | High | Highest |
Legacy System Support | Excellent | Excellent | Limited |
π’ By Organization Type
Enterprise with Legacy Systems
- Primary: Database Proxy (no code changes required)
- Secondary: Network Gateway (API protection)
- Future: Library Integration (for new applications)
Modern SaaS Platform
- Primary: Library Integration (fine-grained control)
- Secondary: Network Gateway (defense in depth)
- Optional: Database Proxy (sensitive data protection)
Regulated Industry (Healthcare, Finance)
- Primary: Database Proxy (data-centric security)
- Required: Network Gateway (perimeter protection)
- Enhanced: Library Integration (application-level audit)
Hybrid Enforcement Strategies
π‘οΈ Defense in Depth
Use multiple enforcement layers for comprehensive protection:
# Multi-layer enforcement example
enforcement_layers:
perimeter:
method: "network_gateway"
policies: ["authentication", "basic_rbac"]
application:
method: "library_integration"
policies: ["fine_grained_permissions", "business_rules"]
data:
method: "database_proxy"
policies: ["row_level_security", "data_classification"]
βοΈ Gradual Migration
Start with one method and gradually add others:
Phase 1: Network Gateway for immediate protection Phase 2: Database Proxy for legacy system coverage
Phase 3: Library Integration for new feature development
Enforcement Monitoring
π Real-Time Metrics
Monitor enforcement effectiveness across all methods:
- Decision accuracy: Policy decisions vs. expected outcomes
- Performance impact: Authorization latency and throughput
- Coverage metrics: Percentage of requests under FGA control
- Error rates: Policy evaluation failures and system errors
π¨ Alerting & Incident Response
Automated alerts for enforcement issues:
- Policy failures: When FGA policies canβt be evaluated
- Performance degradation: Authorization latency spikes
- Security incidents: Unauthorized access attempts
- Compliance violations: Policy decisions that may violate regulations
Implementation Sequence
π Quick Start (1-2 weeks)
- Deploy network gateway in shadow mode
- Configure basic policy enforcement
- Monitor and validate decisions
- Enable enforcement for low-risk endpoints
ποΈ Full Implementation (4-8 weeks)
- Database proxy deployment for legacy systems
- Library integration for modern applications
- Complete policy migration and testing
- Production enforcement with monitoring
π§ Advanced Optimization (2-4 weeks)
- Performance tuning and caching
- Advanced policy features (conditions, delegates)
- Cross-system policy synchronization
- Automated policy management
Support & Troubleshooting
Common enforcement deployment challenges:
- Network configuration: Firewall and routing requirements
- Database compatibility: Version-specific proxy configurations
- Application integration: Framework-specific setup requirements
- Performance optimization: Caching and policy evaluation tuning
Next Steps
Choose your enforcement method and dive into the specific implementation guide:
Or contact our implementation team for personalized guidance on the best approach for your infrastructure.
Ready to enforce FGA policies in production? Schedule a deployment consultation with our technical specialists.