You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RFC: OpenPolicyAgent (OPA) Integration for Pod Authorization
Summary
This RFC proposes integrating OpenPolicyAgent (OPA) into interLink to provide fine-grained authorization control over which pods are allowed to execute on remote resources. This would enable policy-driven decision making for pod scheduling and execution based on various attributes like user identity, namespace, resource requirements, labels, annotations, and more.
Background
Currently, interLink provides authentication through OIDC/OAuth2 integration but lacks fine-grained authorization controls beyond basic authentication. Pod execution decisions are primarily based on:
Authentication: OIDC/OAuth2 token validation
Basic resource allocation: Node capacity and taints/tolerations
Kubernetes RBAC: Standard K8s permissions for pod creation
However, there's no mechanism to implement custom policies for:
Workload classification and routing
Security policy compliance
Multi-tenancy isolation
Proposed Solution
Architecture Overview
The OPA integration would be implemented as a policy evaluation layer within the interLink API server, specifically in the pod creation flow:
Virtual Kubelet --> interLink API Server --> Plugin (SLURM/etc)
|
v
OPA Engine + Policies
Integration Points
Pod Creation Authorization (Primary)
Location: pkg/interlink/api/create.go - CreateHandler function
Decision Point: Before forwarding pod creation to sidecar
Input Context: Full pod specification, user identity, namespace metadata
Policy Decision: Allow/Deny pod execution with optional modifications
Dynamic Policies: Policies based on real-time cluster state
Cross-cluster Policies: Authorization across multiple interLink deployments
Policy Testing: Built-in policy simulation and testing tools
Questions for Discussion
Should we support multiple policy engines or focus exclusively on OPA?
What's the preferred approach for policy distribution and management?
Should authorization be optional or required for production deployments?
How should we handle policy evaluation failures and performance concerns?
What external data sources should be supported for policy evaluation?
Should we provide a default set of common policies out-of-the-box?
Next Steps
Gather community feedback on this RFC
Create detailed technical design document
Implement proof-of-concept with basic OPA integration
Develop policy examples and best practices guide
Plan phased implementation and migration strategy
Note: This RFC is open for community discussion. Please share your thoughts on the proposed approach, implementation details, and any concerns or suggestions you may have.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
RFC: OpenPolicyAgent (OPA) Integration for Pod Authorization
Summary
This RFC proposes integrating OpenPolicyAgent (OPA) into interLink to provide fine-grained authorization control over which pods are allowed to execute on remote resources. This would enable policy-driven decision making for pod scheduling and execution based on various attributes like user identity, namespace, resource requirements, labels, annotations, and more.
Background
Currently, interLink provides authentication through OIDC/OAuth2 integration but lacks fine-grained authorization controls beyond basic authentication. Pod execution decisions are primarily based on:
However, there's no mechanism to implement custom policies for:
Proposed Solution
Architecture Overview
The OPA integration would be implemented as a policy evaluation layer within the interLink API server, specifically in the pod creation flow:
Integration Points
Pod Creation Authorization (Primary)
pkg/interlink/api/create.go-CreateHandlerfunctionImplementation Design
Configuration Structure
Policy Input Schema
{ "input": { "pod": { "metadata": {}, "spec": {} }, "user": { "username": "string", "groups": ["string"], "extra": {} }, "namespace": { "name": "string", "labels": {}, "annotations": {} }, "node": { "name": "interlink-node", "labels": {}, "available_resources": {} }, "operation": "create|delete|status" } }Policy Decision Schema
{ "result": { "allowed": true, "reason": "Policy evaluation passed", "modifications": { "pod_annotations": { "billing.project": "research-team-a" }, "resource_limits": { "cpu": "4", "memory": "8Gi" } } } }Example Policies
1. Resource Quota by User Group
2. Multi-tenant Isolation
Implementation Steps
Phase 1: Core OPA Integration
pkg/interlink/api/create.goPhase 2: Advanced Features
Phase 3: Enhanced Integration Points
Migration Strategy
Security Considerations
Future Extensions
Questions for Discussion
Next Steps
Note: This RFC is open for community discussion. Please share your thoughts on the proposed approach, implementation details, and any concerns or suggestions you may have.
Beta Was this translation helpful? Give feedback.
All reactions