You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "smengcl (via GitHub)" <gi...@apache.org> on 2026/10/15 01:50:26 UTC

[PR] HDDS-17030. DefaultApprover.inspectCSR never completes its future when the CSR passes inspection [ozone]

smengcl opened a new pull request, #11544:
URL: https://github.com/apache/ozone/pull/11544

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   `CertificateApprover.inspectCSR` returns a future that should hold Void for a valid CSR and an exception otherwise. `DefaultApprover.inspectCSR` only ever completed it exceptionally, so for a CSR that passed inspection the future stayed incomplete, and `DefaultCAServer.requestCertificate` read "incomplete" as approved. A failed check also did not stop the inspection: the remaining checks still ran on that CSR.
   
   This PR:
   * completes the future with `null` once every check passes
   * returns right after the first failed check
   * makes `DefaultCAServer.requestCertificate` reject a CSR whose inspection has not completed, instead of signing it
   
   `DefaultApprover` is the only `CertificateApprover` and its inspection is synchronous, so certificate issuance behaves as before for valid and invalid CSRs. The first failure is reported exactly as before; only the error logs of the checks that used to run after it are gone.
   
   Follow up from the review of #11486.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17030
   
   ## How was this patch tested?
   
   * New `TestDefaultProfile.testInspectCsrCompletesWhenApproved`, `TestDefaultProfile.testInspectCsrStopsAtFirstFailure` and `TestDefaultCAServer.testRequestCertificateRejectsUnfinishedInspection`. All three fail without the change in `src/main`.
   * `TestDefaultCAServer`, `TestDefaultProfile` and `TestRootCARotationManager` pass, and checkstyle and PMD are clean on `hdds-server-framework`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-17030. DefaultApprover.inspectCSR never completes its future when the CSR passes inspection [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on PR #11544:
URL: https://github.com/apache/ozone/pull/11544#issuecomment-6221502626

   ## Reviewer notes (plain language)
   
   ### Simple examples
   
   **Good CSR (valid key, profile OK)**  
   - Before: every check passed, but the inspection future never completed with success — it stayed *incomplete*. The CA server only looked for *failure*, so “not failed” → sign anyway.  
   - After: future completes with `null` (= approved) → sign. **Same outcome for operators**, correct API behavior.
   
   **Bad CSR (e.g. signature does not match key)**  
   - Before: first check fails → future completes exceptionally → no cert. Later checks still ran (extra logs).  
   - After: fail fast on first error → no cert. **Same denial**, less noise.
   
   **Broken / unfinished inspection (e.g. future never completes)**  
   - Before: incomplete future → treated like approval path → **could sign without a finished inspection** (latent bug; mocked in `testRequestCertificateRejectsUnfinishedInspection`).  
   - After: `!isDone()` → reject with “CSR inspection did not complete.” **Fail closed.**
   
   Analogy: bouncer must say “OK” or “no”; the clerk used to stamp if they didn’t hear “no.” Now they require an explicit “OK” (completed success) or reject incomplete/failed inspection.
   
   ### Bottom line
   
   **This is not a security risk on today’s production path** with the synchronous `DefaultApprover`: invalid CSRs already failed exceptionally before signing; valid CSRs were already being signed. The patch fixes **contract correctness**, **fail-fast on inspection**, and **defense in depth** so incomplete inspection is never treated as approval (relevant for follow-up from #11486 and any future async approver). No config or expected behavior change for normal cert enrollment after upgrade.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-17030. DefaultApprover.inspectCSR never completes its future when the CSR passes inspection [ozone]

Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on PR #11544:
URL: https://github.com/apache/ozone/pull/11544#issuecomment-6226940356

   Thanks @jojochuang for the review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-17030. DefaultApprover.inspectCSR never completes its future when the CSR passes inspection [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on PR #11544:
URL: https://github.com/apache/ozone/pull/11544#issuecomment-6226916411

   Merged. Thanks @smengcl 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-17030. DefaultApprover.inspectCSR never completes its future when the CSR passes inspection [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang merged PR #11544:
URL: https://github.com/apache/ozone/pull/11544


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org