Установка и настройка Key Management Service (KMS) в корпоративной среде Windows Server 2008/Windows Vista – Про ИТ и не только

Основные приемы работы с key management service (kms) на windows 7 и windows server 2008 r2 – блог it-kb

imageДля изучения вопроса пришлось ознакомится с документами размещенными на узле TechNet Library – Volume Activation
Из всего перечитанного можно отметить два самых содержательных и подробных гайда:

Руководство по планированию развертывания Volume Activation ОС Windows 7 и Windows Server 2008 R2
(
Скачать: Volume Activation Planning Guide_Windows7.docx)
Опубликовано: июнь 2009.

Руководство по развертыванию Volume Activation ОС Windows 7 и Windows Server 2008 R2
(
Скачать: Volume Activation Deployment Guide_Windows7.docx)
Опубликовано: июнь 2009 г.

Русскоязычные версии гайдов можно найти по ссылке
TechNet Library > Deployment > Volume Activation > Localized Content

В данном посте тезисно выжаты основные важные моменты из документации.
Сразу хочу отметить что приемы работы с публикацией KMS в DNS для последующей авто-активации клиентов рассматриваться не будет.

Поднятие сервера KMS

По ряду субъективных причин я изначально решил отказаться от публикации SRV записей службы KMS в DNS.
Для того чтобы ограничить круг общения возможных клиентов с нашим KMS сервером можно использовать несколько разных способов.
В нашем примере это будет самый примитивный способ – явное указание на клиенте полномочного KMS сервера с последующей активацией “в рукопашную”.

На сервере, который мы выбрали для роли KMS отключаем авто-публикацию сервиса в DNS и затем выполняем установку KMS ключа многократной установки командами:

Slmgr.vbs /cdns
Slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX


На самом деле утилита Slmgr представляет собой ничто иное как обычный vbs скрипт (также его называют “сценарий диспетчера лицензий”), посредствам которого и происходят все манипуляции со службой управления ключами как на KMS сервере, так и на клиенте.
Slmgr.vbs может использовать Wscript.exe или Cscript.exe, а администраторы могут указать, какой обработчик сценариев необходимо использовать. Если обработчик сценариев не указан, Slmgr.vbs запускается с помощью обработчика сценариев по умолчанию wscript.exe

После ввода ключа мы должны авторизовать наш сервер в Microsoft, для чего на период активации должен быть обеспечен прямой выход в интернет. Активируем KMS сервер через интернет командой:

Slmgr.vbs /ato

После того как мы получим сообщение об успешной активации, перезапускаем службу Software Licencing Service:

net stop sppsvc
net start sppsvc

Теперь наш сервер готов активировать клиентов (разумеется нужно учесть необходимость набора порога активаций, об этом далее в выдержках из документации).

Основные моменты в работе службы KMS

Для активации KMS необходимо, чтобы сеть соответствовала требованиям порога активации или превышала его (порог активации — это минимальное количество соответствующих компьютеров, которое требует служба KMS). Узлы KMS активируют клиентов только по достижении этого порога.
Для компьютеров, работающих под управлением ОС Windows Server 2008 или Windows Server 2008 R2, порог активации составляет 5.
Для компьютеров, работающих под управлением ОС Windows Vista или Windows 7, порог активации составляет 25.
Volume Activation Planning Guide_Windows7 (стр.8)

Активации KMS действительны в течение 180 дней. Этот период называется сроком действия активации.
Чтобы оставаться активированными, клиенты KMS должны обновлять активацию, выполняя подключение к узлу KMS как минимум каждые 180 дней.
По умолчанию клиентские компьютеры KMS выполняют обновление активации каждые семь (7) дней, если попытка активации KMS не удалась,
клиент будет повторять ее через каждые два часа. После обновления клиентской активации отсчет срока действия активации начнется заново.
Volume Activation Planning Guide_Windows7 (стр.9)

Каждый ключ KMS может быть установлен на не более чем шести узлах KMS
Volume Activation Planning Guide_Windows7 (стр.11)

Использовать ключ MAK рекомендуется для компьютеров, которые редко или никогда не подключаются к корпоративной сети, а также для сред,
в которых количество физических компьютеров, требующих активации, не соответствует пороговому значению активации KMS.
MAK может использоваться для отдельных компьютеров или с образом, который может быть дублирован или предоставлен для загрузки с помощью решений развертывания Майкрософт. MAK также может использоваться на компьютере, который первоначально был настроен на использование активации KMS.
Это полезно для перевода компьютера из основной сети в отключенную сеть.
Volume Activation Planning Guide_Windows7 (стр.12)

