Skip to content

Added global token store and sys.tokens() eldritch function for management and enumeration#2375

Open
KS-7250 wants to merge 1 commit into
spellshift:mainfrom
KS-7250:global-tokens-store
Open

Added global token store and sys.tokens() eldritch function for management and enumeration#2375
KS-7250 wants to merge 1 commit into
spellshift:mainfrom
KS-7250:global-tokens-store

Conversation

@KS-7250

@KS-7250 KS-7250 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature
/kind eldritch-function

What this PR does / why we need it:

Adds global token store framework + function for eldritch. Manages tokens obtained from future functions like make_token and impersonate and applies them to the current session as needed.

  • sys.tokens(pid: Optional int) -> Result<Vec<BTreeMap<String, Value>>, String>

Example (from eldritch.md edits):

$> sys.tokens()

| active | id | source              |
| ------ | -- | ------------------- |
| True   | 1  | impersonate:pid:700 |

$> pprint(sys.tokens(pid=700))

[
  {
    "pid": 700,
    "privileges": [
      "SeAssignPrimaryTokenPrivilege=disabled",
      "SeIncreaseQuotaPrivilege=disabled",
      "SeTcbPrivilege=enabled",
      "SeSecurityPrivilege=disabled",
      "SeTakeOwnershipPrivilege=disabled",
      "SeLoadDriverPrivilege=disabled",
      "SeProfileSingleProcessPrivilege=enabled",
      "SeIncreaseBasePriorityPrivilege=enabled",
      "SeCreatePermanentPrivilege=enabled",
      "SeBackupPrivilege=disabled",
      "SeRestorePrivilege=disabled",
      "SeShutdownPrivilege=disabled",
      "SeDebugPrivilege=enabled",
      "SeAuditPrivilege=enabled",
      "SeSystemEnvironmentPrivilege=disabled",
      "SeChangeNotifyPrivilege=enabled",
      "SeUndockPrivilege=disabled",
      "SeManageVolumePrivilege=disabled",
      "SeImpersonatePrivilege=enabled",
      "SeCreateGlobalPrivilege=enabled",
      "SeTrustedCredManAccessPrivilege=disabled"
    ],
    "user": "NT AUTHORITY\\SYSTEM"
  }
]

Which issue(s) this PR fixes:

N/A

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant