Commit graph

98 commits

Author SHA1 Message Date
Caleb Doxsey
8be71800c4
k8s: add flush-credentials command (#2379)
* k8s: add flush-credentials command

* Update cmd/pomerium-cli/kubernetes.go

Co-authored-by: Travis Groth <travisgroth@users.noreply.github.com>

Co-authored-by: Travis Groth <travisgroth@users.noreply.github.com>
2021-07-20 14:51:55 -07:00
Caleb Doxsey
31fa214983
envoy: add full version (#2287)
* envoy: add full version

* remove unused import

* get envoy for lint
2021-06-14 13:58:12 -06:00
Caleb Doxsey
f9675f61cc
deps: upgrade to go-jose v3 (#2284) 2021-06-10 09:35:44 -06:00
wasaga
e0c09a0998
log context (#2107) 2021-04-22 10:58:13 -04:00
Travis Groth
0f0a50be40
cmd/pomerium: exit 0 when intentionally terminated (#1958) 2021-03-02 15:47:25 -05:00
Caleb Doxsey
5d60cff21e
databroker: refactor databroker to sync all changes (#1879)
* refactor backend, implement encrypted store

* refactor in-memory store

* wip

* wip

* wip

* add syncer test

* fix redis expiry

* fix linting issues

* fix test by skipping non-config records

* fix backoff import

* fix init issues

* fix query

* wait for initial sync before starting directory sync

* add type to SyncLatest

* add more log messages, fix deadlock in in-memory store, always return server version from SyncLatest

* update sync types and tests

* add redis tests

* skip macos in github actions

* add comments to proto

* split getBackend into separate methods

* handle errors in initVersion

* return different error for not found vs other errors in get

* use exponential backoff for redis transaction retry

* rename raw to result

* use context instead of close channel

* store type urls as constants in databroker

* use timestampb instead of ptypes

* fix group merging not waiting

* change locked names

* update GetAll to return latest record version

* add method to grpcutil to get the type url for a protobuf type
2021-02-18 15:24:33 -07:00
Caleb Doxsey
ab4a68f56f
remove user impersonation and service account cli (#1768)
* remove user impersonation and service account cli

* update doc

* remove user impersonation url query params

* fix flaky test
2021-01-12 09:28:29 -07:00
Caleb Doxsey
b16236496b
jws: remove issuer (#1754) 2021-01-11 07:57:54 -07:00
bobby
f837c92741
dev: update linter (#1728)
- gofumpt everything
- fix TLS MinVersion to be at least 1.2
- add octal syntax
- remove newlines
- fix potential decompression bomb in ecjson
- remove implicit memory aliasing in for loops.

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-12-30 09:02:57 -08:00
bobby
e56e7e4b9e
cli: add version command (#1726)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-12-29 20:04:32 -08:00
Caleb Doxsey
ea4e9fa3aa
add TLS flags for TCP tunnel (#1725) 2020-12-29 14:36:52 -07:00
Caleb Doxsey
796ad2ded8
k8s cmd: use authclient package (#1722) 2020-12-29 12:06:31 -07:00
Caleb Doxsey
61ab4e4837
TCP client command (#1696)
* add cli commands

* add jwt cache test

* add tcptunnel test

* add stdin/stdout support

* use cryptutil hash function

* doc updates

* fix log timestamp
2020-12-17 12:37:28 -07:00
Caleb Doxsey
d18e8c661d
improve ca cert error message, use GetCertPool for databroker storage (#1666) 2020-12-09 11:16:39 -07:00
Caleb Doxsey
eb79cc0957
databroker: require JWT for access (#1503) 2020-10-09 11:08:40 -06:00
Caleb Doxsey
0a6796ff71
authorize: add support for service accounts (#1374) 2020-09-04 10:37:00 -06:00
Robert
2dc8879583
Allow setting the shared secret via an environment variable. (#1337)
This makes it easier to safely pass it in programmatically to a container
without cutting and pasting or putting it on the command line.
2020-08-27 08:39:07 -06:00
Travis Groth
a555e5fcc3
cmd/pomerium-cli: do not require terminal with cached creds (#1196) 2020-08-04 08:36:14 -04:00
Caleb Doxsey
4115c67d93
pomerium-cli: kubernetes fixes (#1176)
* pomerium-cli: fix kubernetes token caching

* pomerium-cli: fix error hanging

* add options for TLS
2020-07-31 13:51:48 -06:00
Caleb Doxsey
b1d72c829b
pomerium-cli: fix kubernetes token caching (#1169)
* pomerium-cli: fix kubernetes token caching

* switch to jose v2
2020-07-31 09:50:06 -06:00
Caleb Doxsey
5df10d1539
pomerium-cli k8s exec-credential (#1073)
* wip

* wip

* remove dead code

* add logging about errors for caching credentials

* rename subcommand
2020-07-16 11:40:43 -06:00
Caleb Doxsey
e30e717942
main: move pomerium main code to an internal cmd package so that it can be called directly from tests (#734)
* main: move pomerium main code to an internal cmd package so that it can be called directly from tests

* fix test
2020-05-19 11:17:40 -06:00
Travis Groth
1f1e63a75b
telemetry/tracing: Add Zipkin tracing support (#723) 2020-05-18 21:57:13 -04:00
Caleb Doxsey
dccec1e646 envoy: support autocert (#695)
* envoy: support autocert

* envoy: fallback to http host routing if sni fails to match

* update comment

* envoy: renew certs when necessary

* fix tests
2020-05-18 17:10:10 -04:00
Caleb Doxsey
02615b8b6c Merge remote-tracking branch 'origin/master' into feature/envoy 2020-05-18 17:10:10 -04:00
Travis Groth
99e788a9b4 envoy: Initial changes 2020-05-18 17:10:10 -04:00
Bobby DeSimone
bf9a6f5e97
cryptutil: add automatic certificate management (#644)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-05-05 12:50:19 -07:00
Bobby DeSimone
d7daf274c0
pomerium-cli: add service account docs (#613)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-04-16 13:28:42 -07:00
Bobby DeSimone
6337377ad6
cli: fix some confusing comments (#602)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-04-12 10:16:50 -07:00
Bobby DeSimone
9bee6bb648
cmd: add cli to generate service accounts (#552)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-03-24 20:23:07 -07:00
Bobby DeSimone
c23db546fa
authorization: log audience claim failure (#553)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-03-22 12:06:25 -07:00
Bobby DeSimone
ba14ea246d
*: remove import path comments (#545)
- import path comments are obsoleted by the go.mod file's module statement

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-03-16 10:13:47 -07:00
Bobby DeSimone
8d1732582e
authorize: use jwt insead of state struct (#514)
authenticate: unmarshal and verify state from jwt, instead of middleware
authorize: embed opa policy using statik
authorize: have IsAuthorized handle authorization for all routes
authorize: if no signing key is provided, one is generated
authorize: remove IsAdmin grpc endpoint
authorize/client: return authorize decision struct
cmd/pomerium: main logger no longer contains email and group
cryptutil: add ECDSA signing methods
dashboard: have impersonate form show up for all users, but have api gated by authz
docs: fix typo in signed jwt header
encoding/jws: remove unused es256 signer
frontend: namespace static web assets
internal/sessions: remove leeway to match authz policy
proxy:  move signing functionality to authz
proxy: remove jwt attestation from proxy (authZ does now)
proxy: remove non-signed headers from headers
proxy: remove special handling of x-forwarded-host
sessions: do not verify state in middleware
sessions: remove leeway from state to match authz
sessions/{all}: store jwt directly instead of state

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-03-10 11:19:26 -07:00
Travis Groth
87d3d8c798
Ensure service name is passed to grpc metrics handlers (#510) 2020-02-21 06:25:43 -05:00
Travis Groth
3654f44384
config: Expose and set default GRPC Server Keepalive Parameters (#509) 2020-02-19 21:21:28 -05:00
Bobby DeSimone
dccc7cd2ff
cache : add cache service (#457)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2020-01-20 18:25:34 -08:00
Bobby DeSimone
c8e6277a30
Merge remote-tracking branch 'upstream/master' into bugs/fix-forward-auth
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-11-25 15:02:25 -08:00
Bobby DeSimone
0f6a9d7f1d
proxy: fix forward auth, request signing
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-11-25 14:29:52 -08:00
Bobby DeSimone
ebee64b70b
internal/frontend : serve static assets (#392)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-11-22 17:46:01 -08:00
Travis Groth
f20d913abe
proxy: Fix policy reload regression (#396)
* Fix policy reload regression

* Update changelog
2019-11-22 19:28:36 -05:00
Travis Groth
f3c62c10cc
Rename internal/config to config (#380) 2019-11-09 19:53:11 -05:00
Bobby DeSimone
bca5caf77a
httputil: add explicit healthcheck handler (#354)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-10-07 17:38:28 -07:00
Bobby DeSimone
f73d3a09ac
internal/config: fix on config change
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-10-02 22:48:41 -07:00
Bobby DeSimone
df822a4bae
all: support insecure mode
- pomerium/authenticate: add cookie secure setting
- internal/config: transport security validation moved to options
- internal/config: certificate struct hydrated
- internal/grpcutil: add grpc server mirroring http one
- internal/grpcutil: move grpc middleware
- cmd/pomerium: use run wrapper around main to pass back errors
- cmd/pomerium: add waitgroup (block on) all servers http/grpc

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-10-02 18:44:19 -07:00
Travis Groth
251ab0d527
internal/config: Switch to using struct scoped viper instance (#332)
* Switch to using struct scoped viper instance

* Rename NewXXXOptions

* Handle unchecked errors from viper.BindEnv
2019-10-01 18:16:36 -04:00
Bobby DeSimone
782ffbeb3e
proxy: use middleware to manage request flow
proxy: remove duplicate error handling in New
proxy: remove routeConfigs in favor of using gorilla/mux
proxy: add proxy specific middleware
proxy: no longer need to use middleware / handler to check if valid route. Can use build in 404 mux.
internal/middleware: add cors bypass middleware

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-09-25 12:28:37 -07:00
Bobby DeSimone
cd6311773f
Merge pull request #311 from desimone/bug/308
cmd/pomerium: add host to main logging handler
2019-09-18 19:55:00 -07:00
Bobby DeSimone
21e215ccea
proxy: handle double slash in paths
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-09-16 20:34:04 -07:00
Bobby DeSimone
78b98e2746
cmd/pomerium: add host to main logging handler
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-09-16 20:22:59 -07:00
Bobby DeSimone
dc12947241
all: refactor handler logic
- all: prefer `FormValues` to `ParseForm` with subsequent `Form.Get`s
- all: refactor authentication stack to be checked by middleware, and accessible via request context.
- all: replace http.ServeMux with gorilla/mux’s router
- all: replace custom CSRF checks with gorilla/csrf middleware
- authenticate: extract callback path as constant.
- internal/config: implement stringer interface for policy
- internal/cryptutil: add helper func `NewBase64Key`
- internal/cryptutil: rename `GenerateKey` to `NewKey`
- internal/cryptutil: rename `GenerateRandomString` to `NewRandomStringN`
- internal/middleware: removed alice in favor of gorilla/mux
- internal/sessions: remove unused `ValidateRedirectURI` and `ValidateClientSecret`
- internal/sessions: replace custom CSRF with gorilla/csrf fork that supports custom handler protection
- internal/urlutil: add `SignedRedirectURL` to create hmac'd URLs
- internal/urlutil: add `ValidateURL` helper to parse URL options
- internal/urlutil: add `GetAbsoluteURL` which takes a request and returns its absolute URL.
- proxy: remove holdover state verification checks; we no longer are setting sessions in any proxy routes so we don’t need them.
- proxy: replace un-named http.ServeMux with named domain routes.

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2019-09-16 18:01:14 -07:00