Настройка брандмауэра на сервере KMS : разрешить входящие подключения RPC через TCP (порт TCP 1688)
Volume Activation Planning Guide_Windows7 (стр.14)

Если виртуальный узел KMS будет перемещен на другой узловой компьютер, операционная система обнаружит изменение на выделенном оборудовании
и потребуется повторная активация узла KMS с помощью корпорации Майкрософт. Узлы KMS могут активироваться в корпорации Майкрософт до девяти раз
Volume Activation Planning Guide_Windows7 (стр.16)

Чтобы проверить правильность настройки узла KMS, проверьте счетчик KMS на предмет возрастания значений.
В окне командной строки на узле KMS введите

Slmgr.vbs /dli

для отображения текущего счетчика KMS
Volume Activation Deployment Guide_Windows7 (стр.16)

Отключение публикации записей SRV KMS на DNS.
Узлы KMS автоматически публикуют свое существование путем создания записей SRV в DNS.
Чтобы отключить авто-публикацию DNS узлом KMS, используйте сценарий

Slmgr.vbs /cdns

Volume Activation Deployment Guide_Windows7 (стр.15)

Основные приемы работы с клиентами KMS

Администраторы могут вручную назначить узел KMS клиентам KMS с помощью кэша узла KMS. Назначение узла KMS вручную отключает авто-обнаружение KMS на клиенте KMS. Узел KMS назначается вручную клиенту KMS путем запуска следующей команды:

Slmgr.vbs /skms <value>:<port>

где value является KMS_FQDN, IPv4Address или NetbiosName узла KMS, а port — порт TCP на узле KMS.

На клиентах с поддержкой WinRM (WS-Management) при желании можно выполнить данную команду удаленно, выглядеть это будет примерно так:

winrs -r:Computer cscript %systemroot%system32Slmgr.vbs /skms <value>:<port>

Если функция автообнаружения отключена, она может быть повторно включена путем выполнения команды:

Slmgr.vbs /ckms

Volume Activation Deployment Guide_Windows7 (стр.18-19)

При создании демонстрационных виртуальных компьютеров для внутреннего использования (например, создание виртуальных компьютеров для отделов продаж организации или для создания временной обучающей среды) можно выполнить запуск сценария для того чтобы продлить льготный период на 30 дней

:/>  Western digital синий зеленый черный и зеленые цветные отличия

Slmgr.vbs /rearm

что в свою очередь сбрасывает таймер активации, но не вызывает никаких изменений на компьютере.
Можно сбрасывать таймер активации три раза для компьютеров под управлением Windows 7 или Windows Server 2008 R2.
Volume Activation Deployment Guide_Windows7 (стр.21)

Для активации клиентов KMS вручную (например, отключенных клиентов) до их распределения пользователям используйте элемент системы панели управления или запустите в командной строке с повышенными правами:

Slmgr.vbs /ato 

Сценарий Slmgr.vbs сообщает об ошибке или успешном выполнении активации с предоставлением кода результата.
Для выполнения активации клиент KMS должен иметь доступ к узлу KMS в сети организации.
Volume Activation Deployment Guide_Windows7 (стр.22)

Примечание:
По умолчанию, для активации используются исходящие соединения от клиента к серверу KMS по порту TCP 1688

Для преобразования существующих клиентов KMS в клиентов MAK достаточно установить ключ MAK.
Аналогичным образом, для преобразования клиентов MAK в клиентов KMS запустите следующую команду:

Slmgr.vbs /ipk <KmsSetupKey>

где KmsSetupKey — один из нижеперечисленных ключей установки:

Windows 7

Windows 7 ПрофессиональнаяFJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
Windows 7 Профессиональная NMRPKT-YTG23-K7D7T-X2JMM-QY7MG
Windows 7 Корпоративная 33PXH-7Y6KF-2VJC9-XBBR8-HVTHH
Windows 7 Корпоративная NYDRBP-3D83W-TY26F-D46B2-XCKRJ
Windows 7 Корпоративная EC29WB-22CC8-VJ326-GHFJW-H9DH4


Windows Server 2008 R2

После установки ключа установки KMS выполните активацию клиента KMS путем запуска Slmgr.vbs /ato
Volume Activation Deployment Guide_Windows7 (стр.23)

Примечание:
Это перечень предопределенных ключей, выставленных компанией Microsoft в публичный доступ. Эти ключи пригодны только для преобразования клиентов KMS в клиентов MAK.

Чтобы отключить автоматическую активацию клиента KMS(MAK), установите значение Manual для значения реестра DWORD на 1.
Это значение находится в подразделе реестра HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionSoftwareProtectionPlatformActivation
Volume Activation Deployment Guide_Windows7 (стр.33)

Отключение уведомлений об активации

Хотя данное действие не рекомендуется, отключить уведомления об активации можно, добавив новое значение реестра DWORD с именем NotificationDisabled
и установив для него значение 1. Это значение создается в подразделе реестра HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionSoftwareProtectionPlatformActivation.
Это значение отключает все уведомления о лицензировании, включая выноски, мастеры, а также диалоговые окна задач.
Volume Activation Deployment Guide_Windows7 (стр.35)

Using a Key Management System Helps You Achieve and Maintain Compliance

Compliance is essential. Whether your business falls in the healthcare sector or you’re an ecommerce business that accepts online credit card payments, remaining compliant with regulations and laws is non-negotiable — you have to do it if you want to keep your doors open.

But compliance isn’t a one-and-done kind of thing; it requires ongoing efforts, audits, and other security processes to prove you’re doing what you’re supposed to do in terms of securing sensitive data. A crucial part of this is keeping your keys secure.

Implementing a KMS Keeps Your Data and Systems Secure

We’re pretty sure we don’t need to explain why it’s important to secure your data. If you’re like most organizations, the fact of the matter is that you have cryptographic keys in use across all of your IT environments, including:

  • Virtual environments and testing servers,
  • Email servers, file servers and databases,
  • Website and web apps, and
  • Private and public clouds.

Adopting a KMS as Part of Your Key Management Strategy Increases Efficiency

Implementing a key management service can help you streamline your organization’s key management tasks. Rather than having to dedicate part of your IT team to handle everything relating to key lifecycle management tasks — generating, deploying, using, managing, and destroying keys — you can free up these personnel assets to focus on other critical functions.

Implementing a Key Management Service Helps You Mitigate Costs

Manually managing your keys can be a nightmare. It costs loads of money in terms of time, IT resource investments, and employing knowledgeable and skilled personnel. This can run up a high tab in no time.

Furthermore, manually managing your keys is a poor key management practice because it can result in one or more keys falling by the wayside and increase your attack surface as a shadow IT asset. As you can imagine, this can result in a litany of direct and indirect costs:

  • Non-compliance fines and penalties,
  • Harm to your brand and reputation,
  • Damaged customer relationships,
  • Lost revenue and future sales opportunities,
  • Costs associated with responding to and recovering from a data breach,
  • Costs associated with informing customers about any security incidents your mitigation strategy,
  • Other financial consequences such as lawsuits and settlements.

A lost or stolen cryptographic key can devastate a company — that’s why many companies choose to use key management services to protect and secure their organization’s sensitive assets

When you’re out and about, there’s virtually no worse feeling than reaching into your pocket or purse and discovering that your keys are missing. The realization hits you like a ton of bricks, and you’re left asking two important questions: where did you leave them? And what happens if someone untrustworthy finds your keys before you do?

Configure kms in windows 10

To activate, use the slmgr.vbs command. Open an elevated command prompt and run one of the following commands:

For more information, see the information for Windows 7 in Deploy KMS Activation.

Effective key management matters more than encryption

Wait, what? We’re a company that lives and breathes everything encryption — why are we saying that something’s more important? Well, if you don’t properly manage your keys, then using those keys to encrypt your data won’t do you any good.

Encrypting data with compromised keys is a pointless endeavor — bad guys can just use the compromised asset to decrypt your data. Using a compromised key for encryption is the equivalent of using a lightweight puzzle box to secure your most valuable possession.

Hardware security modules

A hardware security module is typically a physical piece of hardware that handles key storage and cryptographic functions at scale. (There are some cloud HSMs available as well but the term HSM typically refers to the physical devices.) An HSM is a secure environment that allows you to handle key lifecycle management operations and offload many cryptographic operations as well. (This way, you’re not overburdening your servers and other systems.)

