Security Features
Pulsar’s security model includes three main pillars:Authentication
Verify the identity of clients connecting to your Pulsar cluster. Pulsar supports multiple authentication mechanisms:- Athenz - Yahoo’s role-based authentication and authorization system
- SASL/Kerberos - Industry-standard authentication for enterprise environments
- OpenID Connect (OIDC) - Modern token-based authentication with JWT
- TLS Client Certificates - Mutual TLS authentication
- Token Authentication - JWT-based authentication with shared secrets
Authorization
Control access to Pulsar resources once clients are authenticated. Authorization in Pulsar allows you to:- Define super-user roles with full administrative privileges
- Grant granular permissions on tenants, namespaces, and topics
- Implement role-based access control (RBAC)
- Use wildcard matching for flexible permission rules
Encryption
Protect data in transit and at rest:- TLS/SSL Encryption - Encrypt all network communication
- End-to-End Encryption - Application-level message encryption
- Certificate Management - Support for certificate rotation and validation
Security Architecture
Pulsar’s security architecture operates at multiple layers:Common Configuration Properties
Broker Configuration
Core security settings inbroker.conf:
Client Configuration
Clients must be configured to authenticate:Security Best Practices
1. Enable TLS Everywhere
- Use TLS for all broker-to-broker communication
- Enable TLS for client-to-broker connections
- Configure TLS between brokers and BookKeeper
- Use TLS 1.2 or higher (TLS 1.3 recommended)
2. Use Strong Authentication
- Never run production clusters without authentication
- Rotate credentials regularly
- Use certificate-based authentication when possible
- Implement proper secret management for tokens and keys
3. Apply Principle of Least Privilege
- Limit super-user roles to essential administrators only
- Grant minimal permissions required for each client
- Use namespace-level isolation for different teams
- Regularly audit role assignments
4. Secure Configuration Files
5. Enable Hostname Verification
6. Monitor Authentication Failures
- Enable authentication metrics
- Set up alerts for repeated authentication failures
- Monitor for unusual access patterns
- Log all authorization denials
Role-Based Security Model
Pulsar implements a hierarchical security model:Resource Hierarchy
Permission Levels
- Super Users - Full access to all operations
- Tenant Admins - Manage all namespaces within a tenant
- Namespace Producers - Publish messages to topics
- Namespace Consumers - Subscribe and consume messages
- Function Workers - Execute Pulsar Functions
Security Metrics
Pulsar exposes security-related metrics:pulsar_authentication_success_count- Successful authenticationspulsar_authentication_failures_count- Failed authentication attemptspulsar_authorization_success_count- Successful authorization checkspulsar_authorization_failures_count- Failed authorization attempts
/metrics endpoint and can be exported to monitoring systems like Prometheus.
Next Steps
Authentication
Configure authentication providers
Authorization
Set up access control policies
Encryption
Enable TLS and encryption