-
Notifications
You must be signed in to change notification settings - Fork 351
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
filters/auth: add jwtMetrics #3020
Conversation
c49d6b5
to
94e2336
Compare
53208f9
to
327394e
Compare
6a235e0
to
a2c8e8a
Compare
metrics.IncCounter(metricsPrefix + "missing-issuer") | ||
} else if !slices.Contains(f.Issuers, issuer) { | ||
metrics.IncCounter(metricsPrefix + "invalid-issuer") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not count valid tokens, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not a goal to reveal valid tokens, besides we don't validate so we could only know that it parses as JWT token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a user I would wonder why we do not have a counter for valid tokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to count configured claims (e.g. token realms) but this may be implemented later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this stage jwtMetrics
is essentially invalidJwtMetrics
because it only counts wrong tokens. I do not want to put "invalid" into the name and we may extend it in the future to count other claims.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Add jwtMetrics filter that parses JWT token and increments a set of counters, see documentation for details. Signed-off-by: Alexander Yastrebov <[email protected]>
a2c8e8a
to
7008969
Compare
👍 |
1 similar comment
👍 |
Extend configuration of `jwtMetrics` (#3020) to support opt-out - disable when any of the configured route annotations (#3022) is present. This can be used to collect data about missing/invalid JWT tokens per hostname in multitenant ingress setup. Add `jwtMetrics` filter to all routes using `-default-filters-append` flag and allow users to annotate routes that do not require JWT token. Signed-off-by: Alexander Yastrebov <[email protected]>
Extend configuration of `jwtMetrics` (#3020) to support opt-out - disable metrics collection when any of the configured route annotations (#3022) is present. This can be used to collect data about missing/invalid JWT tokens per hostname in multitenant ingress setup. Add `jwtMetrics` filter to all routes using `-default-filters-append` flag and allow users to annotate routes that do not require JWT token. Signed-off-by: Alexander Yastrebov <[email protected]>
Extend configuration of `jwtMetrics` (#3020) to support opt-out - disable metrics collection when any of the configured route annotations (#3022) is present. This can be used to collect data about missing/invalid JWT tokens per hostname in multitenant ingress setup. Add `jwtMetrics` filter to all routes using `-default-filters-append` flag and allow users to annotate routes that do not require JWT token. Signed-off-by: Alexander Yastrebov <[email protected]>
Extend configuration of `jwtMetrics` (#3020) to support opt-out - disable metrics collection when any of the configured route annotations (#3022) is present. This can be used to collect data about missing/invalid JWT tokens per hostname in multitenant ingress setup. Add `jwtMetrics` filter to all routes using `-default-filters-append` flag and allow users to annotate routes that do not require JWT token. Signed-off-by: Alexander Yastrebov <[email protected]>
[Changes](zalando/skipper@v0.21.54...v0.21.61) * [build(deps): bump amazonlinux from `ef9435f` to `5478f82` in /fuzz](zalando/skipper#3031) * [build(deps): bump actions/upload-artifact from 4.3.1 to 4.3.2](zalando/skipper#3033) * [build(deps): bump actions/checkout from 4.1.2 to 4.1.3](zalando/skipper#3032) * [build(deps): bump github.com/miekg/dns from 1.1.58 to 1.1.59](zalando/skipper#3030) * [proxy: support configurable metrics](zalando/skipper#3027) * [filters/auth: add login redirect stub support](zalando/skipper#3028) * [filters: move annotate into own package](zalando/skipper#3023) * [filters/auth: add jwtMetrics](zalando/skipper#3020) * [filters/builtin: add annotate filter](zalando/skipper#3022) Signed-off-by: Alexander Yastrebov <[email protected]>
[Changes](zalando/skipper@v0.21.54...v0.21.61) * `build(deps): bump amazonlinux from `ef9435f` to `5478f82` in /fuzz` zalando/skipper#3031 * `build(deps): bump actions/upload-artifact from 4.3.1 to 4.3.2` zalando/skipper#3033 * `build(deps): bump actions/checkout from 4.1.2 to 4.1.3` zalando/skipper#3032 * `build(deps): bump github.com/miekg/dns from 1.1.58 to 1.1.59` zalando/skipper#3030 * `proxy: support configurable metrics` zalando/skipper#3027 * `filters/auth: add login redirect stub support` zalando/skipper#3028 * `filters: move annotate into own package` zalando/skipper#3023 * `filters/auth: add jwtMetrics` zalando/skipper#3020 * `filters/builtin: add annotate filter` zalando/skipper#3022 Signed-off-by: Alexander Yastrebov <[email protected]>
[Changes](zalando/skipper@v0.21.54...v0.21.61) * zalando/skipper#3031 * zalando/skipper#3033 * zalando/skipper#3032 * zalando/skipper#3030 * zalando/skipper#3027 * zalando/skipper#3028 * zalando/skipper#3023 * zalando/skipper#3020 * zalando/skipper#3022 Signed-off-by: Alexander Yastrebov <[email protected]>
[Changes](zalando/skipper@v0.21.54...v0.21.62) * zalando/skipper#3025 * zalando/skipper#3031 * zalando/skipper#3033 * zalando/skipper#3032 * zalando/skipper#3030 * zalando/skipper#3027 * zalando/skipper#3028 * zalando/skipper#3023 * zalando/skipper#3020 * zalando/skipper#3022 Signed-off-by: Alexander Yastrebov <[email protected]>
Add jwtMetrics filter that parses JWT token and increments a set of counters,
see documentation for details.