git.iko.soy/typeable/oauth2-proxy
on master help sign in
Update documentation and changelog for redis store
commitfc06e2dbef3389e9ba71c72f9569566902fff0aa authorBrian Van Klaveren <bvan@slac.stanford.edu> dateMon 20 May 2019, 14:46 (7 years ago) parent5095c36
4 files changed+32−1
CHANGELOG.md+6 docs/configuration/configuration.md+1 docs/configuration/sessions.md+24 main.go+1−1
CHANGELOG.md+6
@@ -14,6 +14,12 @@
1414
1515## Changes since v3.2.0
1616
17+- [#155](https://github.com/pusher/outh2_proxy/pull/155) Add RedisSessionStore implementation (@brianv0, @JoelSpeed)
18+ - Implement flags to configure the redis session store
19+ - `-redis-connection-url`
20+ - Introduces the concept of a session ticket. Tickets are composed of the cookie name, a session ID, and a secret.
21+ - Sessions are stored encrypted with a per-session secret
22+ - Added Some tests for a Server based session store
1723- [#168](https://github.com/pusher/outh2_proxy/pull/168) Drop Go 1.11 support in Travis (@JoelSpeed)
1824- [#169](https://github.com/pusher/outh2_proxy/pull/169) Update Alpine to 3.9 (@kskewes)
1925- [#148](https://github.com/pusher/outh2_proxy/pull/148) Implement SessionStore interface within proxy (@JoelSpeed)
docs/configuration/configuration.md+1
@@ -75,6 +75,7 @@ Usage of oauth2_proxy:
7575 -pubjwk-url string: JWK pubkey access endpoint: required by login.gov
7676 -redeem-url string: Token redemption endpoint
7777 -redirect-url string: the OAuth Redirect URL. ie: "https://internalapp.yourcompany.com/oauth2/callback"
78+ -redis-connection-url string: URL of redis server for redis session storage type (eg: redis://HOST[:PORT])
7879 -request-logging: Log requests to stdout (default true)
7980 -request-logging-format: Template for request log lines (see "Logging Configuration" paragraph below)
8081 -resource string: The resource that is protected (Azure AD only)
docs/configuration/sessions.md+24
@@ -16,6 +16,7 @@ data in one of the available session storage backends.
1616
1717At present the available backends are (as passed to `--session-store-type`):
1818- [cookie](cookie-storage) (default)
19+- [redis](redis-storage)
1920
2021### Cookie Storage
2122
@@ -32,3 +33,26 @@ The following should be known when using this implementation:
3233- Since multiple requests can be made concurrently to the OAuth2 Proxy, this session implementation
3334cannot lock sessions and while updating and refreshing sessions, there can be conflicts which force
3435users to re-authenticate
36+
37+
38+### Redis Storage
39+
40+The Redis Storage backend stores sessions, encrypted, in redis. Instead sending all the information
41+back the the client for storage, as in the [Cookie storage](cookie-storage), a ticket is sent back
42+to the user as the cookie value instead.
43+
44+A ticket is composed as the following:
45+
46+`{CookieName}-{ticketID}.{secret}`
47+
48+Where:
49+
50+- The `CookieName` is the OAuth2 cookie name (_oauth2_proxy by default)
51+- The `ticketID` is a 128 bit random number, hex-encoded
52+- The `secret` is a 128 bit random number, base64url encoded (no padding). The secret is unique for every session.
53+- The pair of `{CookieName}-{ticketID}` comprises a ticket handle, and thus, the redis key
54+to which the session is stored. The encoded session is encrypted with the secret and stored
55+in redis via the `SETEX` command.
56+
57+Encrypting every session uniquely protects the refresh/access/id tokens stored in the session from
58+disclosure.
main.go+1−1
@@ -76,7 +76,7 @@ func main() {
7676 flagSet.Bool("cookie-httponly", true, "set HttpOnly cookie flag")
7777
7878 flagSet.String("session-store-type", "cookie", "the session storage provider to use")
79− flagSet.String("redis-connection-url", "", "URL of redis server for redis session storage (eg: redis://HOST[:PORT])")
79+ flagSet.String("redis-connection-url", "", "URL of redis server for redis session storage type (eg: redis://HOST[:PORT])")
8080
8181 flagSet.String("logging-filename", "", "File to log requests to, empty for stdout")
8282 flagSet.Int("logging-max-size", 100, "Maximum size in megabytes of the log file before rotation")