• Facebook
  • Twitter
  • Youtube
  • LinkedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Try NCache
  • Contact Us
Try NCache
Show / Hide Table of Contents

User Security

Configure NCache Security to protect cache server nodes using a robust framework for authorization and authentication. This page provides comprehensive guidance on setting up authorization and authentication within the NCache Security framework for cache server nodes. It will guide you through establishing LDAP-based authentication for user verification. Moreover, it also explains how to assign users to particular roles and permissions.

Important

All the participant nodes in a cluster should have uniform security settings.

Configure LDAP-Based Security

LDAP Prerequisites for Linux

To configure and use LDAP on Linux systems, ensure you have the required LDAP utilities installed on your system. For installation instructions, please refer to the LDAP documentation.

Select Server Nodes

NCache supports LDAP-integrated security to authenticate users and groups through a domain controller. To configure security through the NCache Management Center, first select the server nodes to which the configuration will apply, then specify the directory settings and administrators.

  • Launch the NCache Management Center by browsing to http://localhost:9801 or <server-ip>:9801.

  • Click on the Settings icon in the left-hand menu to open the Environment page, then select User Security.

Security Settings

  • In the Select Nodes section, enter the IP address of a server node in Node IP and click Add. Repeat this step for every node to which you want to apply the security configuration.

Add Node User Security

  • Review the Node IP Address list to ensure that all required nodes have been added. To remove a node from the selection, click the remove icon against its IP address.
Note

The security settings displayed on this page are loaded from the node hosting the NCache Management Center. Saving the configuration applies it to the nodes listed in Select Nodes.

Enable NCache Node Security

After selecting the server nodes, use the Users/Groups Configuration section to enable security, configure the domain controller, and add the users or groups that will act as Node Administrators on those nodes.

  • Select Enable security on the selected nodes.

  • In Domain Controller, enter the address of your LDAP domain controller and specify its Port.

  • If required, enter a Secondary Domain Controller (Optional) and its Port to provide a backup domain controller if the primary domain controller is unavailable.

  • If you are using a secure LDAP port, select Use SSL Port and specify the appropriate port values for your domain controllers.

  • In Search Base, enter the base distinguished name (DN) within which you want to search for users or groups, such as OU=Operations,DC=example,DC=com.

User/Groups Configuration

Note

The Search Base determines the scope of the directory search. If you are unsure which value to use, contact your LDAP administrator or IT department.

  • Click Verify next to Search Base. In the Login Credentials dialog, enter valid domain credentials in Username and Password, then click Verify.

Login Credentials

  • After successful verification, the page displays Search Base verified, and the Users or Groups field becomes available.

  • In Users or Groups, type at least one character from the name of the user or group you want to add. Select the required entry from the matching results, then click Add.

Adding Users or Groups

  • The selected entry appears in the table with its Name, Type, and Distinguished Name (DN). Repeat the search and selection steps to add further administrators.

Added Users or Groups

Note

Each search returns up to 50 matching users or groups within the verified search base. If the required entry does not appear, enter more characters to narrow the results. Searching for matching entries avoids loading the entire directory, reducing the time and memory required to display users and groups.

  • To add users or groups from another search base, change Search Base and click Verify again. After verification, search for and add the required entries. Users and groups already added from other search bases remain in the table.

  • To remove an entry from the administrator list, click the remove icon against it.

  • After adding all required users and groups, click Save to apply the security configuration to the selected nodes.

Note

If you remove the specific user or group, security will be disabled on that node.

Configuring Homogeneous Security Settings

All participating nodes in a cache cluster must have consistent security settings. Add every node that should receive the configuration to Select Nodes before configuring security. Clicking Save applies the security settings and administrator list to all selected nodes.

The domain controller settings and configured administrators are saved in security.ncconf. Administrator entries are stored under the <administrators> element, with each entry containing the administrator's identity and distinguished name. This allows the configuration to retain users and groups selected from different search bases.

The next time you access the NCache Management Center after enabling security, you will be prompted to provide authorized login credentials.

Add/Remove Users

After enabling security on an NCache node, you can add or remove users and groups based on the level of access they require. NCache supports Node Administrators, who can perform node-level management operations, and Cache Users, who are authorized to access specific caches only. The Node Administrator has already been configured in the above steps where you have specified Users or Groups to enable security upon. However, to add Cache Users you need to follow the steps mentioned below:

Adding Cache Users

