Skip to content

fix: require httpConfig.authorization for Webex receivers - #8897

Merged
simonpasquier merged 3 commits into
prometheus-operator:mainfrom
A-RYAN-1:fix/8889-webex-authorization
Oct 20, 2026
Merged

simonpasquier merged 3 commits into
prometheus-operator:mainfrom
A-RYAN-1:fix/8889-webex-authorization

Conversation

@A-RYAN-1

Copy link
Copy Markdown
Contributor

Description

AlertmanagerConfig accepted a Webex receiver without httpConfig.authorization, which Alertmanager refuses to load. Reject it in validation for v1alpha1 and v1beta1.

Closes: #8889

AI-assisted.

Type of change

  • BUGFIX (non-breaking change which fixes an issue)

Verification

Unit tests for both versions fail without the change and pass with it.

Changelog entry

Reject AlertmanagerConfig Webex receivers that have no `httpConfig.authorization`.

@A-RYAN-1
A-RYAN-1 requested a review from a team as a code owner October 16, 2026 18:39
@spicysharkco

Copy link
Copy Markdown
Contributor

This rejects Webex receivers that set httpConfig.bearerTokenSecret instead of authorization, and those work today: the operator renders bearerTokenSecret as bearer_token, and Alertmanager's HTTPClientConfig.Validate turns bearer_token into Authorization before the Webex check runs. Could the check accept either Authorization or BearerTokenSecret?

@A-RYAN-1

Copy link
Copy Markdown
Contributor Author

Good catch, thank you. The check now accepts either authorization or bearerTokenSecret (v1alpha1 and v1beta1), with a test case for each in both versions. Pushed as 41a66c8.

@A-RYAN-1

Copy link
Copy Markdown
Contributor Author

Thanks @spicysharkco for the empty-Secret case in #8899. I added the same validation.NotEmpty check (as for the PagerDuty keys) for both authorization and bearerTokenSecret to this PR, with a test that fails without it, so one PR now covers the field presence and the empty credentials.

@A-RYAN-1

Copy link
Copy Markdown
Contributor Author

Hello, a gentle ping on this PR whenever someone has time. All checks are green, and it now also covers bearerTokenSecret and an empty credential, following spicysharkco's review. I am happy to adjust anything, and thank you for your time!

@A-RYAN-1

Copy link
Copy Markdown
Contributor Author

Friendly reminder that this is ready for review, with CI green and the Webex bearerTokenSecret case covered in tests. Glad to rework anything. Thank you!

@simonpasquier

Copy link
Copy Markdown
Contributor

thanks! LGTM but you'll need to resolve conflicts.

Alertmanager refuses a Webex receiver without http_config.authorization,
which blocks every change until the object is fixed. Reject it in
validation for v1alpha1 and v1beta1.

Fixes prometheus-operator#8889

Signed-off-by: Aryan Deshmukh <[email protected]>
Alertmanager turns bearer_token into an authorization during its own
validation, so a Webex receiver that sets httpConfig.bearerTokenSecret
is valid and must not be rejected.

Signed-off-by: Aryan Deshmukh <[email protected]>
A bearerTokenSecret or authorization credentials reference to an
existing Secret key with an empty value passed the check, but
Alertmanager refuses the receiver. Use validation.NotEmpty, as the
PagerDuty keys do.

Signed-off-by: Aryan Deshmukh <[email protected]>
@A-RYAN-1
A-RYAN-1 force-pushed the fix/8889-webex-authorization branch from fbc6b30 to ccff91a Compare October 19, 2026 14:14
@A-RYAN-1

Copy link
Copy Markdown
Contributor Author

Rebased onto main and resolved the conflict (both PRs added the same v1alpha1 test file, so I kept both tests). Thanks for the review!

@A-RYAN-1

Copy link
Copy Markdown
Contributor Author

This is rebased onto main to clear the conflict, the checks are green, and the earlier LGTM still stands. Could a maintainer take a look when there is time? Happy to adjust anything. Thanks!

@simonpasquier simonpasquier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! As a follow-up we could even add a CEL rule to reject resources with Webex without an authorization or bearer token ref

