Skip to content

feat: starttls #558

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

feat: starttls #558

wants to merge 14 commits into from

Conversation

JacobCoffee
Copy link
Member

Description

  • Enables optional (may) starttls for receiving (smptd)

Closes

@JacobCoffee JacobCoffee requested a review from ewdurbin as a code owner March 18, 2025 14:35
@JacobCoffee
Copy link
Member Author

JacobCoffee commented Apr 1, 2025

in e655530 pebble is running

vagrant@salt-master:~$ curl -k https://salt-master.vagrant.psf.io:14000/dir
{
   "keyChange": "https://salt-master.vagrant.psf.io:14000/rollover-account-key",
   "meta": {
      "externalAccountRequired": false,
      "termsOfService": "data:text/plain,Do%20what%20thou%20wilt"
   },
   "newAccount": "https://salt-master.vagrant.psf.io:14000/sign-me-up",
   "newNonce": "https://salt-master.vagrant.psf.io:14000/nonce-plz",
   "newOrder": "https://salt-master.vagrant.psf.io:14000/order-plz",
   "revokeCert": "https://salt-master.vagrant.psf.io:14000/revoke-cert"

but hitting:

2025-04-01 15:15:14,982:ERROR:certbot._internal.log:An unexpected error occurred:
2025-04-01 15:15:14,982:ERROR:certbot._internal.log:requests.exceptions.SSLError: HTTPSConnectionPool(host='salt-master.vagrant.psf.io', port=14000): Max retries exceeded with url: /dir (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)')))

tried with - server: https://salt-master.psf.io:14000/dir and - server: https://localhost:14000/dir and http counterparts

{% if salt["match.compound"](pillar["roles"]["salt-master"]["pattern"]) %}
# HTTP-validated domains
{% for domain in [
'pypa.io',
Copy link
Member

Choose a reason for hiding this comment

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

Lists like these are always a good sign that something should be in pillar rather than a state.

I'd suggest moving this list into a subkey of

Maybe acme_certs.

Something like:

tls:
  acme_certs:
    example.com:
      validation: http
      roles:
      - loadbalancer
      - example
      additional_sans:
      - www.example.com

This would also simplify the logic in your pillar extension to allow us to determine where certs are validated (once dns is supported) and distributed.

print(f"Processing ACME certificates for minion: {minion_id}")
all_acme_certs = _find_acme_certs()

# Check if this is a loadbalancer (gets all certs)
Copy link
Member

Choose a reason for hiding this comment

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

This is all a lot of work, when we could theoretically just assign certs explicitly to roles, see other comment.

for domain, domain_config in acme_certs.items():
cert_roles = domain_config.get("roles", [])
if any(role in minion_roles for role in cert_roles):
data["tls"]["acme_certs"][domain] = domain_config
Copy link
Member

Choose a reason for hiding this comment

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

i'd have thought that this would be populating the actual certificate data into pillar so the minion can use it.

@@ -61,3 +61,77 @@ tls:
svn.psf.io:
roles:
- hg

acme_certs:
bugs.python.org:
Copy link
Member

Choose a reason for hiding this comment

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

I don't see a reason to have a separate instance here just for bugs.python.org. The same cert can be used for the load balancer and the roundup box.

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.

Add support for starttls on roundup-tracker.org
2 participants