The Node Administrator configured on this node has all the rights of the node and the configured caches. But, if you want to create users who have access over cache and not over a node, then you can configure Cache Users on that node. You can configure the Cache User by following the steps given below:

  • In the NCache Management Center, click on Clustered Caches or Local Caches, based on your requirement.
  • Against the cache name, click on View Details.

NCache Management Center

  • This opens the detailed configuration page for the cache.
  • Scroll down on the same page to find the Advanced Settings (Clustered Cache) section. Select Security and Encryption, it will open up a page where you can add one or more Users or Groups to configure as Cache Users.

Adding Cache User

  • Similarly you can also Add gMSA Cache User. For more details on gMSA, please see Configure gMSA section.

Adding gMSA Cache User

  • Click on Save Changes to successfully add your Cache User or gMSA user.

Removing Cache Users

You can remove the Cache User by following the steps mentioned below:

  • In the NCache Management Center, click on Clustered Caches or Local Caches, based on your requirement.
  • Against the cache name, click on View Details.

NCache Management Center

  • This opens the detailed configuration page for the cache.
  • Scroll down on the same page to find the Advanced Settings (Clustered Cache) section. Select Security and Encryption, it will open up a page where you can remove one or more Users or Groups by clicking the Remove Icon under Action .

Removing Cache User

  • Click on Save Changes to successfully remove your Cache User.

Credential Caching

To get the complete benefits of these access levels, NCache supports two types of LDAP users: Node Administrators (Users/Groups) and Cache Users (Users/Groups). Since NCache does not have its own authentication mechanisms, all the added users are first authenticated against their LDAP credentials. When a registered LDAP User gets added to the NCache, there is always a validation check through the domain controller to verify whether this user is registered with the domain or not. In this scenario, if the connection with the domain controller breaks, validation fails, and the user cannot perform any operation.

To avoid this, NCache offers Credential Caching where the user's credentials are stored in NCache so that an already authenticated user does not have to be authenticated repeatedly during the life of the process. It is disabled by default and the user can enable it by setting the NCacheServer.EnableCredentialCaching tag as True in the Service config file.

User Credential Authentication

By utilizing RSA-based cryptographic techniques, NCache secures user credential transmission during authentication. When a management tool or client needs to authenticate these credentials, it requests the server’s RSA-256 public key. The server generates a fresh public/private key pair for each process's lifecycle. Tools and clients encrypt user credentials (like username and password) with the server’s public key before transmitting them. The server decrypts these credentials using its private key to validate the user. This process ensures that credentials remain secure during transmission and are not vulnerable to interception or misuse.

Enable Credential Caching

NCache offers Credential Caching where the authenticated user's credentials are stored in the cache to avoid repeated authentications during the life of the process. This feature is disabled by default. To enable it, update the NCacheServer.EnableCredentialCaching tag to true.

<add key="NCacheServer.EnableCredentialCaching" value="true"/>

Enable Security Using PowerShell

NCache also provides a set of PowerShell cmdlets to seamlessly configure and manage security on the cache. You can add users, enable security, disable security, and remove users by using the following:

Enabling Security

To Enable Security you need to execute the following command. This command requires OS level Admin rights to successfully enable security on your NCache server.

  • This command enables NCache security on the server 20.200.20.11. The machine administrator credentials are used to verify that David Watson has local administrator privileges on the specified server. The user Michael Parker is registered as the Node Admin, which authorizes the user to perform NCache management operations.
 $machineAdmin = Get-Credential david_watson `

  Enable-NCacheSecurity -Server 20.200.20.11 `
  -MachineAdminCredential $machineAdmin -NodeAdminName michael_parker `
  -NodeAdminDN "CN=Michael Parker,OU=engineers,DC=example,DC=com" `
  -DomainController domain_controller -DomainControllerPort 389
  • This command enables NCache security on the server 20.200.20.11. As David Watson is a local account and cannot query the directory directly, John Smith is supplied via -DirectoryBrowsingCredential to browse the directory and validate Michael Parker's Distinguished Name against the domain controller.
$machineAdmin = Get-Credential david_watson `
 $directoryUser = Get-Credential john_smith `

 Enable-NCacheSecurity -Server 20.200.20.11 `
 -MachineAdminCredential $machineAdmin -NodeAdminName michael_parker `
 -NodeAdminDN "CN=Michael Parker,OU=engineers,DC=example,DC=com" `
 -DomainController domain_controller -DomainControllerPort 389 `
 -DirectoryBrowsingCredential $directoryUser

