Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local tls: add ca cert export and documentation + argo cert #1903

Merged
merged 7 commits into from
Dec 20, 2024

Conversation

deer-wmde
Copy link
Contributor

@deer-wmde deer-wmde commented Dec 12, 2024

https://phabricator.wikimedia.org/T378691

This adds a makefile target to easily export the local CA certiface that gets used to self-sign the locally used TLS certificates. This can get used to circumvent browser warnings.

  • also adds config to issue local argo a certificate

@deer-wmde
Copy link
Contributor Author

I'm super confused right now - I thought I was able to import the certificate into firefox yesterday but now it doesnt seem to work?!

@deer-wmde
Copy link
Contributor Author

for some reason the CA cert in the secret is not a CA cert but the same cert as the one in data.tls.crt - I have no idea if this changed now since yesterday somehow but I'm 99% sure I was able to import it into firefox, but I also have no idea what could've changed now.

@deer-wmde
Copy link
Contributor Author

I can only imagine I made a mistake yesterday. But I found a way to do this now https://cert-manager.io/docs/configuration/selfsigned/#bootstrapping-ca-issuers

This will require a chart update though.

@deer-wmde
Copy link
Contributor Author

adjusted this accordingly and the new chart PR is here: wbstack/charts#184

@deer-wmde deer-wmde requested a review from tarrow December 13, 2024 13:24
@deer-wmde
Copy link
Contributor Author

sorry, this should be it's own PR but now slipped in. I was curious how hard it would be to get argocd now locally a valid cert, and it required only very few changes, so I added it (requires one more chart change though to set the namespace wbstack/charts#185)

@deer-wmde deer-wmde changed the title local tls: add ca cert export and documentation local tls: add ca cert export and documentation + argo cert Dec 13, 2024
Copy link
Contributor

@tarrow tarrow left a comment

Choose a reason for hiding this comment

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

very pro

Since we [introduced](https://phabricator.wikimedia.org/T378691) using HTTPS for local ingresses, you will get a scary warning when accessing local web interfaces. This can be mitigated by trusting the local CA certificate that is getting used for self-signing. The easiest way to do this is to save the local CA certificate in a file by accessing the secret it lives in (`wikibase-local-tls`) and importing it in your browser settings. There is also the possibility to import it into the trust store of your operating system, for example via the tool [mkcert](https://github.com/FiloSottile/mkcert), but you should be aware of the possible consequences this could have for the security of your machine.

> [!TIP]
> Running `make local-ca` will save the certificate to the file `wikibase-local-tls.crt`. It is highly recommended to delete the file again after importing it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
> Running `make local-ca` will save the certificate to the file `wikibase-local-tls.crt`. It is highly recommended to delete the file again after importing it.
> Running `make local-ca` will save the certificate to the file `wikibase-local-tls.crt`.

If I understand correctly a certificate isn't something secret we need to protect. Deleting it would be convenient for not getting mixed up but it's not the tls.key which I think is what you want to keep secret

@tarrow tarrow merged commit 754a19d into main Dec 20, 2024
3 checks passed
@tarrow tarrow deleted the de/local-tls-crt branch December 20, 2024 12:54
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.

2 participants