Skip to content

Add support for Unix Domain Sockets in Pomerium Reverse Proxy #7772

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

Conversation

biru-codeastromer
Copy link
Contributor

Fixes #6893

Changes Made:

  • Updated documentation to include instructions for configuring Pomerium with Unix domain sockets.
  • Modified config.yaml and docker-compose.yaml in the documentation of unix domain sockets part to demonstrate the new configuration.

Testing Done:

1. Initial Setup:

  • Created and set up docker-compose.yaml with Jenkins and Pomerium configurations.
  • Completed the Jenkins Setup Wizard by accessing http://localhost:8080.

2. Pomerium Configuration:

  • Created config.yaml with placeholders for sensitive information.
  • Generated a signing key using OpenSSL and added it to the config.yaml.

3. Integration and Running Services:

  • Updated docker-compose.yaml to include Pomerium, linked with Jenkins using Unix domain sockets.
  • Restarted services and verified access to Jenkins at https://jenkins.localhost.pomerium.io.

4. JWT Authentication:

  • Installed JWT Auth and skip-certificate-check plugins in Jenkins.
  • Configured JWT authentication in Manage Jenkins > Configure Global Security.

5. Verification:

  • Verified JWT authentication by checking the user identity in the Jenkins dashboard.
  • Inspected JWT claims at https://verify.localhost.pomerium.io.

6. Authorization Testing:

  • Configured Jenkins authorization settings and verified permissions for different users.

7. Functionality Testing:

  • Triggered builds in Jenkins to ensure proper communication via Unix domain sockets.

Please review and provide feedback.

Additional note -

Removed the version field from docker-compose.yaml as it is no longer required with newer versions of Docker Compose and caused errors during local testing.

@biru-codeastromer biru-codeastromer requested a review from a team as a code owner December 21, 2024 11:11
@probot-autolabeler probot-autolabeler bot added the documentation Jenkins documentation, including user and developer docs, solution pages, etc. label Dec 21, 2024
@zbynek
Copy link
Contributor

zbynek commented Dec 21, 2024

@biru-codeastromer Are you sure the communication goes through unix sockets and not the 8080 TCP port? I'd expect unix:///run/jenkins/jenkins.socket to come up in the config instead of http://jenkins:8080, but I have no experience with Pomerium.

@cmo-pomerium could you please review this?

@biru-codeastromer
Copy link
Contributor Author

biru-codeastromer commented Dec 21, 2024

Thank you for your observation, @zbynek Sir!

I initially configured the route to use unix:///run/jenkins/jenkins.socket, as expected for Unix domain sockets. However, Pomerium returned the following error:

pomerium-1 -* error decoding 'routes[1]': unix:///run/jenkins/jenkins.socket: unix:///run/jenkins/jenkins.socket url does not contain a valid hostname

Due to this, I reverted to using http://jenkins:8080 as a fallback, which worked successfully for the integration. I suspect this might be a limitation or unsupported behavior in Pomerium when using Unix sockets.

If this fallback behavior is acceptable, I will document it explicitly in the PR. However, I would appreciate further input, especially from @cmo-pomerium, to confirm whether this is an expected limitation or if there's a recommended workaround to enable Unix domain socket communication.

Also Sir @kmartens27 may you please review and guide how to improve this .Thanks!
Looking forward to your feedback!

@kmartens27
Copy link
Contributor

Hi @biru-codeastromer, I think at this point the PR will be closed. As we have not gotten further confirmation about the instructions/whether or not it is using the correct method, closing it for the time being is the best course of action. However, if you are able to confirm or enhance the instruction further to be in line with what the expected behaviors are, you are more than welcome to create a new PR building on the work from this one. Thanks as always for your efforts and contributions.

@kmartens27 kmartens27 closed this Mar 14, 2025
@biru-codeastromer
Copy link
Contributor Author

biru-codeastromer commented Mar 14, 2025

@kmartens27
Sure! At this point, I have been advised not to raise more PRs. As an aspiring GSoC applicant this year, the maintainers have recommended keeping my PR count not more than 20 until the application period ends.
Therefore, I am focusing on my proposal.
I will be discussing improvements for this issue with the maintainers during the application period.
If the approach is found good, I will proceed with raising the PR once the application period concludes.

Are you aligned with it 🤗?

@kmartens27
Copy link
Contributor

Hi @biru-codeastromer, I think that's a great idea and definitely want to make sure it's aligned with GSoC if that is your main goal. I think you've got a great plan and am happy to help in whatever ways I can (via the proper channels).

@krisstern krisstern changed the title Added support for Unix Domain Sockets in Pomerium Reverse Proxy Add support for Unix Domain Sockets in Pomerium Reverse Proxy Mar 14, 2025
@biru-codeastromer
Copy link
Contributor Author

Thank you so much, @kmartens27 for your response ! . Yes, for now, I’m focusing on aligning things with gsoc, but not limited to gsoc. I genuinely enjoy being part of this community, which is why I’ve tried to not keep my contributions limited to gsoc related only... It has been a great experience, and I definitely plan to continue contributing again thoroughly after the application period to the community.

Also looking forward to continuing further discussions on our open PR #7841 till then😇.

@biru-codeastromer biru-codeastromer deleted the update-pomerium-docs branch April 16, 2025 11:18
@biru-codeastromer
Copy link
Contributor Author

Hi @kmartens27,
I looked into it again and noticed that, as of now, Pomerium does not officially support Unix domain sockets for upstream connections that why last time we weren't going to the required ports...
Their documentation mainly covers TCP and UDP protocols over HTTP, and there's currently no mention of UDS support...

Just wanted to clarify whether we should wait for official UDS support in Pomerium before updating the Jenkins reverse proxy docs for it?

@biru-codeastromer
Copy link
Contributor Author

or should we give a note / alert in the docs as maybe

NOTE: While Jenkins supports Unix domain sockets, Pomerium currently requires traditional HTTP endpoints in route configurations.

do you have any views in it

@kmartens27
Copy link
Contributor

kmartens27 commented Apr 18, 2025

I don't think it's worth providing this information if it does not work. Even with providing a note, it can be misleading and it would be best to avoid providing incorrect/non-operable instructions. If it's not supported then it does not make sense to provide instructions to say otherwise.

Thanks very much for your work on this and continued efforts for the project though!

@biru-codeastromer
Copy link
Contributor Author

Sure got it thanks for the feedback regarding that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Jenkins documentation, including user and developer docs, solution pages, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Pomerium reverse proxy documentation to include support for unix domain sockets
4 participants