-
Couldn't load subscription status.
- Fork 22
feat: secure operator metrics by WithAuthenticationAndAuthorization #1110
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's GuideThis PR secures the operator’s metrics endpoint by defaulting to HTTPS, integrating controller-runtime’s authentication and authorization filter, managing TLS certificates via watchers, and updating the Helm-style Kustomize overlays, RBAC, network policies, and bundle manifests to support secure metrics access. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: osmman The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Hey @osmman - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Using insecureSkipVerify: true is a security risk. (link)
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🔴 Security: 1 blocking issue, 1 other issue
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| tlsConfig: | ||
| # TODO(user): The option insecureSkipVerify: true is not recommended for production since it disables | ||
| # certificate verification, exposing the system to potential man-in-the-middle attacks. | ||
| # For production environments, it is recommended to use cert-manager for automatic TLS certificate management. | ||
| # To apply this configuration, enable cert-manager and use the patch located at config/prometheus/servicemonitor_tls_patch.yaml, | ||
| # which securely references the certificate from the 'metrics-server-cert' secret. | ||
| insecureSkipVerify: true |
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.
🚨 issue (security): Using insecureSkipVerify: true is a security risk.
Disabling TLS verification with insecureSkipVerify allows MITM attacks. Limit it to dev/testing, and in production enable cert-manager with valid certificates.
| # [NETWORK POLICY] Protect the /metrics endpoint and Webhook Server with NetworkPolicy. | ||
| # Only Pod(s) running a namespace labeled with 'metrics: enabled' will be able to gather the metrics. | ||
| # Only CR(s) which requires webhooks and are applied on namespaces labeled with 'webhooks: enabled' will | ||
| # be able to communicate with the Webhook Server. | ||
| #- ../network-policy |
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.
🚨 suggestion (security): NetworkPolicy is not enabled by default; consider enabling for production.
Enabling NetworkPolicy in production helps secure metrics and webhook endpoints from unauthorized access.
7d54839 to
1b381a4
Compare
Change RHTAS operator deployment name to rhtas-controller-manager which has been caused because of cahnges in immutable sections which causes OLM upgrade to fail. Refs: securesign/secure-sign-operator#1110
|
CI-operator and Konflux E2e tests are failing because of changes in manager's deployment name. |
1b381a4 to
1d97db4
Compare
Fix is based on changes in kubebuilder.
Refs: securesign/fbc#65 Signed-off-by: Tomas Turek <[email protected]>
1d97db4 to
5ad7d3d
Compare
|
@osmman: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Refs: securesign/fbc#65
Summary by Sourcery
Secure operator metrics by default with HTTPS, authentication and authorization; enable dynamic TLS certificate loading for metrics and webhook servers; update manifests and RBAC to support secure metrics, and standardize labels across resources.
New Features:
Enhancements:
Build: