Support IAP protected prometheus installations
What does this MR do?
Issue: #216859 (closed)
Adds two new fields to the Prometheus integration configuration, to support querying Prometheus installations behind Google's Identity Aware Proxy. This is the set-up we use internally at Gitlab for https://prometheus-dogfood.ops.gitlab.net/
Documentation on how to authenticate to IAP when doing server-to-server requests is here https://cloud.google.com/iap/docs/authentication-howto#authenticating_from_a_service_account.
This requires an update to the googleauth
gem, as this functionality was implemented only recently: https://github.com/googleapis/google-auth-library-ruby/pull/258. In turn, faraday
, signet
and google-api-client
need to be updated to solve the new gem requirements. Relevant changelogs:
- https://github.com/googleapis/google-auth-library-ruby/blob/master/CHANGELOG.md
- https://github.com/googleapis/google-api-ruby-client/blob/master/CHANGELOG.md
- https://github.com/lostisland/faraday/blob/master/CHANGELOG.md
- https://github.com/googleapis/signet/blob/master/CHANGELOG.md
Removes some initialiser monkey patch added because we couldn't upgrade google-api-client
(added here gitlab-foss!31790 (comment 213220987)).
Had to load some error constants explicitely, I wonder if I'm missing something to set-up the gems properly
The new code is behind a feature flag: prometheus_service_iap_auth
Screenshots
(This only shows part of the private key I used for testing so it is fine for sharing)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team