:/>  USB драйвер скачать на Windows 10 бесплатно

HSMs can be stored as online or offline devices (depending on how you choose to use them). For example, public certificate authorities use offline HSMs to store their root CAs to keep them as secure as possible. But some companies use online HSMs to store their private PKI’s intermediate CA keys.

HSM devices typically are offered with one of several Federal Information Processing Standards (FIPS) certified ratings from level 1 to level 4 (with 4 being the highest). The HSMs that many key management systems rely on are typically rated at FIPS 140-2 level 2 or better.

Key management service in earlier versions of windows

If you have already established a KMS infrastructure in your organization for an earlier version of Windows, you may want to continue using that infrastructure to activate computers running Windows 10 or Windows Server 2022 R2. Your existing KMS host must be running Windows 7 or later. To upgrade your KMS host, complete the following steps:

  1. Download and install the correct update for your current KMS host operating system. Restart the computer as directed.
  2. Request a new KMS host key from the Volume Licensing Service Center.
  3. Install the new KMS host key on your KMS host.
  4. Activate the new KMS host key by running the slmgr.vbs script.

For detailed instructions, see Update that enables Windows 8.1 and Windows 8 KMS hosts to activate a later version of Windows and Update that enables Windows 7 and Windows Server 2008 R2 KMS hosts to activate Windows 10.

Key management service in windows server 2022 r2

Installing a KMS host key on a computer running Windows Server allows you to activate computers running Windows Server 2022 R2, Windows Server 2008 R2, Windows Server 2008, Windows 10, Windows 8.1, Windows 7, and Windows Vista.

[!NOTE] You cannot install a client KMS key into the KMS in Windows Server.

This scenario is commonly used in larger organizations that do not find the overhead of using a server a burden.

[!NOTE] If you receive error 0xC004F015 when trying to activate Windows 10 Enterprise, see KB 3086418.

Key management service in windows 10

Installing a KMS host key on a computer running Windows 10 allows you to activate other computers running Windows 10 against this KMS host and earlier versions of the client operating system, such as Windows 8.1 or Windows 7.
Clients locate the KMS server by using resource records in DNS, so some configuration of DNS may be required.

This scenario can be beneficial if your organization uses volume activation for clients and MAK-based activation for a smaller number of servers.
To enable KMS functionality, a KMS key is installed on a KMS host; then, the host is activated over the Internet or by phone using Microsoft activation services.

Kms vs kms vs kmass

Key management services, key management systems and key management-as-a-service (KMaaS) are three terms that often refer to the same thing. While there are some technical differences, these terms are often used interchangeably to refer to systems (usually cloud based) for managing cryptographic keys.

(Remember how we’ve mentioned before in our articles that companies use the terms SSL and TLS interchangeably even though they’re technically different? Yeah, that same line of thinking applies here.)

Protecting your keys is essential to pki security

Practicing good key management is integral to the security and usefulness of your organization’s public key infrastructure. PKI is, basically, the backbone of online security. PKI relies on cryptographic tools known as digital certificates and keys, which allow you to do everything from verifying your identity during logins to protecting your customers’ data in transit as it leaves their browser and transmits to your web server.

As such, cryptographic keys exist throughout your network and larger IT environment. They often operate in the background, unseen by your customers by offering them security all the same. These tools help you facilitate secure authentication and data encryption.

Of course, we’re not going to go into all of the technical details of PKI here as the topic is a bit of a rabbit hole and will take us off-track from the topic at hand. So, be sure to check out these two articles to learn more about what PKI is and how PKI works.

Verifying the configuration of key management service

You can verify KMS volume activation from the KMS host server or from the client computer. KMS volume activation requires a minimum threshold of 25 computers before activation requests will be processed. The verification process described here will increment the activation count each time a client computer contacts the KMS host, but unless the activation threshold is reached, the verification will take the form of an error message rather than a confirmation message.

[!NOTE] If you configured Active Directory-based activation before configuring KMS activation, you must use a client computer that will not first try to activate itself by using Active Directory-based activation. You could use a workgroup computer that is not joined to a domain or a computer running Windows 7 or Windows Server 2008 R2.

