Skip to content

ATS 9.2.6 fails to start as root #11869

Closed

Description

@jvgutierrez

As a side effect of #11855 ATS is now unable to start as root:

traffic_manager uses ImpersonateUser() to drop privileges triggering the following syscalls:

450941 setgroups(1, [123])              = 0
450941 setresgid(-1, 123, -1)           = 0
450941 setresuid(-1, 118, -1)           = 0

afterwards traffic_server attempts to drop privileges as well but setgroups fails due to lack of permissions:

450952 setgroups(1, [123])              = -1 EPERM (Operation not permitted)

Activity

  1. jvgutierrez commented on Nov 15, 2024

    @jvgutierrez
    MemberAuthor
    -  if (initgroups(pwd->pw_name, pwd->pw_gid) != 0) {
    -    Fatal("switching to user %s, failed to initialize supplementary groups ID %ld", pwd->pw_name, (long)pwd->pw_gid);
    +  if (geteuid() == 0) {
    +    if (initgroups(pwd->pw_name, pwd->pw_gid) != 0) {
    +      Fatal("switching to user %s, failed to initialize supplementary groups ID %ld", pwd->pw_name, (long)pwd->pw_gid);
    +    }

    could be a potential solution for this, @maskit what do you think?

  2. maskit commented on Nov 15, 2024

    @maskit
    Member

    Oh, traffic_manager... Yeah, it's an oversight and there was no intention to make ATS unable to start as root. Would you make a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions