Scrivio Interview library
DesignAdvanced6 min read · updated 13 November 2026

A shared Kafka platform that carries personal and payment data for many teams needs a single security model that still lets teams move quickly.

Design the security model for a shared Kafka platform used by 150 services owned by 40 teams, including topics with personal and payment data. Cover identity, authorization, encryption, secrets, auditing, and how teams request access without the platform team becoming a bottleneck.

Give every service its own principal from a central identity system, either mTLS certificates from the company PKI mapped with ssl.principal.mapping.rules or OAUTHBEARER tokens from the OIDC provider, and authorize deny-by-default with prefixed ACLs per team namespace applied by automation from Git requests that the topic owner approves. Encrypt every listener with TLS, use encrypted volumes because Kafka has no encryption at rest, and add field-level encryption with KMS keys for payment and personal fields. Deliver secrets through a secret manager with rotation, prefer short-lived tokens, and ship authorizer logs to the security team with alerts on ACL changes and super-user use and periodic access reviews.

Why this question is asked

A shared Kafka platform with payment and personal data has two forces pulling against each other. Security wants every access justified, logged and reviewed. Forty teams want to ship features without waiting a week for a ticket. A model that ignores the first fails an audit; one that ignores the second gets bypassed, with shared accounts and copies of data in places nobody controls. Interviewers ask this to see whether we can design controls that are strong and fast at the same time. In this answer, we will set out the identity model, design authorization with self-service, cover encryption in transit, at rest and per field, handle secrets, and finish with auditing.

1Identity: One Principal per Service

Every rule we write later attaches to a principal, so identity comes first. Each of the 150 services gets its own principal, never shared between services and never a personal account. Sharing breaks everything downstream: ACLs become too broad, quotas mix unrelated traffic and audit logs cannot say which service did what.

Principals are issued by a central system, not invented by the Kafka team. If the company has a PKI or a service mesh that gives each workload a certificate, mutual TLS is a natural fit, and Kafka turns the certificate subject into a short principal with mapping rules. If the company has an OIDC provider, OAUTHBEARER lets services present short-lived tokens, and the principal comes from a token claim.

Properties
# broker: map certificate subjects to short principals
ssl.client.auth=required
ssl.principal.mapping.rules=RULE:^CN=([a-z0-9-]+),OU=services,O=Example$/$1/,DEFAULT
# CN=payments-api,OU=services,O=Example -> User:payments-api
# a certificate that matches no rule keeps its full subject as the principal

Either way, creating a service in the company's normal tooling gives it a Kafka identity, so the platform team never hands out credentials by hand.

2Authorization That Does Not Need the Platform Team

The cluster denies by default: allow.everyone.if.no.acl.found=false, and no wildcard grants for applications. Each team owns a namespace, a topic prefix such as payments., and its services get prefixed ACLs on it. So a team can create and use topics in its own namespace without anyone else's approval.

Access across teams goes through a self-service request. The consuming team opens a pull request in a Git repository that describes access, the owning team of the topic approves it, and automation applies the ACLs. The platform team designs and audits this process instead of approving each request, so it is not a bottleneck, and every grant has an approver and a history in Git.

Step throughSelf-service access request
  1. Team opens a pull requestprincipal, topic, operations, purpose
  2. Checks runnaming, no wildcards, principal exists
  3. Topic is sensitive?
    YesData owner approves, expiry requiredNoTopic owner approves
  4. Automation applies ACLsfrom Git, never by hand
  5. Grant logged and reviewedperiodic access review

5 steps in order. Play them, or step through them one at a time.

The platform team owns the process, not each decision.

For the sensitive topics, the request template asks for a purpose and an expiry, and approval by the data owner is mandatory. That small extra step is where the security team's requirements live, without slowing every other request.

3Encryption in Transit, at Rest and per Field

In transit, every listener uses TLS: applications, brokers among themselves and the KRaft controllers. No plaintext listener exists in production, so a misconfigured client cannot accidentally send data in clear text.

