Skip to content

litebastion: Support requests on a local endpoint - #38

Closed
rgdd wants to merge 1 commit into
FiloSottile:mainfrom
rgdd:litebastion-local-requests
Closed

litebastion: Support requests on a local endpoint#38
rgdd wants to merge 1 commit into
FiloSottile:mainfrom
rgdd:litebastion-local-requests

Conversation

@rgdd

@rgdd rgdd commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

This commit makes it possible to receive backend connections from the public internet while only accepting requests to those backends on a different endpoint (forced on 127.0.0.1 because of being HTTP only).

This is for example useful when running a bastion host on the same system as a log; or when the bastion host operator has its own authenticated interface to inject the -local-request-at endpoint.

@rgdd

rgdd commented Nov 17, 2025

Copy link
Copy Markdown
Contributor Author

@FiloSottile can you take a look and see if this looks reasonable? Please pay especially close attention to no other unexpected ways of sneaking in traffic on the public endpoint. My understanding is that (since before) we're only accepting TLS traffix, and with my optional configuration we're additionally dropping everything that's not a valid backend. And instead take http requests on localhost.

I've tested this on bastion-2.testonly.rgdd.se, with the definition of "works" as: my backend connection from rgdd.se/poc-witness is accepted while attempts to e.g. get its index page are rejected from the public internet. But I am able to pull the index page from the local endpoint with curl, so requests seem to be going through as expected.

(I'll take a look at the pipelines tomorrow -- hence draft.)

This commit makes it possible to receive backend connections from the
public internet while *only* accepting requests to those backends on a
different endpoint (forced on 127.0.0.1 because of being HTTP only).

This is for example useful when running a bastion host on the same
system as a log; or when the bastion host operator has its own
authenticated interface to inject the -local-request-at endpoint.
@rgdd
rgdd force-pushed the litebastion-local-requests branch from 9f17815 to 2bfbf7a Compare November 18, 2025 07:47
@rgdd

rgdd commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

Undrafting -- the failing pipeline looks unrelated to this PR.

@rgdd
rgdd marked this pull request as ready for review November 18, 2025 08:01
FiloSottile added a commit that referenced this pull request Nov 18, 2025
Closes #38

Co-authored-by: Rasmus Dahlberg <rasmus@rgdd.se>
@FiloSottile

Copy link
Copy Markdown
Owner

I don't love exposing the HTTP server to the outside world and then resting the whole protection on an if statement three configs deep. There's an alternative (untested for now) implementation at #39. Do you like that better?

@rgdd

rgdd commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

Closing in favor of #39

@rgdd rgdd closed this Nov 18, 2025
FiloSottile added a commit that referenced this pull request Nov 18, 2025
Closes #38

Co-authored-by: Rasmus Dahlberg <rasmus@rgdd.se>
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