Project

General

Profile

Actions

Bug #80644

closed
RK RK

mgmt-gateway accepts invalid hostname in virtual_ip

Bug #80644: mgmt-gateway accepts invalid hostname in virtual_ip

Added by Redouane Kachach Elhicou 3 months ago. Updated 2 months ago.

Status:
Pending Backport
Priority:
Normal
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
umbrella, tentacle
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

MgmtGatewaySpec.virtual_ip is intended to contain a virtual IP address, but the current spec validation does not verify that the value is actually an IP.

For example, this is currently accepted:

service_type: mgmt-gateway
spec:
virtual_ip: ceph.example.com

This later causes an invalid internal TLS configuration. The mgmt-gateway internal endpoint is built using virtual_ip, while the internally generated certificate expects this value to be an IP SAN. As a result, Grafana may try to connect to:

https://ceph.example.com:29443/internal/prometheus

while the internal certificate does not contain ceph.example.com as a DNS SAN, causing TLS hostname verification to fail.

MgmtGatewaySpec.validate() should reject non-IP values for virtual_ip, e.g. hostnames or CIDR notation, and only accept valid IPv4/IPv6 addresses.

Expected behavior:

Invalid virtual_ip: ceph.example.com. Must be a valid IP address.

The validation should happen when applying/parsing the service spec rather than later during certificate generation.


Related issues 1 (1 open — 0 closed)

Copied to Orchestrator - Backport #80820: tentacle: mgmt-gateway accepts invalid hostname in virtual_ipIn ProgressRedouane Kachach Elhicou

Actions

RK Updated by Redouane Kachach Elhicou 2 months ago Actions #1

  • Status changed from New to Fix Under Review
  • Pull request ID set to 71655

RK Updated by Redouane Kachach Elhicou 2 months ago Actions #2

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to umberlla, tentacle

UB Updated by Upkeep Bot 2 months ago Actions #3

Redmine Upkeep failure

The redmine-upkeep.py script failed to update this issue. I have added the flag "upkeep-failed" to avoid looking at this issue again.

Please manually fix the issue and remove "upkeep-failed" flag to allow future upkeep operations.

Transformation

The script was in the create_backports transformation.

Update Log

https://github.com/ceph/ceph/actions/runs/35726764786

Error

Redmine Update failed:

Traceback (most recent call last):
  File "/home/runner/work/ceph/ceph/ceph/src/script/redmine-upkeep.py", line 1162, in _transform_create_backports
    other = self.R.issue.create(**create_args)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/managers/base.py", line 187, in create
    response = self.redmine.engine.request(self.resource_class.http_method_create, url, data=request)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 83, in request
    return self.process_response(self.session.request(method, url, **kwargs))
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 178, in process_response
    raise exceptions.ValidationError(', '.join(': '.join(e) if isinstance(e, list) else e for e in errors))
redminelib.exceptions.ValidationError: Ceph release is not included in the list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/ceph/ceph/ceph/src/script/redmine-upkeep.py", line 1168, in _transform_create_backports
    other = self.R.issue.create(**create_args)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/managers/base.py", line 187, in create
    response = self.redmine.engine.request(self.resource_class.http_method_create, url, data=request)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 83, in request
    return self.process_response(self.session.request(method, url, **kwargs))
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 178, in process_response
    raise exceptions.ValidationError(', '.join(': '.join(e) if isinstance(e, list) else e for e in errors))
redminelib.exceptions.ValidationError: Ceph release is not included in the list

RK Updated by Redouane Kachach Elhicou 2 months ago Actions #4

  • Pull request ID changed from 71655 to 71897

UB Updated by Upkeep Bot 2 months ago Actions #6

  • Copied to Backport #80820: tentacle: mgmt-gateway accepts invalid hostname in virtual_ip added

UB Updated by Upkeep Bot 2 months ago Actions #7

Redmine Upkeep failure

The redmine-upkeep.py script failed to update this issue. I have added the flag "upkeep-failed" to avoid looking at this issue again.

Please manually fix the issue and remove "upkeep-failed" flag to allow future upkeep operations.

Transformation

The script was in the create_backports transformation.

Update Log

https://github.com/ceph/ceph/actions/runs/35939523865

Error

Redmine Update failed:

Traceback (most recent call last):
  File "/home/runner/work/ceph/ceph/ceph/src/script/redmine-upkeep.py", line 1172, in _transform_create_backports
    other = self.R.issue.create(**create_args)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/managers/base.py", line 187, in create
    response = self.redmine.engine.request(self.resource_class.http_method_create, url, data=request)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 83, in request
    return self.process_response(self.session.request(method, url, **kwargs))
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 178, in process_response
    raise exceptions.ValidationError(', '.join(': '.join(e) if isinstance(e, list) else e for e in errors))
redminelib.exceptions.ValidationError: Ceph release is not included in the list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/ceph/ceph/ceph/src/script/redmine-upkeep.py", line 1178, in _transform_create_backports
    other = self.R.issue.create(**create_args)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/managers/base.py", line 187, in create
    response = self.redmine.engine.request(self.resource_class.http_method_create, url, data=request)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 83, in request
    return self.process_response(self.session.request(method, url, **kwargs))
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 178, in process_response
    raise exceptions.ValidationError(', '.join(': '.join(e) if isinstance(e, list) else e for e in errors))
redminelib.exceptions.ValidationError: Ceph release is not included in the list

Update Payload

{
    "issue": {
        "custom_fields": [
            {
                "id": 33,
                "value": "420a020a5fc82a6bb90d657759daf44b8b74b2c7" 
            },
            {
                "id": 34,
                "value": "v21.3.0-3474-g420a020a5f" 
            },
            {
                "id": 37,
                "value": "2026-09-24T00:44:09+00:00" 
            }
        ]
    },
    "suppress_mail": "1" 
}

RK Updated by Redouane Kachach Elhicou 2 months ago Actions #8

  • Backport changed from umberlla, tentacle to umbrella, tentacle
Actions

Also available in: PDF Atom