liveBook · Manning

Impersonate permission

As explained in 100 SQL Server Mistakes and How to Avoid Them

An impersonate permission allows a principal to execute under the security context of another database or server security principal.

An impersonate permission lets a principal execute under another database or server security principal. Its danger is easy to miss: administrators may monitor sysadmin membership while overlooking direct CONTROL SERVER grants or permission to impersonate a powerful principal. section 14.4

Mistake: treating xp_cmdshell access as equivalent to sysadmin membership.

  • Running xp_cmdshell can require sysadmin, CONTROL SERVER, EXECUTE permission through an xp_cmdshell proxy, or permission to impersonate a principal meeting those requirements. section 14.4
  • Audit direct grants and impersonation paths, not only sysadmin membership; otherwise an opaque permission can provide lateral movement toward the operating system. section 14.4
Lateral movement

Use the lateral-movement figure to connect hidden impersonation paths with operating-system access. section 14.4

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Explains xp_cmdshell prerequisites and opacity, but stops short of showing impersonation implementation commands.
Examples
Uses xp_cmdshell access, direct CONTROL SERVER grants, and an xp_cmdshell proxy as risk examples.
What you can do after
Evaluate security exposure by checking direct grants and impersonation paths alongside sysadmin membership.
How it connects
Connects impersonate permission to xp_cmdshell, CONTROL SERVER, sysadmin, xp_cmdshell proxy, and lateral movement.

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.