Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 1.86 KB

File metadata and controls

64 lines (50 loc) · 1.86 KB

Details

cWebAuthentication enables or disables Windows, basic, or anonymous authentication for IIS sites and applications.

  • Location: The IIS site location
  • Type: Anonymous, Basic, or Windows
  • Ensure: Present or Absent

cKeyContainer imports or deletes RSA keypairs used for configuration encryption and decryption. Keypairs are imported from an XML file using aspnet_regiis.exe -pi. This XML file is generated by calling aspnet_regiis.exe -px (outside of this module).

  • ContainerName: The name of the RSA key container
  • FilePath: The path to the XML file containing the keypair
  • Ensure: Present (import) or Absent (delete)

cKeyContainerAccess adds or remove access to a RSA keypair container. It uses aspnet_regiis.exe -pa and aspnet_regiis.exe -pr

  • ContainerName: The name of the RSA key container
  • Accounts: The path to the XML file containing the keypair
  • Ensure: Present (add access) or Absent (remove access)

Example: Configuring anonymous and Windows authentication

# Turn on anonymous for root
cWebAuthentication RootAnonymous
{
	Location = ""
	Type = "Anonymous"
	Ensure = "Present"
}


# Turn on Windows Auth for Contoso
cWebAuthentication ContosoWindowsAuth
{
	Location = "Contoso"
	Type = "Windows"
	Ensure = "Present"
}


# Turn OFF Windows Auth for Contoso/SubApp
cWebAuthentication ContosoWindowsAuth
{
	Location = "Contoso/SubApp"
	Type = "Windows"
	Ensure = "Absent"
}

Example: Importing an RSA keypair

# Import the RSA keypair
cKeyContainer SecureAppConfig
{
	ContainerName = "SecureAppConfig"
	FilePath = "\\server\exportedKey.xml"
	Ensure = "Present"
}

# Add access for the account to the conainer
cKeyContainerAccess SecureAppConfigAccess
{
	ContainerName = "SecureAppConfig"
	Accounts = "MyDomain\AppPoolUserA", "MyDomain\AppPoolUserB"
	Ensure = "Present"
}