Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions src/content/docs/docs/community/kubernetes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,7 @@ extensionProviders:
service: "tinyauth.tinyauth.svc.cluster.local"
port: "3000"
pathPrefix: "/api/auth/envoy?path="
includeRequestHeadersInCheck: ["cookie", "x-forwarded-for", "x-forwarded-proto", "x-forwarded-host", "accept", "user-agent"]
includeAdditionalHeadersInCheck:
"x-forwarded-for": "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
"x-real-ip": "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
"x-forwarded-proto": "%REQ(:SCHEME)%"
Comment on lines -82 to -86

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 would keep all headers except the x-forwarded-uri and x-forwarded-host. The real IP, the forwarded for and the original proto/method are good to have (the proto is required by the ext_authz module as well).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"x-forwarded-for", "x-forwarded-proto" are still included in includeRequestHeadersInCheck, we don't necessarily need to copy the same in includeAdditionalHeadersInCheck as the connection manager by default sanitizes/determines these headers (unless we want to override the default value Envoy determines).
Will add x-real-ip in includeAdditionalHeadersInCheck, and accept back.

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.

Basically the headers we need are:

x-forwarded-for
x-real-ip
x-forwarded-proto

And we should be good to go. You are the envoy expert so :)

"x-forwarded-host": "%REQ(:AUTHORITY)%"
"x-forwarded-uri": "%REQ(:PATH)%"
"x-forwarded-method": "%REQ(:METHOD)%"
includeRequestHeadersInCheck: ["cookie", "x-forwarded-for", "x-forwarded-proto", "user-agent"]
headersToDownstreamOnAllow: ["set-cookie"]
headersToDownstreamOnDeny: ["content-type", "set-cookie"]
```
Expand All @@ -111,14 +104,7 @@ meshConfig:
service: "tinyauth.tinyauth.svc.cluster.local"
port: "3000"
pathPrefix: "/api/auth/envoy?path="
includeRequestHeadersInCheck: ["cookie", "x-forwarded-for", "x-forwarded-proto", "x-forwarded-host", "accept", "user-agent"]
includeAdditionalHeadersInCheck:
"x-forwarded-for": "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
"x-real-ip": "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
"x-forwarded-proto": "%REQ(:SCHEME)%"
"x-forwarded-host": "%REQ(:AUTHORITY)%"
"x-forwarded-uri": "%REQ(:PATH)%"
"x-forwarded-method": "%REQ(:METHOD)%"
Comment on lines -114 to -121

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.

See the comment above.

includeRequestHeadersInCheck: ["cookie", "x-forwarded-for", "x-forwarded-proto", "user-agent"]
headersToDownstreamOnAllow: ["set-cookie"]
headersToDownstreamOnDeny: ["content-type", "set-cookie"]
```
Expand Down