Icinga / Icinga/icinga2

Maximal length of Endpoint name is 64 chars du to x509 restrictions

Open
#9,310 8 comments 0 reactions 2 assignees View on GitHub

@Al2Klimov is already working on this.

Since Oct 26, 2023.

area/distributed area/setup bug
Dominant language
C++
Stars
2.2k
Forks
616
Avg merge
5d 6h
Merged PRs (30d)
10

Description

Describe the bug

The maximal length of the name of an Endpoint is limited to 64 chars due to the limitations on CommonName in x509 (look for ub-common-name-length). This presents a problem, if you want to strictly adher to a Endpoint.name == FQDN policy, especially on the cloud foo nowadays.

To Reproduce

# icinga2 node wizard
Welcome to the Icinga 2 Setup Wizard!

We will guide you through all required configuration details.

Please specify if this is an agent/satellite setup ('n' installs a master setup) [Y/n]: n

Starting the Master setup routine...

Please specify the common name (CN) [*****]: loooooooooooooooooooooooooooooooooooooong.Hostname.topleveldomain
Reconfiguring Icinga...
Checking for existing certificates for common name 'loooooooooooooooooooooooooooooooooooooong.Hostname.topleveldomain'...
Certificates not yet generated. Running 'api setup' now.
critical/SSL: Error with x509 NAME getting text by NID: 218603671, "error:0D07A097:asn1 encoding routines:ASN1_mbstring_ncopy:string too long"
critical/Application: Error: std::exception


Additional information is available in '/var/log/icinga2/crash/report.1648724548.906294'
[1]    62641 IOT instruction  icinga2 node wizard

Expected behavior

I would expect to be allowed hostnames of about 255 chars.

Possible Fix

Put something like "Icinga_Host" in Extensions and prefer it in the future until the usage of Common Name can be deprecated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.