Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 9,362
    • Issues 9,362
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Jira
    • Jira
  • Merge requests 139
    • Merge requests 139
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Do not update/delete: Banner broadcast message test data

Do not update/delete: Notification broadcast message test data

  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #41
Closed
Open
Issue created Oct 06, 2015 by username-removed-114630@cernvcsContributor

Support for multiple Kerberos realms in GitLab is inconsistent

Hi,

GitLab is not currently consistent in how it manages Kerberos identities. For Kerberos, a principal is typically in the form username@REALM. In GitLab, the extern_uid for a Kerberos identity could be either the full username@REALM or just 'username' if we assume the realm is necessarily the system's configured default realm (which is an optional setting in krb5.conf; this value is accessible from Krb5 libraries)

#34 (closed) already points some inconsistencies in Kerberos identities generated by GitLab when using the Omniauth Kerberos provider, depending on whether LDAP is also enabled.

Commit 73c0dfd2 clearly goes in the direction of storing only the username part in the extern_uid of a Kerberos identity. (before that, the realm was stored as well)

On the other hand, !6 (merged) and !29 (merged) go in the direction of using username@REALM as the Kerberos identity, in order to support the more general case. In effect, in an environment with multiple Kerberos realms, 'username' may not be unique while 'username@REALM' is.

So this brings the question of whether GitLab wishes to support multiple Kerberos realms (for instance, multiple AD domains) or not.

If the answer is yes, then all Kerberos support code should explicitly manage identities as username@REALM (plain 'username' identities may still be supported for compatibility, but then they should be processed as if they were in the default Kerberos realm)

If such support is not considered necessary, then !6 (merged) and !29 (merged) can be simplified to store 'username' only. However, for security reasons (to prevent someone with a principal username@OTHER.REALM from being able to hijack the Gitlab account of username@DEFAULT.REALM) it seems necessary that all Kerberos authentication code always verifies that a Kerberos principal username@REALM is in the default realm before stripping the REALM part, and not strip it blindly (cf. e0d5c592 and Gitlab::Kerberos::Authentication). It may also be a good idea to document that GitLab supports only a single Kerberos realm and that a default_realm must be specified in krb5.conf (it's an optional setting)

I'm happy to submit a MR to make things consistent either way, but input from GitLab developers seems necessary at this point to clarify what direction to take.

Thanks! Alex

Assignee
Assign to
Time tracking