SilleBille / pki

Dogtag PKI Issues should be reported to the Dogtag PKI Pagure Issues site
https://pagure.io/dogtagpki/issues
GNU General Public License v2.0
1 stars 1 forks source link

agent cert not from local CA, LDAP error 32, but can issue cert while revoke fails PKIException: Record not found and HTTP 500 error #500

Closed SilleBille closed 4 years ago

SilleBille commented 4 years ago

This issue was migrated from Pagure Issue #3101.Originally filed by msauton on 2019-05-14

This is a "corner case", was not designed for this use case, but there is a need for more validity check on agent's LDAP certificate record during authorization for various operations, example with inconsistent issuance and revocation:

Scenario:

note the LDAP error 32 / no such object during authorization, on the entry cn=1026,ou=certificateRepository,ou=ca,o=rootca1-CA and the continuing issuance process.

details, see attachment "test1"

the error message "PKIException: Record not found" is confusing because it does not apply to the certificate I tried to revoke, it seem to apply to the agent cert LDAP record, cn=1026,ou=certificateRepository,ou=ca,o=rootca1-CA , that do not exist on "rootca1" in this scenario,

pki -U https://ca1.example.test:7443/ca -d ${nssdir} -C ${nssdir}/pwdfile.txt -n subca1useragent1 ca-cert-hold 0xc Placing certificate on-hold: Serial Number: 0xc Subject DN: UID=rootca1user1 Issuer DN: CN=CA Signing Certificate,OU=rootca1,O=Root CA Example Corp 7 Status: VALID Not Valid Before: Sun Apr 28 18:39:26 UTC 2019 Not Valid After: Fri Oct 25 18:39:26 UTC 2019 Are you sure (Y/N)? y PKIException: Record not found

==> /var/log/pki/rootca1/localhost_access_log.2019-04-28.txt <== 192.168.122.66 - subca1agentuser1 [28/Apr/2019:18:52:41 +0000] "GET /ca/rest/account/login HTTP/1.1" 200 203 192.168.122.66 - subca1agentuser1 [28/Apr/2019:18:52:41 +0000] "GET /ca/rest/agent/certs/12 HTTP/1.1" 200 9450 192.168.122.66 - subca1agentuser1 [28/Apr/2019:18:52:45 +0000] "POST /ca/rest/agent/certs/12/revoke HTTP/1.1" 500 209

details, see attachment "test2"

SilleBille commented 4 years ago

Posted by msauton on 2019-05-14:

test1 on rootca1 - agent subca1agentuser1 successfully issue a user certificate

SilleBille commented 4 years ago

Posted by msauton on 2019-05-14:

test2 on rootca1 - the same agent subca1agentuser1 fails to revoke the user certificate that was just issued

SilleBille commented 4 years ago

Posted by msauton on 2019-05-14:

bz 1710094 - agent cert not from local CA, LDAP error 32, but can issue cert while revoke fails PKIException: Record not found and HTTP 500 error https://bugzilla.redhat.com/show_bug.cgi?id=1710094