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

FactorNetwork GatewayDatabase ProxyLibrary Integration
Implementation SpeedFastMediumSlow
Application ChangesNoneMinimalSome
Performance ImpactLowMediumMinimal
Granularity ControlMediumHighHighest
Legacy System SupportExcellentExcellentLimited

🏒 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)

  1. Deploy network gateway in shadow mode
  2. Configure basic policy enforcement
  3. Monitor and validate decisions
  4. Enable enforcement for low-risk endpoints

πŸ—οΈ Full Implementation (4-8 weeks)

  1. Database proxy deployment for legacy systems
  2. Library integration for modern applications
  3. Complete policy migration and testing
  4. Production enforcement with monitoring

πŸ”§ Advanced Optimization (2-4 weeks)

  1. Performance tuning and caching
  2. Advanced policy features (conditions, delegates)
  3. Cross-system policy synchronization
  4. 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.