This command enables NCache security on the server with the IP address 20.200.20.11. Before enabling security, the command validates whether Michal Parker has the necessary privileges on the server.

  • This command enables NCache security on the specified server with mutual TLS (mTLS) enabled, using david_watson as the machine administrator and adding michael_parker as a node administrator through the specified domain controller on port 389. It runs from a machine where NCache is not installed and uses C:\certs\client.pem to authenticate the machine running the cmdlet. The -TlsCertPassword parameter decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
$machineAdmin = Get-Credential david_watson

Enable-NCacheSecurity  -Server 20.200.20.11 `
-MachineAdminCredential $machineAdmin -NodeAdminName michael_parker `
-NodeAdminDN "CN=Michael Parker,OU=engineers,DC=example,DC=com" `
-DomainController domain_controller -DomainControllerPort 389 `
-TlsCertPath "C:\certs\client.pem" -TlsCertPassword "clientKeyPassword"

Adding Node Administrators

Once you have enabled security on a node, you need to have Node Administrators member of active LDAP directory with full control over node, including cache management and cache API access.

  • This command adds the user David Watson as an NCache admin on the server with the IP address 20.200.20.11.
$nodeAdmin = Get-Credential `
Add-NCacheUserOrGroup -Server 20.200.20.11 `
-AccessLevel Admin  -NodeAdminCredentials $nodeAdmin `
-UserOrGroupName david_watson `
-UserOrGroupDN "CN=David Watson,OU=engineers,DC=example,DC=com" `

While executing the command please keep in mind that only the local administrator (domain user) of the machine can add the first Node Administrator. Subsequent Node Administrators can be added or removed by the existing Node Administrator.

  • This command adds the user David Watson as a cache user for the 'defaultCache' cache hosted on the server with the IP address 20.200.20.11.
$nodeAdmin = Get-Credential `
Add-NCacheUserOrGroup -Server 20.200.20.11 `
-AccessLevel Cache -CacheName defaultCache `
-NodeAdminCredentials $nodeAdmin -UserOrGroupName david_watson `
-UserOrGroupDN "CN=David Watson,OU=engineers,DC=example,DC=com" `
  • You can also add a group of users as admin as NCache admin group. The following command adds a group named 'Dev' as an NCache admin group on the server with IP address 20.200.20.11.
$nodeAdmin = Get-Credential `
Add-NCacheUserOrGroup -Server 20.200.20.11 `
-AccessLevel Admin  -NodeAdminCredentials $nodeAdmin `
-UserOrGroupName dev `
-UserOrGroupDN "CN=Dev,OU=engineers,DC=example,DC=com" `
  • This command adds the gMSA 'user1gmsa$' as a cache user for the 'defaultCache' cache hosted on the server with the IP address 20.200.20.11.
$nodeAdmin = Get-Credential `
Add-NCacheUserOrGroup -Server 20.200.20.11 `
-AccessLevel Cache -CacheName defaultCache `
-NodeAdminCredentials $nodeAdmin -UserOrGroupName user1gmsa$ `
-UserOrGroupDN "CN=user1gmsa,CN=Managed Service Accounts,DC=example,DC=com" `
  • This command adds david_watson with Admin access on the specified server, using the provided node administrator credentials. It runs from a machine where NCache is not installed and connects to the server using mutual TLS (mTLS). The client certificate C:\certs\client.pem authenticates the machine running the cmdlet, and -TlsCertPassword decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
$nodeAdmin = Get-Credential
Add-NCacheUserOrGroup -Server 20.200.20.11 -AccessLevel Admin `
                      -NodeAdminCredentials $nodeAdmin -UserOrGroupName david_watson `
                      -UserOrGroupDN "CN=David Watson,OU=engineers,DC=example,DC=com" `
                      -TlsCertPath "C:\certs\client.pem" -TlsCertPassword "clientKeyPassword"
Note

Please note that in Linux you can add Administrative Groups (sudo, root, wheel, etc) through the NCacheServer.LinuxAdminGroups tag to configure Node Administrators.

Granular Access Control: Adding Cache Users

Now you have successfully secured your node along with all the caches configured on it. But, if you want to limit some users' access to cache operations without management privileges, you can Add Cache Users. You can add multiple users or groups by using the similar cmdlet as for Node Administrator, by just specifying the AccessLevel cache parameter. You have to specify the cache to which that user should have access using the CacheName parameter. You can add the Cache User by running the following:

$nodeAdmin = Get-Credential `
Add-NCacheUserOrGroup -Server 20.200.20.11 `
-AccessLevel Cache -CacheName defaultCache `
-NodeAdminCredentials $nodeAdmin -UserOrGroupName david_watson `
-UserOrGroupDN "CN=David Watson,OU=engineers,DC=example,DC=com" `

Removing Users

Along with adding users, Node Administrators also have the right to Remove Users.

  • The following cmdlet removes the administrator user David Watson from the NCache server with the IP address 20.200.20.11:
$nodeAdmin = Get-Credential `
Remove-NCacheUserOrGroup -Server 20.200.20.11 `
-AccessLevel Admin -NodeAdminCredentials $nodeAdmin `
-UserOrGroupName david_watson
  • The following command removes the administrator user David Watson from the NCache server with the IP address 20.200.20.11.
$nodeAdmin = Get-Credential `
 Remove-NCacheUserOrGroup -Server 20.200.20.11 `
-AccessLevel Cache -CacheName defaultCache `
-NodeAdminCredentials $nodeAdmin -UserOrGroupName david_watson
  • This command removes the gMSA cache user user1gmsa$ from the cache named defaultCache on server 20.200.20.11. The credentials supplied through -NodeAdminCredentials are used to authorize the remove operation.
$nodeAdmin = Get-Credential
Remove-NCacheUserOrGroup -Server 20.200.20.11 `
-AccessLevel Cache -CacheName defaultCache `
-NodeAdminCredentials $nodeAdmin -UserOrGroupName user1gmsa$
  • This command removes the group dev from the defaultCache cache hosted on the server with the IP address 20.200.20.11.
$nodeAdmin = Get-Credential
Remove-NCacheUserOrGroup -Server 20.200.20.11 `
-AccessLevel Cache -CacheName defaultCache `
-NodeAdminCredentials $nodeAdmin -UserOrGroupName dev
  • This command removes david_watson from the Admin access list on the specified server, using the provided node administrator credentials. It runs from a machine where NCache is not installed and connects to the server using mutual TLS (mTLS). The client certificate C:\certs\client.pem authenticates the machine running the cmdlet, and -TlsCertPassword decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
$nodeAdmin = Get-Credential
Remove-NCacheUserOrGroup -Server 20.200.20.11 -AccessLevel Admin `
                         -NodeAdminCredentials $nodeAdmin -UserOrGroupName david_watson `
                         -TlsCertPath "C:\certs\client.pem" -TlsCertPassword "clientKeyPassword"

While attempting to remove a user with security enabled, if the targeted user is the last one, the system will prompt you to decide if you also want to disable security.

Disabling Security

Disable-NCacheSecurity cmdlet disables security on the NCache cluster node. All configured Node Admin entries are removed. Management operations will no longer require authentication after this command runs.

Note

Each time you disable security, all configured Node Administrator entries are removed from the specified node.

  • This cmdlet also requires OS level admin rights to be executed successfully.
Disable-NCacheSecurity -Server 20.200.20.11 -MachineAdminCredentials(Get-Credential john_smith)
  • This command disables NCache security on the specified server using the john_smith machine administrator credentials. It runs from a machine where NCache is not installed and connects to the server using mutual TLS (mTLS). The client certificate C:\certs\client.pem authenticates the machine running the cmdlet, and -TlsCertPassword decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
Disable-NCacheSecurity -Server 20.200.20.11 -MachineAdminCredentials(Get-Credential john_smith) `
                        -TlsCertPath "C:\certs\client.pem" -TlsCertPassword "clientKeyPassword"

After you have configured security settings, they will be reflected in the security.ncconf config file shipped at %NCHOME%\config.

See Also

Encryption
TLS

Contact Us

PHONE

+1 214-619-2601   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Try NCache
Pricing
NCache Playground

Deployments
  • Cloud
  • Docker
  • Kubernetes
  • On-Premises
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • SignalR Backplane
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Blogs
  • Foundations
  • Videos
  • Comparisons
  • Shows
  • Whitepapers
  • Articles
  • Tech Talks
  • Magazine Articles
  • Third-Party Articles
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Docs
  • Schedule a Demo
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Terms of Use
  •  
  • Privacy Policy
  •  
  • Cookie Policy
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.
  • Facebook
  • Twitter
  • Youtube
  • LinkedIn
  • RSS