Create a Windows user for an IIS site and nothing else

1.3k Views Asked by At

I'd like to add basic authentication to a website in IIS, https only. For this I need to create a Windows user. It is important that this user can access nothing other than this website. So I need to add him to Deny log on locally & Deny log on through Remote Desktop Services in Local Computer Policy.

However I cannot add him to Deny access to this computer from the network or he can't access the website. Microsoft says about this permission:

Users who can log on to the device over the network can enumerate lists of account names, group names, and shared resources.

Users with permission to access shared folders and files can connect over the network and possibly view or modify data.

What can I do to create a user that I can be 100% sure can only access this website and absolutely nothing else?

2

There are 2 best solutions below

3
Mark J On

To address your concern about the "Deny access to this computer from the network" policy, that shouldn't prohibit the account from be used to authenticate with the website since "access from the network" doesn't include the HTTP/S protocol and WWW service. Therefore, you can add the basic auth user account to the "deny access" policy as desired.

Sources...

https://www.itprotoday.com/compute-engines/understanding-access-computer-network-user-right

"Despite the broad-sounding name, the 'Access this computer from the network' user right applies only to the Server service and the resources it provides. The Server service primarily provides remote access to files and printers but also provides remote access to the resources you see in the Microsoft Management Console (MMC) Computer Management snap-in, including event logs, shared folders, local users and groups, logical disk management, and applications that use named pipes. However the Access this computer from the network user right has no effect on services such as World Wide Web Publishing, Telnet, and Terminal Services. To control access to these services, you must implement security settings specific to each service as necessary."

https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/access-this-computer-from-the-network

"The Access this computer from the network policy setting determines which users can connect to the device from the network. This capability is required by a number of network protocols, including Server Message Block (SMB)-based protocols, NetBIOS, Common Internet File System (CIFS), and Component Object Model Plus (COM+)."

Hope this helps.

4
K. Frank On

Maybe you should use another account type. User account type should only be used for real humans (and for buggy applications).

https://learn.microsoft.com/en-us/windows/security/identity-protection/access-control/service-accounts

https://learn.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities