Security Focused : Architectural Decision For mTLS Feature . #2744
Replies: 7 comments 3 replies
|
@achrefbensaad @Aryan-sharma11 @AryanBakliwal @ravkishu @murtaza-u |
|
imo, as long as we wont be issuing separate mtls certs for the new management endpoint, the separation has no real advantage. yes it. makes refactoring easier in the future but by how much ? few lines of code wont change the scoping of work.
|
|
I Agree with your point , if we want to justify two separate endpoints from a security perspective, we should also separate the mTLS material for log and management. A good target design would be : Add separate certs/trust domains for both: Then: -LogServer loads log server certs and trusts log client CA. I would appreciate the team's decision for mTLS implementation so that we can continue. |
|
Hi @achrefbensaad , I checked the current cert loading behavior, and there is one related point we should clarify before implementing mTLS. So if we move to separate mTLS material for log and management, we need to decide how those CA files are expected to exist. For Kubernetes/operator mode, it looks like the operator already creates and mounts the KubeArmor CA secret, so the current Should we assume production users/operators will pre-provision the CA material for both endpoints, for example: /var/lib/kubearmor/tls/log/ca.crt Or should KubeArmor/operator be responsible for creating separate CA material for log and management? I wanted to confirm the expected CA bootstrap model? |
|
@Aryan-sharma11 I would appreciate the team's decision on this implementation ? |
|
The Final Design Architecture Would be this - Data Plane - Obervability
Control Plane - Management
|
|
@achrefbensaad @Aryan-sharma11 Hi I was reviewing the GenerateCA() function and noticed an unusual pattern where two separate RSA key pairs are generated:
This means the signing key and embedded public key don't correspond -Probably the CA cert would fail self-signature verification. I saw the standard practice (Go stdlib, k8s client-go, cfssl) is to generate a single key and call x509.CreateCertificate(rand.Reader, &template, &template, &key.PublicKey, key). Was there a specific reason this two-key approach was chosen? I wanted to understand the intent. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Topic - Why are we introducing two separate gRPC servers for mTLS ?
Teams Question -
Aryan -
1. Why are we introducing two separate gRPC servers?
My understanding is that mTLS will be enabled on both servers by default. I understand that TLS for the LogServer can be made optional via a flag and Management will always be enabled, but we could go ahead with mTLS enable by default and leave it on the client to whether disable it? We can look into making use og gRPC interceptors for additional authentication and authorization if required, while keeping the overall architecture simpler.
2. HealthCheck service
We recently moved the HealthCheck service to a separate port because Kubernetes liveness probes do not support TLS. With this proposal, we would now end up maintaining three separate gRPC ports.
Follow Up By me -
Hey Aryan , Thanks for taking time to review the design and discussed with the team. I also spent some time thinking about these points as well. My reasoning for proposing two servers isn't primarily because of mTLS itself, but because of the separation of responsibilities between the APIs. (Followed by speration of concern design principle).
1. Why introduce two gRPC servers?
I agree that if the only objective were "enable mTLS by default", then a single gRPC server would be sufficient. Both approaches can achieve transport security.
The motivation behind the split is architectural rather than just implementing mTLS .
As we know the services currently exposed by KubeArmor naturally fall into two different categories:
1. Data plane / Observability
2. Control plane / Management
This two groups has diff characteristics
This follows a common cloud-native design principle:
Control Plane ≠ Data Plane
Many infrastructure projects intentionally separate these interfaces instead of relying solely on application-layer authorization.
The goal is not simply stronger authentication but creating a clear security boundary around privileged operations.
with two endpoints:
This also means future enhancements such as RBAC, SPIFFE identities, authorization interceptors, or stronger administrative authentication remain isolated to the management plane without affecting the logging path.
From a maintenance perspective, the server registration also becomes simpler since each server owns a single responsibility rather than mixing observability and management services behind one listener.
Current Pr (changes made after i shared docs ) - I have made it configurable , both log server and management sever can be operate by flag.
Overall my thinking was to optimized for Long Term Architecture rather than just the immediate mTLS requirement .Even if both servers use mTLS today , I believe seperating the observability plane from the management plane provides a cleaner security model, aligns with the pattern used in the cloud-native infrastructure projects , and gives us more flexibility as the management API evolves . Interceptors can still be layered on the top of management server later ( that was already plan ) for finer-grained authentication and authorization without changing that architectural boundary.
All reactions