Skip to content

Can an MSK cluster owner reject a multi-VPC private connectivity (client VPC) connection created from another account?

0

Hi, we use Amazon MSK multi-VPC private connectivity with IAM authentication. The MSK cluster is in account A. The client in account B (a different AWS Organization) creates a managed VPC connection to the cluster with CreateVpcConnection, authorized by the cluster policy.

As the cluster owner (account A), we want to cut off account B's connection at the network level.

What we observed:

  • aws kafka reject-client-vpc-connection run from account A, with AdministratorAccess, against account B's VPC connection returns AccessDeniedException: "...no resource-based policy allows the kafka:RejectClientVpcConnection action".
  • Adding kafka:RejectClientVpcConnection to the cluster policy is refused: the policy update fails because the action name is invalid for a cluster policy. so the questions then are
  1. Is RejectClientVpcConnection meant to be usable by the cluster owner on a connection created in another account? If so, what resource policy or permission is needed, and on which resource?
  2. If not, is the documented way for the cluster owner to cut off a cross-account client to remove that account from the cluster policy (which we understand only stops new connections), or to turn multi-VPC connectivity off on the cluster?
  3. Does removing the client account from the cluster policy affect connections that are already established?

Any help greatly appreciated Thanks Emmet

Update: tried all three ways. The CLI (2.27.50, also with --debug), boto3/botocore 1.43.112 and the MSK console all fail identically.

Each was run as an AdministratorAccess role in the cluster owner's account, on a client VPC connection in state AVAILABLE:

User: arn:aws:sts::<cluster-owner-account>:assumed-role/<admin-role>/… is not authorized to perform: kafka:RejectClientVpcConnection on resource: arn:aws:kafka:us-east-1:<client-account>:vpc-connection/<cluster-owner-account>/<cluster-name>/<id> because no resource-based policy allows the kafka:RejectClientVpcConnection action

API request ID: cae160fd-d19d-4c17-9aa9-6138dc4733ac. No SCP or RCP is involved; the message names a missing resource-based policy, not an explicit deny.

The VPC connection resource is in the client's account, so the call is evaluated cross-account, and the cluster policy won't accept kafka:RejectClientVpcConnection as an action.

Is there a supported way for the cluster owner to reject a cross-account client VPC connection? If not, the developer guide page (https://docs.aws.amazon.com/msk/latest/developerguide/mvpc-cross-account-reject-connection.html) should say rejection doesn't work across accounts.

Thanks Emmet

1 Answer
0

Hi Emmet,

1. Can the cluster owner use RejectClientVpcConnection on a connection created in another account?

The cluster admin account can reject a client VPC connection in the AVAILABLE state, from the console or with the RejectClientVpcConnection API (Reject a managed VPC connection). The cluster policy example lists only CreateVpcConnection, GetBootstrapBrokers, DescribeCluster, DescribeClusterV2, and kafka-cluster:* as actions (Attach a cluster policy). I couldn't find a resource-based policy or permission that makes the cross-account call succeed, so the behavior you're seeing is at odds with the description. I'd recommend opening an AWS Support case, attaching the API request ID you posted.

2. How can the cluster owner cut off a cross-account client?

  • To prevent new managed VPC connections from a client, deny that client in the cluster policy (Reject a managed VPC connection).
  • Because the cluster owner doesn't own the connection, the connection can only be deleted from the client account (Delete a managed VPC connection).
  • Turning off multi-VPC private connectivity for an auth scheme (via the console or the UpdateConnectivity API) removes the PrivateLink infrastructure on the cluster side (including the managed VPC connections), and existing VPC connections on the client side change to INACTIVE (Update the authorization schemes on a cluster). Note that this affects not just the client you want to cut off, but all clients using that auth scheme. It also triggers a rolling reboot of the brokers, which can take 30 minutes or more (Turn on multi-VPC connectivity).

3. Does removing a client account from the cluster policy affect already-established connections?

Denying a client in the cluster policy only prevents new connections. To terminate existing connections, turn off multi-VPC connectivity (see #2). I'd include this question in the Support case as well.

AWS

answered a month ago

EXPERT

reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.