Bug #80644
closedmgmt-gateway accepts invalid hostname in virtual_ip
0%
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:
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.
RK Updated by Redouane Kachach Elhicou 2 months ago
- Status changed from New to Fix Under Review
- Pull request ID set to 71655
RK Updated by Redouane Kachach Elhicou 2 months ago
- Status changed from Fix Under Review to Pending Backport
- Backport set to umberlla, tentacle
UB Updated by Upkeep Bot 2 months ago
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¶
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
- Pull request ID changed from 71655 to 71897
UB Updated by Upkeep Bot 2 months ago
- Copied to Backport #80820: tentacle: mgmt-gateway accepts invalid hostname in virtual_ip added
UB Updated by Upkeep Bot 2 months ago
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¶
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
- Backport changed from umberlla, tentacle to umbrella, tentacle