Go IAM Fundamentals
🏢 Multi-Tenant Architecture
- 🔐 Auth Providers - External authentication systems
- 👥 Clients - Your applications that need authentication
- 👤 Users - People who access your applications
- 🎭 Roles - Permission groups for users
- 📦 Resources - Protected items in your system
- SaaS providers serving multiple customers
- Enterprise organizations with multiple departments
- Development teams managing multiple applications
- Agencies handling various client projects
🔐 Authentication System
External Auth Providers
Currently Supported
- 🔍 Google OAuth - Full integration with Google's authentication system
Extensible Architecture
- Microsoft Azure AD
- GitHub OAuth
- Facebook Login
- Custom SAML providers
- LDAP/Active Directory
Client Management
Mermaid
graph LR
A[Your App] --> B[Go IAM Client]
B --> C[Auth Provider]
C --> D[Google/External]
Key Features:
- One-to-Many Mapping: A single auth provider can serve multiple clients
- Flexible Configuration: Each client can have different settings and permissions
- Secure Credentials: Each client gets unique credentials for API access
Special Client: Go IAM Self-Authentication
- Self-Contained: Go IAM can provide authentication for its own admin interface
- Bootstrap Security: Essential for initial setup and ongoing administration
- Single Setup: This special client can only be configured in go iam deployment's lifecycle
- Admin Access: Provides secure access to the Go IAM management interface
🛡️ Authorization System
Resource Management
Resource Definition
- Stable Identifier: Must have an identifier that won't change
- Flexible Scope: Can represent anything from UI buttons to database records
- Granular Control: Each resource can be individually managed
Resource Examples:
Yaml
Resources:
- id: "user-dashboard-button"
type: "UI Element"
description: "Main dashboard access button"
- id: "api-users-create"
type: "API Endpoint"
description: "POST /api/users endpoint"
- id: "db-user-record-123"
type: "Database Record"
description: "Specific user record in database"
- id: "report-financial-q4"
type: "Document"
description: "Q4 Financial Report access"
Access Control Methods
1. 🎭 Role-Based Assignment
- Resources attached to roles
- Users inherit resource access through role membership
- Ideal for standard permission sets
2. 📋 Policy-Based Assignment
- Resources directly assigned to users via policies
- More granular and flexible than roles
- Perfect for exceptions and special cases
Automated Policy System
1. 👤 User Creation Policy (Default)
Yaml
Policy: "Auto-assign resources to creator"
Trigger: When a user creates a resource
Action: Automatically attach the resource to the creating user
Use Case: Ensures creators always have access to their own resources
Status: Applied by default to all new users
2. 🔄 User-to-User Transfer Policy
Yaml
Policy: "Auto-assign to specific user"
Trigger: When any resource is created
Action: Automatically attach the resource to a designated user
Use Case: Central management or delegation scenarios
Configuration: Specify target user during policy setup
3. 🎭 Role Assignment Policy
Yaml
Policy: "Auto-assign to role"
Trigger: When any resource is created
Action: Automatically attach the resource to a specified role
Use Case: Feature development and production readiness
Configuration: Specify target role during policy setup
Resource Lifecycle Management
Policy-Based Attachment
- ✅ Persistent: Resources attached via policies remain with users even when policies are removed
- 🔒 Intentional: Prevents accidental loss of access when policies change
- 📝 Auditable: Clear history of how users gained access to resources
Role-Based Attachment
- 🔄 Dynamic: Resources are automatically removed when roles are revoked
- 🛡️ Safe: Only removes access if no other roles or policies grant the same resource
- ⚡ Immediate: Changes take effect instantly when role membership changes
Example Scenario:
Yaml
User: "Alice"
Initial State:
- Role: "Editor" (includes resource-A, resource-B)
- Policy: Direct access to resource-A
Action: Remove "Editor" role from Alice
Result:
- resource-A: ✅ Still accessible (granted via policy)
- resource-B: ❌ Access removed (no other grants exist)
🔮 Future Roadmap
Custom Policies
- Business Logic Integration: Policies based on custom business rules
- External System Integration: Policies that consider external data sources
- Time-Based Access: Temporary or scheduled resource access
- Conditional Logic: Complex if-then scenarios for resource assignment
Additional Features
- Advanced Audit Logging: Comprehensive access and change tracking
- API Rate Limiting: Built-in protection against abuse
- SSO Integration: Single Sign-On with popular enterprise systems
- Mobile SDK Support: Native mobile application integration
🎯 Best Practices
Project Organization
- Separate Environments: Use different projects for development, staging, and production
- Logical Grouping: Group related applications and users within projects
- Clear Naming: Use descriptive names for all resources and roles
Security Guidelines
- Principle of Least Privilege: Grant minimum necessary access
- Regular Audits: Periodically review user permissions and resource assignments
- Policy Documentation: Document the purpose of each custom policy
- Role Hierarchy: Design clear role structures that reflect your organization
Performance Optimization
- Resource Granularity: Balance between security and performance when defining resources
- Caching Strategy: Leverage Go IAM's caching for frequently accessed permissions
- Batch Operations: Use bulk operations for large-scale permission changes