R306 On a local device, inject a service account’s token only into its unattended tasks
On a local device, let a service account’s token reach only the environment of the unattended tasks there, never a login shell.
Reason
On a local device reads go through a route the person unlocks (rule 304). A token in a login shell would reach everything run there, and reads that should wait for the person could go through the token instead. Injected into the unattended tasks alone, it can leak only through them.
Verification
Local devices are as rule 304 defines them. A login shell is the shell that a person or an agent gets on logging in to a machine, together with its startup files and every process started from it. On a remote machine (rule 305) this rule does not limit which shell the token reaches.
Violated when, on a local device, a service account’s token is set in a login shell’s startup files or environment, or reaches the environment of a process other than the unattended tasks it is given to.