Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Machine Key generation feature not exist in latest IIS Version

Tags:

asp.net

iis

Answering one of the recent question on SO, i encountered this anomaly.

This msdn blog suggests using IIS to generate machine key, which looks more secure to me as Microsoft tool being used. However, it seems this feature is only supported until IIS 7 or less.

I don't find it on my box IIS 8.5. I checked on IIS 7.5 and its not present there either. However, I found it in IIS 6.1 on a coworker box.

I am wondering whether:

  1. It still exist in IIS latest versions, if yes, how to use it?

  2. If it is removed from latest version of IIS, what's suggested approach from Microsoft to generate a secure enough machine key?

  3. Is it safe to use these custom generators?

    a. Machine Key Generator (online)

    b. ASP.NET machineKey Generator (tool you can modify)

like image 912
SBirthare Avatar asked Aug 13 '14 05:08

SBirthare


People also ask

Where is IIS machine key stored?

Managed via the IIS Manager the generated key is stored in the <machineKey> element in the machine. config and must be kept in sync across all nodes of a Web Server Farm.

What is the use of machine key in IIS?

Use the Machine Key feature page to configure hashing and encryption settings used for application services, such as view state, Forms authentication, membership and roles, and anonymous identification. Machine keys are also used to verify out-of-process session state identification.


3 Answers

I know I came to very late to provide this answer. Hope this helps for any others.

I'm using the latest IIS 10(which is the latest)

By default, the Machine Key feature is not installed when enabling the Internet Information Service in the windows features.

You need to install ASP.NET XX from the World Wide Web Service

enter image description here

After installing this, you can generate your keys from the Machine Key Option.

like image 103
Jayendran Avatar answered Oct 21 '22 15:10

Jayendran


As for mentioned by @ryanulit, you can just copy the script directly to your PowerShell window

Steps :

  1. Open powershell window (anywhere is fine)
  2. Copy the script from the microsoft link and paste in your powershell window and press enter
  3. Type Generate-MachineKey -validationAlgorithm SHA1
  4. That's it. Your machine key description will show up in the window. PowerShell image sample from my PC

Script Link from Microsoft http://support.microsoft.com/kb/2915218#AppendixA

like image 40
hongguan Avatar answered Oct 21 '22 15:10

hongguan


See https://support.microsoft.com/kb/2915218#AppendixA for information on how to generate a <machineKey> element. There's a script there that you can copy & paste into a Powershell window.

Reminder: only use keys that you generated yourself on your own machine. Never use an online generator.

like image 10
Levi Avatar answered Oct 21 '22 14:10

Levi