To verify that KMS volume activation works, complete the following steps:

  1. On the KMS host, open the event log and confirm that DNS publishing is successful.

  2. On a client computer, open a Command Prompt window, type Slmgr.vbs /ato, and then press ENTER.

    The /ato command causes the operating system to attempt activation by using whichever key has been installed in the operating system. The response should show the license state and detailed Windows version information.

  3. On a client computer or the KMS host, open an elevated Command Prompt window, type Slmgr.vbs /dlv, and then press ENTER.

    The /dlv command displays the detailed licensing information. The response should return an error that states that the KMS activation count is too low. This confirms that KMS is functioning correctly, even though the client has not been activated.

:/>  Как установить Windows 10 с флешки — пошаговая инструкция

For more information about the use and syntax of slmgr.vbs, see Slmgr.vbs Options.

What does a key management service do?

A KMS is a form of secrets management that helps you manage keys and their meta data. It can deploy on-prem or in the cloud (depending on your chosen platform and vendor). The goal of using one of these systems is to help you keep all of your cryptographic keys as secure as possible. It does this in several ways (depending on which KMS you use):

  • Creating secure keys that protect your data. A great KMS enables you to generate keys that have sufficient entropy (randomness). Every key is a string of hexadecimal characters — the more random the order, the harder it is to crack.  
  • Giving you visibility to view and monitor keys. A KMS is a tool that enables you to discover any key within your environment — even those not created in the KMS. If you know what keys you have and where they’re deployed, then you’ll be able to properly manage them. (No more rogue keys!)
  • Allowing you to set permissions. Effective key management entails knowing who has access to which keys and why they’re using them.
  • Helping you securely store your keys. Secure key storage is a critical component of virtually every KMS, which is why many of these systems use hardware security modules (HSMs) — more on that shortly. If you don’t store your keys securely, they could become lost or stolen, which can result in data compromise.
  • Enabling you to use keys without needing direct access to them. Some key management services enable you to use your keys to digitally sign data without requiring access to the plaintext keys.
  • Providing you with a way to back up and archive keys. Rather than trying to handle key backups and escrows one a one-by-one basis, you can automate the process.
  • Allowing you to automatically rotate SSH keys. Some key management systems offer automation. This means you can automatically rotate your SSH keys for increased security on web servers.
  • Enabling you to import existing keys. Some key management services enable you to bring your own keys (BYOK) by importing them from your computers, servers, devices, and/or on-prem HSM to their cloud environment.

The National Institute of Standards and Technology says that while keys can be managed manually, some circumstances may require the use of an automated system (i.e., key management system).

What’s the difference between a kms and an hsm?

People often confuse HSMs with key management services. And while they’re related, they’re still separate in terms of their individual functionalities. Here’s a quick summary of the differences between a KMS and an HSM:

Проверка

Указываем клиенту сервер KMS:

slmgr.vbs /skms KMS-Server

На клиентах можно проверить, какой сервер является KMS:

nslookup -type=srv _vlmcs._tcp.domain.local

где domain.local Ваш домен.

или

slmgr.vbs /dlv

На сервере KMS просмотр по всем стостоянимя лицензий:

slmgr.vbs /dli all

What is a key management service? a kms definition

A key management service (KMS) is a system for securely storing, managing, and backing up cryptographic keys. Of course, the specific types of keys that each KMS supports vary from one platform to another. Most key management services typically allow you to manage one or more of the following secrets:

  • SSL certificate private keys
  • SSH key pairs
  • API keys
  • Code signing private keys
  • Document signing private keys
  • Database encryption keys

Key management services are designed to help you avoid a key being lost or stolen (which could result in a data breach, downtime, or data loss). Features vary a bit between different solutions, but most key management services include at least these capabilities:

  1. Web-based interface for managing your cryptographic keys.
  2. Secure storage and backup of private keys (typically on a hardware security module, or HSM — we’ll speak more to that in a bit).
  3. APIs and/or plugins to integrate the KMS with your servers, software, and systems.

Final takeaways on the importance of key management services

Alright, you’ve stuck with us this long. Now, it’s time to drive home the biggest point of all. Whether you’re looking to use a key management tool to manage your keys in-house or you opt to work with a key management service provider, the important thing is to ensure you’re properly managing your cryptographic key lifecycles.

Poor key management reflects negatively on your brand and results in far-reaching financial damages. As such, it’s important that you take the time now to assess your organization’s existing key management practices and tools to ensure you have your ducks in a row. Here are a few related resources that we think you’ll find beneficial:

Оставьте комментарий