EGR052 - Username Maps to a System Account
Agent error code #EGR052 indicates that the account the knoc's mapping gave is root, a system or built-in account with a uid or RID below 1000, or the account the Knocknoc agent runs as. Egress allowlisting never grants those.
On Linux and OpenBSD, uids below 1000 belong to the system: services, daemons and root. People's accounts start at 1000, which is where useradd and most directories begin. On Windows the same limit applies to the RID, the last number of the account's SID, which refuses Administrator, Guest and the other built-in accounts. The limit stops a mapping, or a Knocknoc username that matches a system account, from opening a fenced destination to a service. On Linux and OpenBSD, root and the agent's own account are never fenced, so a grant to either would change nothing. On Windows the agent runs as SYSTEM (S-1-5-18), which the RID limit refuses.
Common causes include:
- A Knocknoc user is named after a system or built-in account, such as
root,www-data,Administrator,Guestor the agent's account - A rule's template, or an account name sent by the identity provider, gives one of those names
- People's accounts on this host were created below 1000, for example with
useradd -ror by an older directory that numbered from 500
Steps to Resolve
Find the Account
- Note the account named in the error
- Check its uid:
id -u <account>. On Windows, look it up as the Windows egress guide's Checking an Account section shows: the RID is the last number of the SID it prints
Give the Person Their Own Account
People should log in to the bastion with their own account, with a uid or RID of 1000 or higher. Create one, or renumber the account, and adjust the knoc's mapping so it gives that account.