Skip to content

Emphasize best practices for public certificates#612

Open
monfresh wants to merge 3 commits intomainfrom
cert-best-practices
Open

Emphasize best practices for public certificates#612
monfresh wants to merge 3 commits intomainfrom
cert-best-practices

Conversation

@monfresh
Copy link
Copy Markdown
Contributor

@monfresh monfresh commented May 8, 2026

After auditing our partners' public certs in production, I noticed that quite a few do not adhere to standard best practices. And just today, we had a partner who thought that the OpenSSL command in our OIDC Certificates
page was all they needed for their production config.

This PR aims to clarify those best practices by making the following improvements:

  • Remove the OpenSSL command snippet from the OIDC Certificates page since that
    page relates to the Login.gov cert, not the partner's cert
  • Add a blurb in the OIDC Certificates page that links to the instructions for
    generating the partner's public/private keypair
  • In the instructions for generating a public/private keypair, emphasize that for production configs, the cert should be signed by a Certificate Authority
  • Add a checklist item in the "Before Deployment" section for the three main best practices for public certificates

After auditing our partners' public certs in production, I noticed that quite a few do not adhere to standard best practices. And just today, we had a partner who thought that the OpenSSL command in our OIDC Certificates
page was all they needed for their production config.

This PR aims to clarify those best practices by making the following improvements:

- Remove the OpenSSL command snippet from the OIDC Certificates page since that
page relates to the Login.gov cert, not the partner's cert
- Add a blurb in the OIDC Certificates page that links to the instructions for
generating the partner's public/private keypair
- In the instructions for generating a public/private keypair, emphasize that for production configs, the cert should be signed by a Certificate Authority
- Add a checklist item in the "Before Deployment" section for the three main best practices for public certificates
@monfresh monfresh requested review from ajfarkas, mmagsa and nickttng May 8, 2026 17:18
Copy link
Copy Markdown
Contributor

@nickttng nickttng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it looks good to me.

If you chose to integrate your app using the OIDC private_key_jwt protocol, you will need to create a private key that will be used to sign your request to our token endpoint, and a corresponding public certificate that you will upload to your app in the Partner Portal. Login.gov will use your public certificate to verify the signature in your request.

More details on how to create this public/private keypair are available in the [Creating a public certificate](https://developers.login.gov/testing/#creating-a-public-certificate) section of our Testing documentation.
More details on how to create this public/private keypair are available in the [Creating a public certificate](/testing/#creating-a-public-certificate) section of our Testing documentation.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement

Comment thread _pages/testing.md
### Creating a public certificate

You can use the following OpenSSL command to generate a self-signed 2048-bit PEM-encoded public certificate for your testing/sandbox application (with a 1-year validity period). Self-signed certificates should be for testing/sandbox purposes only. We recommend using Certificate Authority (CA) issued certificates for your production integration.
You can use the following OpenSSL command to generate a self-signed 2048-bit PEM-encoded public certificate for your testing/sandbox application (with a 1-year validity period). Self-signed certificates should be for testing/sandbox purposes only. **For security reasons, we highly recommend using Certificate Authority (CA) issued certificates for your production integration.**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes sense to me

Comment thread _pages/production.md Outdated
Comment on lines +66 to +69
- A public certificate that adheres to these industry standard best practices:
- Expiration date of one year or less
- Positive serial number at least 16 characters in length
- Signed by a trusted Certificate Authority
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets away from being parallel in construction to the two previous "if" statements, and I'm worried that might be confusing or harder to read for someone going through this documentation, especially for the first time.

Do you want to say that this is more important for configurations using proofing even though we recommend it in general? Or do you want to say we recommend it and its importance is independent of the above paragraph about proofing?

If you want it to be independent, do you think it works better as listed first above both the "if...proofed" and "if this is a SAML..." sections?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I meant it to be right under the logo bullet. I will move it up higher.

Comment thread _pages/testing.md
### Creating a public certificate

You can use the following OpenSSL command to generate a self-signed 2048-bit PEM-encoded public certificate for your testing/sandbox application (with a 1-year validity period). Self-signed certificates should be for testing/sandbox purposes only. We recommend using Certificate Authority (CA) issued certificates for your production integration.
You can use the following OpenSSL command to generate a self-signed 2048-bit PEM-encoded public certificate for your testing/sandbox application (with a 1-year validity period). Self-signed certificates should be for testing/sandbox purposes only. **For security reasons, we highly recommend using Certificate Authority (CA) issued certificates for your production integration.**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that bolding (alone) will have little effect here. Is there some resource we can link to that could help with procuring a CA-issued certificate, especially in a government setting?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I have some high level steps but wasn't sure where to put them.

Comment thread _pages/production.md Outdated
- **If this is an integration requesting identity proofed attributes, you must include a Failure to Proof URL.** Users will be redirected to this URL if they fail to complete the identity verification process. This page should communicate your agency and/or departments alternate methods of accessing your application.

- A public certificate that adheres to these industry standard best practices:
- Expiration date of one year or less
Copy link
Copy Markdown
Contributor

@mmagsa mmagsa May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a reference for this best practice? NIST suggests Several years (depends on key size) or 1 to 2 years depending on use (https://csrc.nist.gov/pubs/sp/800/57/pt1/r5/final)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I could have sworn I saw some NIST guidance that was in the order of months. It was in some other context, not SP 800-57.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I read through that NIST doc, and for our purposes, we should be looking at the recommended cryptoperiod of the Private Signature Key, which is 1 to 3 years. The Public Signature-Verification Key that they allow to have a cryptoperiod of several years (depending on key size), is the public certificate that corresponds to the Private Signature Key in the partner's private/public keypair.

Therefore, if the private part of the pair cannot last more than 3 years, it means they have to generate a new pair after no more than 3 years, which will result in a new public certificate. By setting their public certificate expiration to no more than 3 years, it will remind them of when it's time to rotate their private key.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also says that the expiration should be based on several factors. See sections 5.3.1 and 5.3.2

Sensitivity refers to the lifespan of the information being protected (e.g.,
10 minutes, 10 days, or 10 years) and the potential consequences of a loss of protection for that
information (e.g., the disclosure of the information to unauthorized entities). In general, as the
sensitivity of the information or the criticality of the processes protected by cryptography increase,
the length of the associated cryptoperiods should decrease in order to limit the damage that might
result from each compromise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we might suggest 1 year or less for IdV apps, and 1 to 3 years for auth-only apps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to this. Thoughts?

Expiration date of 1 to 3 years depending on use and risk factors (see NIST 800-57 Part 1 Rev. 5). We recommend 1 year or less to be on the safe side.

@vrajmohan vrajmohan force-pushed the cert-best-practices branch from 1e3e019 to a80d7ef Compare May 8, 2026 19:03
@monfresh monfresh requested a review from mmagsa May 8, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants