APX CPS RM R28 Windows RSA Folder Size Increase


Symptom(s)

RM Windows RSA folder size increases. RM server is using 535GB disk space.

Issue

APX RM Device Programmer has excessive disk usage to the directory C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\Crypto\RSA\S-1-5-20.
This directory appears to have millions of files and Windows and various disk usage applications (eg. WinDirStat and TreeSize) are struggling to list the number of files or the total size.

Environment

 Radio Management version :- 2.41.271

Resolution

Root cause:
When the Device Programmer is talking to the ARS server through a secure connection, it invokes Microsoft Cryptography API to encrypt/decrypt the payload using the key that is associated with the specified certificate. To persist a key the Microsoft Cryptography API is supposed to create one or two key container files on the disk. However in certain cases, Microsoft Cryptography API keeps generating new key container files without deleting old ones. Eventually those files used up all disk space..
 
 
Workaround:
 
Option 1: Change the connection type of ARS to clear
No encryption no useless files get generated
 
Option 2: Clean useless key container files
Run Command Prompt as administrator
Run command: certutil -key -sid 24 
 
This command lists all key containers for service account Network Service
  • The output including keys used by Device Programmer and other applications
  • Network Service is the account that running the Device Programmer
  • The highlighted part is the name of key container which persists this key
 
You can delete files under 
%WINDIR%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\Crypto\RSA\S-1-5-20, if they are not listed in step 2
  • It is always recommended to backup files before deletion
Internet has a couple of solutions to remove these temporary Microsoft files as well.
example :- https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/931908