AD RMS: Client machine activation

It’s time for client activation. As of now we have:

  • Client PC with Security Processor Certificate (SPC)
  • AD RMS server with Service Licensing Certificate (SLC)
  • Server with Active Directory Domain Service role.
  • SQL server with RMS databases.

So, client has to be activate first to start protect documents. As you remember when you installed AD RMS server role you also registered Service Connection Point. This is specially entry in Active Directory which allows clientsto identifies the connection URL for the service to the AD RMS-enabled clients.

1. Client “asks” AD DS for Service Connection Point, looks like “give me the URL where AD RMS role is hosted”. This step is very important: if client activation doesn’t happen I recommend to start first of all with “Get RMS SCP” command from AD RMS Toolkit . Here you can find some trick how to force RMS activation on client side without appropriate entry in Active Directory. The secret in client registry.

2. As the answer on client request it gets appropriate URL AD RMS Certification pipeline: https://<RMS>/certification.asmx

3. Using URL which client got on a step above, it asks RMS server for Rights Account Certificate (RAC). This request for RAC contains user’s Security Processor Certificate (SPC). Understanding AD RMS Ceritificates. 

4. AD RMS server unpack public key from user’s SPC for future purposes (step 9).

5. AD RMS server sends request to AD DS for user’s email address. Why does RMS require SMTP address for user? Why RMS require SMTP entry at least (instead of real email address in your email exchange system)? Good questions, think so? I’ll publish answer at next post, just leaving this question for you…

6. Probably this isn’t a first user’s attempt to ask for RAC, probably RMS server already had issued RAC for user earlier? RMS checks RAC for appropriate user in SQL server. The next step depends on RAC availability in SQL server: if RAC already exist server brings it back for user (not interesting case for us), otherwise server generates new RAC.

7. Server generates key pair: private and public key for RAC. The key length might be up to RSA 2048 bit if your RMS server already was patched and configured for Cryptographic Mode 2

8. AD RMS server encrypts new key pair with SLC public key and store result (BLOB) in SQL. So, next time when RMS-client asks for RAC , RMS server will bring back certificate with these public\private keys in it (see step 6).

9. Finally (for this stage) RMS generates new RAC certificate and put there:

  • public key
  • private key encrypted with user’s public key from SPC (server got this SPC public key on step#4).

Server signs RAC certificate with public key from SLC.

RAC certificate is ready to be sent to user. Done!

10. It’s time to order Client Licensor Certificate (CLC), which can be submitted only with RMS licensing web role. What the URL for this licensing role?

It is obvious from AD RMS console, but it isn’t obvious for client. Client asks for licensing URL and substitutes “Certification.amsx” in pipeline for “Publishing.asmx”

RMS COnsole2

 

11. Client asks fro CLC using URL address which it got on a step above.

12. RMS server generates key pair: public and private key for CLC, generates new certificate and put there these 2 keys:

  • public key
  • private key protected with public key from RAC. So, only RAC’s private key owner can decrypt CLC private key.

Server signs new CLC certificate with public key from SLC.

Pay attention that CLC certificate, neither keys aren’t saved in SQL, it means that RMS server generate these keys\certificate each time when client asks for them. How often it happens? Obviously not so often: when end-user uses new client PC. In the rest cases end-users uses CLC to sing Publishing license which was requested earlier.

CLS is done and ready to be sent to user back with RMS server SLC.

Congratulation. We are ready to protect and consume protected documents.

 

Machine Activation_v.1.0

 

 

AD RMS: Machine activation. Independent process.

Hello everybody.

What happens when our end-user open protected document\email? Which process happens when end-user create protected document. I think each of you have observed some delay when you first time use right protection button in RMS-aware application (e.g. Outlook, Word). So, something happen there in background, let’s look more in details on RMS activation. Hereinafter I will user WIndows 7 OS as a end-user operation system and Windows 2008R2 as RMS platform. Why do I do an accent on it? Because here some deviations (in end-user and server platforms) between operating systems versions.

1. As usually client gererates key pair – public and private keys (green and red colors accordingly). The key length is 1024 bit (RSA). And this key length parameter isn’t configurable. These key don’t use for document encryption, so, 1024 bit is more that enough. AD RMS client. secproc.dll is a library which responsible for machine activation process. “The client lockbox for the Production hierarchy.”  So, if activation doesn’t happen, be aware this file:

  • available;
  • not corrupter, or wasn’t substituted with another *.dll file.

BTW, don’t delete it. This file is a part of files which are installed with operation system (not SDK).

2. Using DPAPI (see below) client encrypts private key using user’s password.

“The Data Protection API (DPAPI) helps to protect data in Windows 2000 and later operating systems. DPAPI is used to help protect private keys, stored credentials (in Windows XP and later), and other confidential information that the operating system or a program wants to keep confidential. 

DPAPI is not responsible for storing the confidential information it protects. It is only responsible for encrypting and decrypting data for programs that call it, such as Windows Credential manager, the Private Key storage mechanism, or any third-party programs …. “

3. Client preserve final result as a BLOB in the following registry key: HKCU\Software\Classes\Local Settings\Software\Microsoft\uDRM

4. Client issues Security Processor Certificate (SPC) and put there private key. The final result is signed by client public key Done. We have selfsigned certificate 🙂

5. Final result is CERT-Machine.drm file in the following location: %LocalAppData%\Microsoft\DRM\CERT-Machine.drm

“Each certificate typically contains the following elements:

  • The issuance date and time.
  • A certificate type ID and name.
  • The name and ID of the issuer.
  • The location from which the certificate was retrieved.
  • The principal ID, public key, digest and security processor.
  • A signature created by using the private key of the AD RMS activation service.
  • A certificate chain that contains the server licensor certificate and one or more CA certificates.”

Client Bootstrapping

 

TIP1: on your computer you can easily find rmactivation.exe file, it responsible forRetrieves a machine certificate that signs the computer into the Production hierarchy. This is artificial way to do RMS activation without interaction with end-user applications (Word, Excel, etc). I recommend to use this executable file when you want to skip RMS-aware application from activation process. Just delete CERT-Machine.drm file from target folder (if it exist) and run rmactiavtion.exe.  New CERT-Machine.drm file should be created in a folder, otherwise… you have a problem. I’ve even met situations when OS had to be reinstalled because of RMS activation fails. But in fact it depends on time which you are ready to devote to solve this problem.

TIP2: I do an accent that this process is fully autonomous and doesn’t require connection with RMS server, or any other servers in your environment. If you know what happens during client activation (and hopefully after reading this article you know) than it should be clear for you.

Good luck.