Repository navigation
Add cert hostname console UI behind feature flag - #3300
anomaly2104 wants to merge 1 commit into
Conversation
a21b9fd to
ab0161f
Compare
ab0161f to
47c98ce
Compare
ptkach
left a comment
There was a problem hiding this comment.
Has it been deployed to alpha yet to see how it looks?
@ptkach made 7 comments.
Reviewable status: 0 of 13 files reviewed, 6 unresolved discussions (waiting on anomaly2104 and CydeWeys).
console-webapp/src/app/settings/security/security.component.html line 126 at r2 (raw file):
<h2>Allowed EPP Client Certificate Hostnames</h2> </mat-list-item> <mat-list-item role="listitem">
is it missing lines parameter?
console-webapp/src/app/settings/security/security.component.spec.ts line 274 at r2 (raw file):
}); it('should omit hidden hostname and revoked hash fields when flag is inactive', async () => {
gemini identified that this and "userdata undefined" tests are nearly identical and add 100 lines of code. Can you please refactor?
Code quote:
flag is inactiveconsole-webapp/src/app/settings/security/security.component.spec.ts line 280 at r2 (raw file):
>; const originalRegistrar = registrarSignal(); try {
here and at all of the bottom tests there's a lot of boilerplate try {registrarSignal.set()} catch {}. Can you refactor and just create a fresh registrarSignal in beforeEach similar to what you did to userDataSignal
console-webapp/src/app/settings/security/securityEdit.component.html line 74 at r2 (raw file):
Allow EPP logins with a certificate issued by a publicly trusted CA whose Subject Alternative Name (SAN) dNSName matches one of these exact hostnames (no wildcards; Subject CN is ignored; up to 20 entries). Once
how is it enforced on ui?
Code quote:
up to 20 entriesconsole-webapp/src/app/settings/security/securityEdit.component.html line 79 at r2 (raw file):
@for ( hostname of dataSource().allowedEppClientCertificateHostnames; track hostname ) { <div class="settings-security__edit-ip">
it looks like it reuses a class name from. a difference css block - edit_ip? Can you either extract shared styling or create a separate block?
console-webapp/src/app/settings/security/securityEdit.component.ts line 90 at r2 (raw file):
const payload: SecuritySettings = { ...this.dataSource() }; if (!this.securityService.allowEppClientCertHostnameAuth()) { delete payload.allowedEppClientCertificateHostnames;
I'm curious why this is in UI component and not in a service? Seems like something service should be doing
CydeWeys
left a comment
There was a problem hiding this comment.
The backend, schema, and wire-contract pieces look clean overall, and the core feature-flag wiring and partial-update preservation behavior match SecurityAction. Requesting changes for a few blocking frontend issues (the unloaded-registrar() save hazard and moving flag-off omission to the service boundary), @ptkach's open cleanup items, and b/573176420 tracking:
- b/573176420 partial implementation & PR description: b/573176420 also calls for
eppClientCertAuth.allowFingerprintAuthin config plus aRegistryConfigaccessor, which isn't inmasteror this PR yet. Please note in the PR/commit description that b/573176420 is only partially implemented here so it isn't closed on merge. While updating the description, consider opening with 1-2 sentences on why this change is needed (shorter certificate lifetimes motivating hostname-based auth, and feature-flagging the UI so it can land safely ahead of EPP login enablement) and noting the new/console-api/userdatafield anddb-schema.sql.generatedupdate. +1to @ptkach's open cleanup items: unifyingIpAllowListItem/StringListItem, sharing list conversion helpers (with.trim()applied consistently), collapsing the 8 add/remove methods to 2, replacing the reusedsettings-security__edit-ipclass name, dropping thenull as unknown astest if strict-impossible null guards are removed, and verifying the rendered UI visually on alpha.- Adjacent UX / reactivity items outside this diff (fine here or in an immediate follow-up):
securityEdit.component.htmlcurrently has no Back/Cancel button callinggoBack()(unlikerdapEdit.component.html,eppPasswordEdit.component.html, andcontactDetails.component.html). Adding one prevents users from getting stuck in edit mode if they clear their last configured hostname and hit the HTTP 400 error.- Pre-existing in
security.component.ts(lines 44-52): theeffect()tracksregistrarService.registrar()instead ofregistrarService.registrarId(), so a backgroundregistrarsreload emits a new object reference and kicks the user out of edit mode, discarding unsaved edits (seerdap.component.tsfor theregistrarId()pattern).
| "technicalDocsUrl", technicalDocsUrl)); | ||
| "technicalDocsUrl", technicalDocsUrl, | ||
| // Gates Console UI visibility for EPP client certificate hostname management | ||
| // (SecurityAction writes remain open; EPP login authentication checks this flag |
There was a problem hiding this comment.
Design question: since SecurityAction forbids clearing allowedEppClientCertificateHostnames once non-empty and there is currently no nomulus CLI flag to edit or clear hostnames/revoked hashes, a user with EDIT_REGISTRAR_DETAILS can POST /console-api/settings/security directly while ALLOW_EPP_CLIENT_CERT_HOSTNAME_AUTH is INACTIVE and lock into a non-empty hostname state that is hidden in the Console UI. Can you confirm whether keeping SecurityAction writes ungated (e.g., for dark-launch pre-configuration) is intentional, versus rejecting writes to allowedEppClientCertificateHostnames while the flag is INACTIVE?
There was a problem hiding this comment.
Adding a concrete kill-switch risk here: because UserDataService caches allowEppClientCertHostnameAuth: true for the entire browser tab lifetime without refresh and SecurityAction performs no server-side flag check, flipping ALLOW_EPP_CLIENT_CERT_HOSTNAME_AUTH back from ACTIVE to INACTIVE does not stop open browser tabs or direct API callers from continuing to write both fields indefinitely — reinforcing the need to evaluate server-side gating on SecurityAction writes.
There was a problem hiding this comment.
Keeping SecurityAction writes ungated is intentional. EPP login validation will check ALLOW_EPP_CLIENT_CERT_HOSTNAME_AUTH independently, so even if someone sets hostnames via an open tab or direct API call while the flag is INACTIVE, they won't be used during EPP login.
| * the Registrar Console UI for managing allowed certificate hostnames and revoked certificate | ||
| * hashes. | ||
| */ | ||
| ALLOW_EPP_CLIENT_CERT_HOSTNAME_AUTH(FeatureStatus.INACTIVE); |
There was a problem hiding this comment.
Design question: this single flag gates Console UI visibility for both allowed hostnames and revokedClientCertificateHashes, even though Registrar enforces revocations against pinned certificates too. If we ever roll this flag back to INACTIVE as an emergency kill-switch, registrars/admins lose Console access to manage revoked certificate hashes with no CLI fallback. Confirming that coupling is acceptable for launch?
There was a problem hiding this comment.
Yes, keeping them under the same flag is intentional. Revocation hashes are needed for hostname-based auth; for fingerprint-based auth, registrars pin the actual certificate itself, so revoking via hash doesn't really make sense there (removing/replacing the cert already revokes it).
CydeWeys
left a comment
There was a problem hiding this comment.
Follow-up security pass surfaced 3 additional security issues in this PR (1 high, 2 medium) and 2 minor UX/error-handling notes (4 inline below; the non-diff error-handling note and pre-existing backend items are listed here):
Minor error-handling note (outside diff hunk)
console-webapp/src/app/settings/security/securityEdit.component.ts:99-100:this._snackBar.open(err.error || err.message)renders[object ProgressEvent]on network errors. Considertypeof err.error === 'string' && err.error ? err.error : err.message.
Pre-existing surrounding backend items worth tracking as follow-ups (out of scope for this PR)
SecurityAction.java:175-176: passesImmutableSet.of()forcontactstosendExternalUpdatesIfNecessary(unlikeRdapRegistrarFieldsAction.java:115-120), so registrarADMINPOCs receive no email alerts when allowed certificate hostnames or revoked hashes are modified or un-revoked.SecurityAction.java:82-88: loadssavedRegistraroutsidetm().transact(...)without optimistic concurrency control (lastUpdateTime/version check), creating a backend TOCTOU lost-update window on concurrent saves.Registrar.java:901-947: runs ICU4J IDNA /base64().omitPadding().decode()on every input element before checking<= 20(and without pre-checkinghash.length() == 43) insidetm().transact(...), and currently accepts the empty-input SHA-256 constant47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU.
47c98ce to
9d3cd5c
Compare
|
All addressed:
|
Fixed the ProgressEvent snackbar fallback (typeof err.error === 'string' && err.error ? err.error : err.message). Hadn't touched it earlier since it was pre-existing, but updated it now along with a test. Thanks for flagging the pre-existing backend items too; I'll keep those out of this PR as suggested. |
CydeWeys
left a comment
There was a problem hiding this comment.
Thanks for the thorough updates! The code, security fixes, reactivity updates, and tests in 9d3cd5c10c all look clean and address every comment from the previous round.
One minor public-repo hygiene request before approving: could you please remove the two internal screencast links from the PR description and your earlier comment (and attach them to b/573176719 instead) so internal hostnames aren't left on this public GitHub PR? (Good that they aren't in the commit message.)
ptkach
left a comment
There was a problem hiding this comment.
@ptkach reviewed 15 files and all commit messages, and resolved 1 discussion.
Reviewable status: all files reviewed, 21 unresolved discussions (waiting on anomaly2104 and CydeWeys).
Shorter public TLS certificate lifetimes make manual fingerprint pinning harder for registrars to maintain, so EPP login is moving to hostname-based certificate authentication. Gate the new Registrar Console Security settings UI behind a feature flag so it can land safely ahead of EPP login enablement. - Add ALLOW_EPP_CLIENT_CERT_HOSTNAME_AUTH to FeatureFlag (and update db-schema.sql.generated) and expose allowEppClientCertHostnameAuth in /console-api/userdata, failing closed to false on lookup errors. - Show and edit Allowed EPP Client Certificate Hostnames and Revoked Client Certificate Hashes in Console Security settings when enabled (up to 20 entries each, with Back button and fail-fast openssl hash command), unifying StringListItem and list add/remove/conversion helpers across IP allowlist and certificate lists. - Guard saves against unloaded registrar state, omit hidden cert fields in SecurityService.saveChanges() when the flag is inactive, and omit unchanged cert fields on save to avoid stale-tab overwrites. Partially implements b/573176420 (eppClientCertAuth.allowFingerprintAuth config and RegistryConfig accessor will follow in a separate PR). BUG=b/573176719
Done |
9d3cd5c to
5af8ca1
Compare
Shorter public TLS certificate lifetimes make manual fingerprint pinning
harder for registrars to maintain, so EPP login is moving to
hostname-based certificate authentication. Gate the new Registrar
Console Security settings UI behind a feature flag so it can land safely
ahead of EPP login enablement.
ALLOW_EPP_CLIENT_CERT_HOSTNAME_AUTHtoFeatureFlag(and updatedb-schema.sql.generated) and exposeallowEppClientCertHostnameAuthin/console-api/userdata, failing closed tofalseon lookup errors.Client Certificate Hashes in Console Security settings when enabled
(up to 20 entries each, with Back button and fail-fast
opensslhashcommand), unifying
StringListItemand list add/remove/conversionhelpers across IP allowlist and certificate lists.
in
SecurityService.saveChanges()when the flag is inactive, and omitunchanged cert fields on save to avoid stale-tab overwrites.
Partially implements b/573176420 (
eppClientCertAuth.allowFingerprintAuthconfig and
RegistryConfigaccessor will follow in a separate PR).BUG=b/573176719
This change is