skip to content

On a shared terminal-server address, how do you attribute one flow to one user?

level: seniorimportance: nice to knowfreq 34%

answer

  1. one address, three hundred people
  2. identity below the address, not at it
  3. the source port is the discriminator
  4. a translation hop voids the whole scheme
  5. a foothold on the host inherits a name

basics

~20 s

An agent on the host gives each session its own source-port range and reports which range belongs to which user. The firewall attributes a flow by source port, not address; anything outside a range maps to nobody.

solid answer

~50 s

Address-level mapping is useless here, because hundreds of sessions share one source address. The only workable answer is sub-address attribution: an agent on the multi-user host allocates a distinct source-port range to each session and reports the range-to-user bindings to the enforcement point, which resolves a flow by matching its source port into a range. The prices are concrete. You must run and version-match that agent on every multi-user host, and any host you cannot install on is a permanent blind spot. The ranges consume ephemeral port space, so a loaded host can exhaust them. Anything outside a range - a service account, a scheduled task - maps to no user and lands on the unknown-user rule. Any device between host and firewall that rewrites source ports voids the scheme silently. And an intruder with a foothold on that host inherits whichever session's range they use, so your log names a real employee for their traffic.

code

text · 7 lines
text
address       user           source   learned    expires    src-port-range
10.44.7.19    s.okafor       agent     09:02:11   09:47:11   20480-21503
10.44.7.19    j.lindqvist    agent     09:03:40   09:48:40   21504-22527
10.44.7.19    m.oyelaran     agent     09:05:02   09:50:02   22528-23551
...
# a flow from 10.44.7.19:51402 falls in no allocated range
# -> no user -> the unknown-user rule decides it

go deeper

for a junior

Know that many users can share one source address on a terminal server or virtual desktop, so an address-level user mapping cannot tell them apart.

for a middle

Explain how per-session source-port ranges give sub-address attribution, and what falls outside them: service accounts, scheduled jobs and anything with no interactive session.

for a senior

Show you check for translation hops in the path before trusting the scheme, plan for port-range exhaustion, and treat attribution on a shared host as resting on that host's session isolation rather than on the network.

for a principal

Be ready to say where you accept a shared host with no attribution at all, and what you demand in exchange - tighter host-level rules, or an explicit statement that its logs cannot name individuals.

## Why the address is not enough A virtual-desktop or terminal-server farm collapses hundreds of people onto a handful of source addresses. A mapping table keyed on address can hold exactly one name per address, so the question is not *which user is on 10.44.7.19* - it is *which of the three hundred users on 10.44.7.19 opened this particular connection*. Everything the leaf turns on follows from that: identity has to be carried at a finer granularity than the address, or it is not carried at all. ## Source-port-range attribution The standard mechanism is to slice the host's ephemeral port space. An agent running on the multi-user host: 1. detects a session starting and which user owns it 2. reserves a block of source ports for that session and constrains the session's outbound connections to it 3. reports the binding (address, port range, user, session) to the enforcement point 4. releases the block when the session ends The firewall then attributes a flow by looking up its **source port** inside the ranges bound to that address. Two people on the same host get different rules because their connections are born in different port blocks. An abridged table looks like this: (see the accompanying fragment) ## What defeats it **A source-port rewrite anywhere in between.** If any device between the host and the enforcement point performs address or port translation, the ports the firewall observes are not the ports the agent allocated. Attribution does not merely degrade - it can land a flow inside the *wrong* user's range, which is worse than no answer, because the log now confidently names an innocent person. The enforcement point must sit on the same side of any translation as the port allocation, or the translating device itself must carry the identity forward. **Traffic that never had a session.** A scheduled task, a backup job, a monitoring agent or anything running as a machine or service account has no interactive session, therefore no allocated block, therefore no user. Those flows come from unallocated ephemeral ports and fall to the unknown-user rule. In practice this is the traffic that first exposes whatever your unknown-user posture really is, and it should be handled with explicit rules of its own instead of being left to the catch-all. **Exhaustion and churn.** A block per session is a finite resource. A host with a larger shift than the port space was provisioned for will fail to allocate, and the sessions that miss out are attributed to nobody. Long-lived sessions that outlive an allocation, and reconnects that pick up a recycled block, both produce brief windows where the binding and reality disagree. **Hosts you cannot instrument.** The mechanism requires software on the host. An appliance-like multi-user system, a vendor-managed jump host or anything outside your build pipeline gives you one address and no names at all. ## The adversary this is really about Sub-address attribution improves policy, but it does not authenticate anything. It reports what the host says about its own sessions. An intruder who obtains execution on that shared host - through a hijacked session, a stolen desktop token, or simply another account on the same box - makes connections that fall inside some allocated range, and the enforcement point applies **that user's** permissions and writes **that user's** name into the record. The firewall has no way to disagree; it never saw a person, only a port number and a claim. The consequences for you are two: - **Policy.** The blast radius on a multi-user host is the union of what any session on it may reach, unless you also constrain the host itself. Treat a shared host as a place where a foothold buys somebody else's entitlements, and size the rules for that. - **Evidence.** A firewall log naming a user for traffic from a shared host is a derived claim resting on the host's own session isolation. Before that name goes into a report, corroborate it against the host's session records. If you cannot, say so plainly rather than letting the log carry more weight than it can hold. ## What you are buying The honest summary: you deploy and maintain an agent everywhere, spend ephemeral port space, accept blind spots on hosts you cannot instrument, and accept that the whole scheme is void behind a translation hop - and in return you get user-level policy and user-level logging on the machines where the largest number of people share the fewest addresses. On a farm serving shift workers, that trade is usually worth making. It is only dangerous when somebody forgets it is a trade and starts treating the resulting log line as proof.

  • The terminal server sits behind a translation hop before it reaches the firewall. What happens to your attribution?
    It breaks silently. The translating device rewrites source ports, so the numbers the firewall sees are not the ones the agent allocated. Flows either match no range and fall to the unknown-user rule, or worse, land inside another user's range and get their rules and their name. Either put the enforcement point on the host side of the translation, or make the translating device the thing that carries identity forward.
  • An intruder has a foothold on the shared host. What will your firewall log say they did?
    It will name whichever user owns the port range their connections came from. The enforcement point only ever saw a port number and the host's claim about it, so attribution on a shared host is exactly as trustworthy as that host's session isolation. Treat the log as a lead, corroborate against the host's own session records, and expect the policy blast radius to be whatever any session on that host may reach.
  • Your monitoring and backup jobs on that host produce a constant stream of unattributed flows. How do you handle them?
    Give them explicit rules rather than leaving them on the catch-all. Machine and service traffic has no interactive session and will never be attributed, so write address-and-destination rules for the known jobs and keep the unknown-user rule reserved for genuine surprises. Otherwise the catch-all is carrying production, and you can no longer change it without an outage.

saying these in an interview costs you the question

  • Assumes one address maps to one user on a terminal server
  • Believes allocated port ranges survive an intervening translation hop
  • Forgets service and machine traffic has no session and no user
  • Treats a firewall log name as identifying the human on a shared host
  • Never considers ephemeral port exhaustion on a busy host

context