Skip to content

configure hosts for ActionDispatch::HostAuthorization middleware#471

Draft
evgeni wants to merge 1 commit intomasterfrom
host-header-check
Draft

configure hosts for ActionDispatch::HostAuthorization middleware#471
evgeni wants to merge 1 commit intomasterfrom
host-header-check

Conversation

@evgeni
Copy link
Copy Markdown
Member

@evgeni evgeni commented Apr 23, 2026

Why are you introducing these changes? (Problem description, related links)

moar secure

What are the changes introduced in this pull request?

configure hosts so that Rails can reject HTTP requests with invalid Host headrs

How to test this pull request

test in the patch

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

---
:foreman_url: {{ foreman_url }}

:hosts:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

needs cnames

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

which makes me wonder, right now the parameter is --certificate-cname, but in reality this is not about certificates (only) [and we already identified that "cname" is wtong]

so should the parameter be something like --alternative-server-name

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree with the over-all principle here in a parameter that is above but feeds into certificates. Since naming is fun, other ideas:

--server-alias (how Apache defines it)
--server-name-alias
--subject-alternative-name (from certificates but still tied to that concept)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I like --server-alias.

@evgeni evgeni force-pushed the host-header-check branch from 0445457 to 9cf9ade Compare April 23, 2026 13:22
@evgeni
Copy link
Copy Markdown
Member Author

evgeni commented Apr 24, 2026

the tests are failing because we use the IP address for smoker (as it runs on a system that has no working DNS towards the deployed foreman) and that's not allowed now.

possible solutions:

  • allow the IP address with --server-alias
  • figure out how to make DNS work for smoker (or manually override the Host header)

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