At rest, Kafka has no built-in encryption, so data sits on broker disks as written. We use encrypted volumes, such as cloud disk encryption with keys in the KMS, which protects against a lost disk or snapshot but not against anyone with access to the broker or to the topic. For payment and personal fields, we go further with field-level encryption in the producer: the sensitive fields are encrypted with a data key protected by the KMS before the record leaves the service, and only consumers allowed to use that key can read them. Everyone else, including the platform team and its tools, sees ciphertext.

What each layer protects against
LayerProtects againstDoes not protect against
TLS on every listenerNetwork sniffing, spoofed brokersAnyone with topic access
Encrypted volumesLost disks, leaked snapshotsBroker admins, topic readers
Field-level encryptionReaders without the key, adminsLeaks inside key holders
ACLs per principalServices reading what they should notA stolen service credential

4Secrets and Their Lifetime

Credentials, keystore passwords and private keys come from a secret manager and are injected at runtime, never baked into images or committed to Git. The secret manager rotates them on a schedule, and services pick up the new values without manual steps. Where the identity system supports it, short-lived credentials are better still: a certificate valid for a day or an OAuth token valid for an hour limits what a leaked credential is worth, and rotation stops being an event at all.

5Auditing and Review

The authorizer log records denials, and for sensitive topics we also log successful reads and writes so we can answer who accessed payment data. These logs go to the security team's log platform, where the platform team cannot alter them. Alerts fire on any ACL change made outside the automation, on use of a super-user principal, and on sudden denial spikes, which often mean a misconfigured service or someone probing.

Finally, access to sensitive topics is reviewed periodically, for example every quarter: each data owner confirms the list of principals that can read their topics, and grants that are not confirmed expire. Combined with expiry dates on requests, this keeps access from only ever growing.

6Follow-up questions

Why not just use one SASL account per team?

Because a team runs several services with different needs, and a shared account means each service gets the union of all rights, quotas apply to all of them together, and audit logs cannot tell them apart. One principal per service costs little when identities come from automation.

Does field-level encryption break stream processing?

It limits it: a stream processor without the key cannot filter or join on encrypted fields. So we encrypt only the truly sensitive fields, keep keys such as order ids in clear text, and give the few processors that need the data access to the key through the same approval process.

Who are the super users, and how are they controlled?

Only the brokers, controllers and the platform's automation principals. Humans use break-glass access that is time-limited, logged and alerted on, so super-user use is rare and always visible.

7Conclusion

In this answer, we designed a security model where every service has its own principal from the company PKI or OIDC provider, authorization denies by default with prefixed ACLs per team and self-service requests approved by topic owners, TLS covers every listener, encrypted volumes and field-level encryption with KMS keys protect stored data, a secret manager delivers and rotates credentials, and authorizer logs, change alerts and periodic reviews provide the audit trail.

What to say in the interviewAbout 80 seconds aloud

Open with

I would start with identity: one principal per service, never shared, issued by a central system. If we have a PKI or service mesh, that means mutual TLS with ssl.principal.mapping.rules turning the certificate subject into a short principal; if we have an OIDC provider, OAUTHBEARER with short-lived tokens.

Then, if they want more

Authorization is deny by default, with no wildcard grants for applications. Each team owns a topic prefix and gets prefixed ACLs on it, and cross-team access is a pull request in Git that the topic owner approves and automation applies, so the platform team owns the process rather than each request.

Sensitive topics need data-owner approval, a purpose and an expiry. For encryption, TLS on every listener including inter-broker and controller traffic. Kafka has no built-in encryption at rest, so encrypted volumes with KMS keys, and for payment or personal fields, field-level encryption in the producer with keys in the KMS, so only approved consumers can read them.

Secrets come from a secret manager with rotation, never in images or Git, and short-lived credentials where possible. For audit, authorizer logs go to the security team's platform, with alerts on ACL changes outside automation and on super-user use, and quarterly access reviews where unconfirmed grants on sensitive topics expire.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Apache Kafka documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Design the security model for a shared Kafka platform used by 150 services owned by 40...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-operations/1abfcc811d/