-
Notifications
You must be signed in to change notification settings - Fork 40
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
silo admin cannot manage TLS certificates (but is supposed to be able to) #4532
Comments
Yep, definitely - #4100 is indeed the PR where the call to
We can't change external DNS zone names today, but if we could, what authz resource do you think that would fall under? |
To my earlier comment I think we could model it in two different ways:
I lean towards the second because I think it better reflects what we're trying to achieve. We don't really want to grant this person privileges to read part of the DNS config (although it'd be fine if we did do that). We just want Nexus to be able to validate the certificate. |
The additional cert validation added in #4100 broke the ability for silo admins to upload new certs, because it introduced a call to fetch the rack DNS configuration (in order to assemble the FQDNs for the silo to check that the cert is valid for them). This PR fixes that by using an elevated internal privilege for that DNS config lookup. Fixes #4532.
The additional cert validation added in #4100 broke the ability for silo admins to upload new certs, because it introduced a call to fetch the rack DNS configuration (in order to assemble the FQDNs for the silo to check that the cert is valid for them). This PR fixes that by using an elevated internal privilege for that DNS config lookup. Fixes #4532.
@augustuswm reported trying to update a rack's TLS certificates and getting an unepected 403. Details about the user:
He expected (correctly) that Silo Administrators are supposed to be able to modify TLS certificates. And indeed, the authz check for creating a certificate checks the
CreateChild
action on theSiloCertificateList
:omicron/nexus/db-queries/src/db/datastore/certificate.rs
Line 43 in e37f3d0
and the Oso policy file grants the corresponding permission to Silo admins:
omicron/nexus/db-queries/src/authz/omicron.polar
Lines 426 to 431 in e37f3d0
The failure was actually here:
It's a failure to
read
theDnsConfig
. I expect this is because before we call into the datastore to create the certificate (which is the authz check I linked above), we first validate it, which requires fetching the list of external DNS zones to figure out what the silo's external DNS names are going to be:omicron/nexus/src/app/certificate.rs
Lines 50 to 64 in e37f3d0
that goes into
silo_fq_dns_names()
, which indeed winds up here, checking the "read" privilege onDNS_CONFIG
:omicron/nexus/db-queries/src/db/datastore/dns.rs
Line 84 in e37f3d0
I suspect this was introduced among the recent changes to validate the TLS certificates better. @jgallagher does this sound plausible? It's hard because we don't have a lot of testing around minimum privileges -- see #1374 for more on that.
In terms of fixes: right now, we use one resource (
DnsConfig
) to cover all of the DNS data, including the list of external DNS zone names and all the DNS names in both internal and external DNS. While it seems reasonable to me to say that Silo Admins should be able to see the list of external DNS zone names (i.e., the DNS domains that have been delegated to the rack), it seems excessive to grant them permission to see all the DNS names in both internal and external DNS. So one option would be to split this authz resource into two parts, grant privileges on one of them to "Silo Admin", and use that when listing external DNS zones. That would solve this problem but doesn't feel particularly easy or clean.Another option is to use the pattern we use elsewhere, where Nexus assumes a privileged, internal-only identity to fetch this information on behalf of the authenticated user. We'd want to be careful to make sure that we're not exposing anything we shouldn't by doing this. (For example, if we decide the list of external DNS zone names is privileged information, we probably wouldn't want to let you discover it by trying to upload certificates for various possible names and seeing if they get rejected?) But my intuition is that a Silo Admin already needs to know the list of external DNS zone names in order to know what TLS certificates they need to provide (or what DNS names those certificates are valid for).
The text was updated successfully, but these errors were encountered: