Skip to content
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

Increase login length limit to 128 characters #46766

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tener
Copy link
Contributor

@Tener Tener commented Sep 19, 2024

Traditionally POSIX systems imposed a maximum of 32 characters for the length of any particular username. Teleport was following this limit. However, many modern systems follow higher limits like 255.

This change increases the maximum to 128 characters. I believe the full 255 characters are unlikely to be used in practice and likely a result of an error.

Changelog: maximum length for individual UNIX login was increased to 128 characters from previous 32.

@hugoShaka
Copy link
Contributor

Traditionally POSIX systems imposed a maximum of 32 characters for the length of any particular username.

Can we still find such systems in the wild? For example old/weird things (routers, old boxes) registered in teleport as Agentless OpenSSH nodes. What happens if you try to connect to such system with a longer login? Does the user get an error?

Can it mess with host user creation (e.g. you've got an old box and we create host users, except if your role contains a login too long)? Or do we just don't support those systems already?

@ethan-gallant
Copy link

ethan-gallant commented Sep 19, 2024

@hugoShaka it's actually configurable at the kernel level. Debian for example sets the limit at 255 chars.

https://man7.org/linux/man-pages/man3/sysconf.3.html
https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/limits.h#146
https://codebrowser.dev/glibc/glibc/sysdeps/unix/sysv/linux/bits/local_lim.h.html#89

Generally the legacy 32 character limit has always been considered a best-practice, however a few binaries such as useradd set their own hard-coded limit without consideration for the kernel-level configuration.

@rosstimothy
Copy link
Contributor

Yeah I'm hesitant to roll this out without further exploration and consideration. I also feel that if we do decide to proceed with this change it might be best not to backport it.

@Tener Tener added support-load This issue generates support load and removed backport/branch/v14 backport/branch/v15 labels Sep 20, 2024
@Tener
Copy link
Contributor Author

Tener commented Sep 20, 2024

Yeah I'm hesitant to roll this out without further exploration and consideration. I also feel that if we do decide to proceed with this change it might be best not to backport it.

Fair enough. There is also this unexpected integration test failure:

        	Error Trace:	/__w/teleport/teleport/integration/appaccess/appaccess_test.go:433
        	            				/__w/teleport/teleport/integration/appaccess/fixtures.go:379
        	Error:      	elements differ
        	            	
        	            	extra elements in list B:
        	            	([]interface {}) (len=1) {
        	            	 (string) (len=36) "c73937d4-6710-4676-b9d3-4d0f4a4e1a8a"
        	            	}
        	            	
        	            	
        	            	listA:
        	            	([]string) (len=3) {
        	            	 (string) (len=4) "root",
        	            	 (string) (len=6) "ubuntu",
        	            	 (string) (len=23) "-teleport-internal-join"
        	            	}
        	            	
        	            	
        	            	listB:
        	            	([]string) (len=4) {
        	            	 (string) (len=4) "root",
        	            	 (string) (len=6) "ubuntu",
        	            	 (string) (len=23) "-teleport-internal-join",
        	            	 (string) (len=36) "c73937d4-6710-4676-b9d3-4d0f4a4e1a8a"
        	            	}
        	Test:       	TestAppAccess/RewriteHeadersLeaf
    --- FAIL: TestAppAccess/RewriteHeadersLeaf (0.14s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v16 size/sm support-load This issue generates support load
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants