Testing with Windows AppLocker#
Windows environments with AppLocker enabled present unique challenges for conda
development and testing. This guide explains how to set up a testing environment with AppLocker to ensure conda
works correctly in these environments.
Why Test with AppLocker?#
AppLocker is Microsoft’s application control solution that allows organizations to:
Control which applications and files users can run
Create rules to allow or deny applications from running based on file attributes
Create exceptions to rules
Many enterprise environments use AppLocker to restrict script execution, which can impact environmnet activation and execution processes. Testing with AppLocker ensures conda
works properly in these restricted environments.
Setting Up AppLocker for Testing#
Step 1: Enable the Application Identity Service#
Note
The Application Identity Service is required for AppLocker to function properly.
Open the Services application (press
Win+R
, typeservices.msc
, and press Enter)Find Application Identity in the list of services
Right-click on it and select Properties
Optional: Change Startup type to Automatic if you want the service to start on boot
Click Start to start the service
Click OK to close the properties window
Step 2: Configure AppLocker Enforcement#
Open Local Security Policy (press
Win+R
, typesecpol.msc
, and press Enter)Navigate to Security Settings > Application Control Policies > AppLocker
Right-click on AppLocker and select Properties
Under the Enforcement tab, check Script Rules and set it to Enforce rules
Click OK to close the properties window
Step 3: Create AppLocker Rules#
In the Local Security Policy window, navigate to Script Rules under AppLocker
Right-click on Script Rules and select Create Default Rules to establish baseline rules
Create an Allow Rule for your development environment:
Right-click on Script Rules and select Create New Rule…
Choose Allow under Permissions and set the user/group to Everyone
Select Path as the condition
Enter the path to your development environment (e.g., path to
devenv
)Complete the wizard without adding exceptions
Create an Allow Rule for the conda source code location using the same process
Create a Deny Rule for the
%TEMP%
directory:Follow the same process but choose Deny under Permissions
Set the absolute path
Restart your computer to apply the rules
