Skip to content

binder: Introduce server pre-authorization #12127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 81 commits into from
Jul 10, 2025
Merged

Conversation

jdcormie
Copy link
Member

@jdcormie jdcormie commented Jun 3, 2025

grpc-binder clients authorize servers by checking the UID of the sender of the SETUP_TRANSPORT Binder transaction against some SecurityPolicy. But merely binding to an unauthorized server to learn its UID can enable "keep-alive" and "background activity launch" abuse, even if security policy ultimately causes the grpc connection to fail. Pre-authorization mitigates this kind of abuse by resolving addresses and authorizing a candidate server Application's UID before binding to it. Pre-auth is especially important when the server's address is not fixed in advance but discovered by PackageManager lookup.

Design at: go/grpc-binder-service-discovery "Mitigating Keep-Alive Attacks"

Note internal LGTM at CR/769886275.

ejona86 and others added 20 commits June 26, 2025 18:33
This should often not matter much, but in b/412468630 it was cleary
visible that child creation order can skew load for the first batch of
RPCs. This doesn't solve all the cases, as further-away backends will
still be less likely chosen initially and it is ignorant of the LB
policy. But this doesn't impact correctness, is easy, and is one fewer
cases to worry about.
ClusterResolverLb gets the NameResolverRegistry from
LoadBalancer.Helper, so a new API was added in NameResover.Args to
propagate the same object to the name resolver tree.

RetryingNameResolver was exposed to xds. This is expected to be
temporary, as the retrying is being removed from ManagedChannelImpl and
moved into the resolvers. At that point, DnsNameResolverProvider would
wrap DnsNameResolver with a similar API to RetryingNameResolver and xds
would no longer be responsible.
…mination (grpc#12167)

# Conflicts:
#	binder/src/androidTest/java/io/grpc/binder/internal/BinderClientTransportTest.java
#	binder/src/main/java/io/grpc/binder/internal/BinderTransport.java
#	binder/src/testFixtures/java/io/grpc/binder/internal/SettableAsyncSecurityPolicy.java
ClusterResolverLb is still doing DNS itself, so disable it in XdsDepMan
until that migration has finished. EDS is fine in XdsDepman, because
XdsClient will share the result with ClusterResolverLb.
The previous code did a ping-pong to make sure the transport had enough
time to process, but then proceeded to sleep 5 seconds. That sleep would
have been needed without the ping-pong, but with the ping-pong we are
confident all events have been drained from the transport. Deleting the
unnecessary sleeps saves 10 seconds, for each of the 9 instances of this
test.
…dentity before binding.

# Conflicts:
#	binder/src/androidTest/java/io/grpc/binder/internal/BinderClientTransportTest.java
#	binder/src/main/java/io/grpc/binder/internal/BinderTransport.java
#	binder/src/test/java/io/grpc/binder/RobolectricBinderSecurityTest.java
Parameterize RobolectricBinderSecurityTest
Resolve with an explicit direct boot awareness flag

# Conflicts:
#	binder/src/main/java/io/grpc/binder/internal/BinderTransport.java
@jdcormie jdcormie requested a review from ejona86 June 28, 2025 02:46
@jdcormie jdcormie marked this pull request as ready for review June 28, 2025 02:46
@jdcormie
Copy link
Member Author

jdcormie commented Jul 9, 2025

@ejona86 Friendly 1 week ping

@jdcormie jdcormie merged commit 94532a6 into grpc:master Jul 10, 2025
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants