📋 Summary
Implement a gRPC server interceptor to enable Kerberos/GSSAPI authentication for gRPC-based inter-shard communication and client connections.
Parent Feature: Issue #[parent-issue-number] - Kerberos/GSSAPI Authentication Support
🔍 Problem Statement
Current State
- ✅ Kerberos authentication implemented for HTTP/REST API
- ✅ AuthMiddleware supports Kerberos
- ❌ gRPC services lack Kerberos authentication support
- ❌ Inter-shard gRPC communication uses other authentication methods
Customer Need
Enterprise customers using gRPC need:
- Consistent authentication across HTTP and gRPC endpoints
- Mutual authentication for secure inter-shard communication
- SSO integration for gRPC clients
- Kerberos-based service-to-service authentication
Business Impact
Without gRPC Kerberos Support:
- Inconsistent authentication across protocols
- Cannot use Kerberos for inter-shard communication
- Reduced security for distributed deployments
With gRPC Kerberos Support:
- ✅ Unified authentication across all protocols
- ✅ Secure service-to-service communication
- ✅ Complete enterprise SSO integration
🎯 Requirements
Functional Requirements
FR-1: Server-Side Interceptor
FR-2: Client-Side Support
FR-3: Configuration
FR-4: Authorization
Non-Functional Requirements
NFR-1: Performance
NFR-2: Compatibility
🛠️ Technical Design
Server Interceptor
// File: include/rpc/kerberos_interceptor.h
class KerberosServerInterceptor : public grpc::experimental::Interceptor {
public:
explicit KerberosServerInterceptor(GSSAPIAuthenticator* authenticator);
void Intercept(grpc::experimental::InterceptorBatchMethods* methods) override;
private:
GSSAPIAuthenticator* authenticator_;
std::string extractToken(const std::multimap<grpc::string_ref, grpc::string_ref>& metadata);
bool validateAndSetContext(grpc::ServerContext* context, const std::string& token);
};
Client Interceptor
// File: include/rpc/kerberos_client_interceptor.h
class KerberosClientInterceptor : public grpc::experimental::ClientInterceptor {
public:
explicit KerberosClientInterceptor(const std::string& service_principal);
void Intercept(grpc::experimental::InterceptorBatchMethods* methods) override;
private:
std::string service_principal_;
gss_ctx_id_t context_;
std::string acquireToken();
};
Usage Example
// Server-side
auto authenticator = std::make_shared<GSSAPIAuthenticator>();
authenticator->initialize(kerberos_config);
ServerBuilder builder;
builder.experimental().SetInterceptorCreators({
std::make_unique<KerberosServerInterceptorFactory>(authenticator.get())
});
// Client-side
auto channel = grpc::CreateCustomChannel(
server_address,
grpc::InsecureChannelCredentials(),
grpc::ChannelArguments()
);
auto interceptor = std::make_unique<KerberosClientInterceptor>(
"themisdb/server@REALM.COM"
);
// Add interceptor to channel
📝 Implementation Plan
Phase 1: Server Interceptor (Week 1)
Phase 2: Client Interceptor (Week 2)
Phase 3: Integration & Testing (Week 3)
✅ Acceptance Criteria
Functional Acceptance
Technical Acceptance
Documentation Acceptance
🧪 Testing Strategy
Unit Tests
- Token extraction from metadata
- Invalid token handling
- Context caching logic
- Ticket renewal logic
Integration Tests
- End-to-end authentication with test KDC
- Service-to-service authentication
- Streaming RPC authentication
- Fallback authentication
📚 References
🔗 Related Issues
- Parent: Issue #[parent-issue-number] - Kerberos/GSSAPI Authentication Support
- Related: Issue #[audit-logging-issue] - Kerberos Audit Logging
- Related: Issue #[metrics-issue] - Kerberos Metrics
💬 Notes
Dependencies:
- Requires Kerberos/GSSAPI authentication implementation (completed)
- Requires gRPC support enabled (
THEMIS_ENABLE_GRPC=ON)
Estimated Effort: 3 weeks (1 developer)
Created: 2026-01-12 (Future Enhancement from Kerberos Implementation)
Status: 📋 Planned
Priority: MEDIUM
Labels: type:enhancement, area:security, area:networking, priority:P2, effort:medium
📋 Summary
Implement a gRPC server interceptor to enable Kerberos/GSSAPI authentication for gRPC-based inter-shard communication and client connections.
Parent Feature: Issue #[parent-issue-number] - Kerberos/GSSAPI Authentication Support
🔍 Problem Statement
Current State
Customer Need
Enterprise customers using gRPC need:
Business Impact
Without gRPC Kerberos Support:
With gRPC Kerberos Support:
🎯 Requirements
Functional Requirements
FR-1: Server-Side Interceptor
KerberosServerInterceptorclassGSSAPIAuthenticatorFR-2: Client-Side Support
KerberosClientInterceptorclassFR-3: Configuration
config.yamlKerberosConfigFR-4: Authorization
Non-Functional Requirements
NFR-1: Performance
NFR-2: Compatibility
🛠️ Technical Design
Server Interceptor
Client Interceptor
Usage Example
📝 Implementation Plan
Phase 1: Server Interceptor (Week 1)
KerberosServerInterceptorclassGSSAPIAuthenticatorPhase 2: Client Interceptor (Week 2)
KerberosClientInterceptorclassPhase 3: Integration & Testing (Week 3)
✅ Acceptance Criteria
Functional Acceptance
Technical Acceptance
Documentation Acceptance
🧪 Testing Strategy
Unit Tests
Integration Tests
📚 References
🔗 Related Issues
💬 Notes
Dependencies:
THEMIS_ENABLE_GRPC=ON)Estimated Effort: 3 weeks (1 developer)
Created: 2026-01-12 (Future Enhancement from Kerberos Implementation)
Status: 📋 Planned
Priority: MEDIUM
Labels:
type:enhancement,area:security,area:networking,priority:P2,effort:medium