@simonpasquier
simonpasquier merged commit 617ed65 into prometheus-operator:main Oct 20, 2026
23 checks passed
sdwilsh pushed a commit to sdwilsh/ansible-playbooks that referenced this pull request Nov 7, 2026
…r to v0.95.1 (#2092)

##### [\`v0.95.1\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.95.1)

Maintenance release because the CI workflow failed to publish the `v0.95.0` container images.

---
##### [\`v0.95.0\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.95.0)

- \[CHANGE] Add `alertmanagerConfigFileSystemMode` field to the `Alertmanager` CRD controlling how to process `AlertmanagerConfig` resources which have references to files from the Alertmanager container's filesystem.
- \[FEATURE] Add `extraScrapeMetrics` field to the `Prometheus` and `PrometheusAgent` CRDs. [#8810](prometheus-operator/prometheus-operator#8810)
- \[FEATURE] Add `extraScrapeMetrics` field to the `ServiceMonitor`, `PodMonitor`, `Probe` and `ScrapeConfig` CRDs. [#8892](prometheus-operator/prometheus-operator#8892)
- \[FEATURE] Reconcile `ScrapeConfig` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8910](prometheus-operator/prometheus-operator#8910)
- \[FEATURE] Reconcile `ServiceMonitor` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8860](prometheus-operator/prometheus-operator#8860)
- \[FEATURE] Reconcile `PodMonitor` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8859](prometheus-operator/prometheus-operator#8859)
- \[FEATURE] Reconcile `Probe` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8930](prometheus-operator/prometheus-operator#8930)
- \[FEATURE] Reconcile `AlertmanagerConfig` status subresource on `Alertmanager` reconciliations (requires the `StatusForConfigurationResources` feature gate). [#8261](prometheus-operator/prometheus-operator#8261)
- \[FEATURE] Add `labels` field to the `AlertmanagerConfig` to manage route labels. [#8761](prometheus-operator/prometheus-operator#8761)
- \[FEATURE] Add support for route `labels` in the Alertmanager configuration Secret. [#8865](prometheus-operator/prometheus-operator#8865)
- \[FEATURE] Add `botToken` support for the global Telegram configuration in the `Alertmanager` CRD. [#8403](prometheus-operator/prometheus-operator#8403)
- \[ENHANCEMENT] Add distroless images (available under the `<version>-distroless` tag). [#8815](prometheus-operator/prometheus-operator#8815)
- \[ENHANCEMENT] Add `--disable-pprof` CLI argument. [#8920](prometheus-operator/prometheus-operator#8920)
- \[ENHANCEMENT] Configure the log level via the runtime configuration section instead of the `--log.level` flag for Prometheus >= `3.15.0`. [#8881](prometheus-operator/prometheus-operator#8881)
- \[BUGFIX] Reject AlertmanagerConfig resources where PagerDuty `routingKey` and `serviceKey` references resolve to empty strings. [#8842](prometheus-operator/prometheus-operator#8842)
- \[BUGFIX] Rollout Alertmanager pods when the cluster TLS configuration is updated. [#8840](prometheus-operator/prometheus-operator#8840)
- \[BUGFIX] Pass `imagePullPolicy` to the `ThanosRuler` config-reloader sidecar. [#8916](prometheus-operator/prometheus-operator#8916)
- \[BUGFIX] Make the ordering of the `ts` and `level` keys consistent in the config-reloader logs (the `ts` key always comes first). [#8913](prometheus-operator/prometheus-operator#8913)
- \[BUGFIX] Reject MSTeamsV2 receivers without a webhook URL. [#8908](prometheus-operator/prometheus-operator#8908)
- \[BUGFIX] Add credentials validation for Webex receivers in the `AlertmanagerConfig` CRD. [#8906](prometheus-operator/prometheus-operator#8906) [#8897](prometheus-operator/prometheus-operator#8897)
- \[BUGFIX] Preserve HTTP client configuration for Azure SD in the `ScrapeConfig` CRD. [#8898](prometheus-operator/prometheus-operator#8898)
- \[BUGFIX] Reject `AlertmanagerConfig` custom resources with duplicated time interval names. [#8896](prometheus-operator/prometheus-operator#8896)
- \[BUGFIX] Improve validation for the PagerDuty receiver in the `AlertmanagerConfig` CRD. [#8842](prometheus-operator/prometheus-operator#8842)
- \[BUGFIX] Add validation for the `clientAuthType` field in `Prometheus`, `PrometheusAgent`, `Alertmanager` and `ThanosRuler` CRDs. [#8823](prometheus-operator/prometheus-operator#8823)
- \[BUGFIX] Discard unsupported fields in remote-write configuration for the `ThanosRuler` CRD. [#8813](prometheus-operator/prometheus-operator#8813)
- \[BUGFIX] Add zone information to the generated kubelet EndpointSlice. [#8864](prometheus-operator/prometheus-operator#8864)
- \[BUGFIX] Preserve the Pushover `ttl` field when converting `AlertmanagerConfig` resources. [#8866](prometheus-operator/prometheus-operator#8866)
- \[BUGFIX] Handle unset email threading fields when converting `AlertmanagerConfig` resources. [#8858](prometheus-operator/prometheus-operator#8858)
- \[BUGFIX] Add URL validation for the PagerDuty receiver in the Alertmanager configuration Secret. [#8221](prometheus-operator/prometheus-operator#8221)
- \[BUGFIX] Add URL validation for the RocketChat receiver in the Alertmanager configuration Secret. [#8224](prometheus-operator/prometheus-operator#8224)
- \[BUGFIX] Log errors when namespace flags conflict. [#8931](prometheus-operator/prometheus-operator#8931)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AlertmanagerConfig accepts webexConfigs without httpConfig.authorization, which Alertmanager rejects

3 participants