#491 Prompt CLI user on certificate warnings.
Closed: Fixed None Opened 11 years ago by edewata.

Currently the CLI will warn the user the following certificate validation errors:

  • UNTRUSTED ISSUER
  • BAD_CERT_DOMAIN

The CLI does not reject them outright because under certain circumstances the errors are acceptable to the user, for example on a temporary certificate and in the use of short hostname.

Ideally the CLI should show the warning/error messages and prompt the user whether to continue with the operation, just like Firefox.

CAVEAT:  There is a well-founded dissenting opinion that some
         of these certificate validation errors should always
         be disallowed since CS is a security product
         (i. e. - not a browser).

         This implies that this issue should be thoroughly
         discussed prior to any final decision/code changes.

If it is decided that the appropriate implementation would be to fail on "BAD_CERT_DOMAIN", at the very least, we should not only put out an "ERROR" message (rather than a "WARNING"), but also provide descriptive text to the end user on why it failed and how this failure can be corrected (i. e. - utilize the FQDN of the hostname rather than just the short form of the hostname).

pkispawn relies on the client library to configure the newly created instance. Since the instance at this point only has a temporary certificate, certain errors such as UNTRUSTED_ISSUER and CA_CERT_INVALID must be ignored by the client library.

It's possible to modify the client library to ignore a specific list of errors for installation only, but in general we should avoid hardcoding any variable/logic in the client library because once installed on the user's machine it's harder to control it.

A more generic solution would be to add a parameter to specify the list of errors to be ignored:

pki --ignore-errors UNTRUSTED_ISSUER,CA_CERT_INVALID <command>

This way the pkispawn can specify the list of errors to be ignored, while the parameter is still generic enough for users who need to use it.

Reference TRAC Ticket #488 - Dogtag 10: Fix cli 'cert-find' clientAuth issue changes which yield the following behaviors:

script -c "pkispawn -s CA -f /tmp/pki/cs.cfg -vvv"

    successfully installed and configured with no ERRORs/WARNINGs, enrolled for a certificate, and approved a certificate

pki -h foobar -P https -p 8443 cert-find
WARNING: BAD_CERT_DOMAIN encountered on 'CN=foobar.example.com,O=example.com Security Domain' indicates a common-name mismatch
WARNING: UNTRUSTED ISSUER encountered on 'CN=foobar.example.com,O=example.com Security Domain' indicates a non-trusted CA cert
------------------------
7 certificate(s) matched
------------------------
  Serial Number: 0x1
  Subject DN: CN=CA Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x2
  Subject DN: CN=CA OCSP Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x3
  Subject DN: CN=foobar.example.com,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x4
  Subject DN: CN=CA Subsystem Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x5
  Subject DN: CN=CA Audit Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x6
  Subject DN: CN=PKI Administrator,E=caadmin@example.com,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x7
  Subject DN: UID=test
  Status: VALID
----------------------------
Number of entries returned 7
----------------------------
pki -h foobar.example.com -P https -p 8443 cert-find
WARNING: UNTRUSTED ISSUER encountered on 'CN=foobar.example.com,O=example.com Security Domain' indicates a non-trusted CA cert
------------------------
7 certificate(s) matched
------------------------
  Serial Number: 0x1
  Subject DN: CN=CA Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x2
  Subject DN: CN=CA OCSP Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x3
  Subject DN: CN=foobar.example.com,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x4
  Subject DN: CN=CA Subsystem Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x5
  Subject DN: CN=CA Audit Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x6
  Subject DN: CN=PKI Administrator,E=caadmin@example.com,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x7
  Subject DN: UID=test
  Status: VALID
----------------------------
Number of entries returned 7
----------------------------
pki -h foobar -P https -p 8443 -n "PKI Administrator for example.com" -w XXXXXXXX -d . cert-find
WARNING: BAD_CERT_DOMAIN encountered on 'CN=foobar.example.com,O=example.com Security Domain' indicates a common-name mismatch
WARNING: BAD_CERT_DOMAIN encountered on 'CN=foobar.example.com,O=example.com Security Domain' indicates a common-name mismatch
------------------------
7 certificate(s) matched
------------------------
  Serial Number: 0x1
  Subject DN: CN=CA Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x2
  Subject DN: CN=CA OCSP Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x3
  Subject DN: CN=foobar.example.com,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x4
  Subject DN: CN=CA Subsystem Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x5
  Subject DN: CN=CA Audit Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x6
  Subject DN: CN=PKI Administrator,E=caadmin@example.com,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x7
  Subject DN: UID=test
  Status: VALID
----------------------------
Number of entries returned 7
----------------------------
pki -h foobar.example.com -P https -p 8443 -n "PKI Administrator for example.com" -w XXXXXXXX -d . cert-find
------------------------
7 certificate(s) matched
------------------------
  Serial Number: 0x1
  Subject DN: CN=CA Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x2
  Subject DN: CN=CA OCSP Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x3
  Subject DN: CN=foobar.example.com,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x4
  Subject DN: CN=CA Subsystem Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x5
  Subject DN: CN=CA Audit Signing Certificate,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x6
  Subject DN: CN=PKI Administrator,E=caadmin@example.com,O=example.com Security Domain
  Status: VALID

  Serial Number: 0x7
  Subject DN: UID=test
  Status: VALID
----------------------------
Number of entries returned 7
----------------------------

Per meeting in Mountain View, we will:

  1. Provide option in CLI to import CA cert chain in CLI's security database.
  2. Provide option to do this on the fly the first time the warning is encountered for UNTRUSTED_ISSUER.
  3. Add policy configuration in pki.conf to prevent accepting UNTRUSTED_ISSUER. Defaults to allow.
  4. BAD_CERT_DOMAIN will continue to warn if you use the short name rather than FQDN. Policy to be added to pki.conf to disallow. Default to allow.
  5. We will keep installation mode for installs.

master:

  • 7ea5dc61f082c7372924271fd2a44dfb5345b256
  • f3e75c44eacc3f861497a288b2713a26953fb39f

master:

  • 7a89bc5ac029066e4ec6d35d1cc953f046a9d36f
  • f4fe2c94958ccd0d312ea5232531385ec51fd320

master:

  • 139e45a55ecc9af28b0f5c2e56c400c9171d147f
  • 4fc145d2144d94e67188509d1b284e4c5eb95905
  • bc03ee6c31e5390e76d2f92d00931d19a71eea7b
  • 4d22a2caaeb77a78e2e962efa60e30772b1227be
  • e7a9add502681e13fde159e6f3a026af249e92f9

Metadata Update from @edewata:
- Issue assigned to edewata
- Issue set to the milestone: 10.0.2

7 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/1062

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Login to comment on this ticket.

Metadata