oathkeeper icon indicating copy to clipboard operation
oathkeeper copied to clipboard

Allow the use of unix sockets for URLs

Open nlachfr opened this issue 3 years ago • 1 comments

Preflight checklist

Describe your problem

Currently, it is not possible to use unix sockets for URLs

- id: some-id
  upstream:
    url: http://127.0.0.1:8080/bbb          # Only http(s)://.... is supported
  match:
    url: http://127.0.0.1:4455/<.*>
    methods:
      - GET
      - POST
  authenticators:
    - handler: cookie_session
      config:
        check_session_url: http://127.0.0.1:8081/aaa          # Only http(s)://.... is supported
  authorizer:
    handler: allow
  mutators:
    - handler: noop
  errors:
    - handler: json

Describe your ideal solution

One solution could be to use the unix:// scheme, allowing distinction between tcp and unix connections.

Workarounds or alternatives

I have found this related discussion : Addressing HTTP servers over Unix domain sockets.

Here is an example of what could be used :

- id: some-id
  upstream:
    url: unix:///path/to/unix.sock?path=/bbb
  match:
    url: http://127.0.0.1:4455/<.*>
    methods:
      - GET
      - POST
  authenticators:
    - handler: cookie_session
      config:
        check_session_url: unix:///path/to/another/unix.sock?path=/aaa
  authorizer:
    handler: allow
  mutators:
    - handler: noop
  errors:
    - handler: json

Version

v0.38.16-beta.1

Additional Context

No response

nlachfr avatar Nov 04 '21 08:11 nlachfr

Protocol definition isn't even well defined in your post reference from the IETF. As the post mentions, URL definition is required for oathkeeper evaluation. Standard headers or cookies don't exist in a socket communication. I would advise to look into https://man7.org/linux/man-pages/man7/unix.7.html SCM_SECURITY instead of trying to use a network authentication service for local only sockets who don't use network based structure.

a-manraj-pvotal avatar Jul 13 '22 07:07 a-manraj-pvotal

Closing as out of scope for Oathkeeper, unless there's a strong use case and community contribution.

kmherrmann avatar Feb 15 '23 22:02 kmherrmann