EPM - How to read logs related to restricted access events and policies with "Application access control" option defined
Objective
1. Functionality of "Application access control"
When an policy handles an application and that policy has "Application access control" enabled, EPM may block that applications ability to modify certain files. Dependent on how you have the "Application access control" option configured, the end user may or may not see an EPM dialog when the restriction happens. Also dependent on the option configuration, the EPM admin may or may not see an event in the EPM Console.
Environment
24.12 EPM Windows Agent
Procedure
2. "Application access control" option in EPM Advanced Policy
In an advanced policy, you can go to options and turn on "Application access control" After doing so, you can restrict access to a specific location or file. This means that applications or scripts handled by the policy will be restricted from making changes to the files you specify.
If you want end user to see a EPM "Restricted access" dialog, you can configure the dialog in the options:
3. vf_policies.xml example when "Application access control" option is enabled
If you see RestrictionRule id= in a policy it means that in the policy you have an "Application access control" option defined. You can take that restriction rule id (shown bold below)…
<Policy id="147888" order="440" action="4" name="pol 4 - restriction test" reportUsage="2" replaceUAC="True" replaceAdminUAC="True" shellExtension="False" restrictionId="{e0bfada7-798b-493e-bb1f-1f2b7974049d}" internalType="3">
<Alert type="Dialog" id="{21589654-1fac-4456-8b34-7d7833a0fbd8}" trigger="23"/>
<Targets>
<ApplicationGroup id="{698b4330-15e3-476c-8208-cab25a9107ae}"/>
</Targets>
</Policy>
… and if you search for it you'll find the details later in the policy xml…
<RestrictionRule id="{e0bfada7-798b-493e-bb1f-1f2b7974049d}" name="">
<RstrPath id="{b33e4067-8f66-4524-b49c-9481efafeca4}" allow="False" showDlg="True" restrEvent="True" order="0" isFile="True">test.txt</RstrPath>
</RstrPaths>
<RstrKeys id="{12b641bb-a4e6-49c9-a740-972ff4b22676}"/>
<NetShares id="{4ff442aa-f6d8-4810-b4ee-e42eadb8a4ce}" restrEvent="True"/>
<RstrNetworks internetId="{3447d57d-e9c1-4e72-8eff-a63b54519844}" restrEventInternet="True" intranetId="{f355040f-e870-475f-b80f-82f16f44fbf9}" restrEventIntranet="True"/>
</RestrictionRule>
4. vf_agent_srv.trace log example when the policy blocks access
2025.01.07 20:54:01 PID:3384 TID:5452 CvfAnswerRtEvents::SendData: INFO: Sending 1 run-time events of type RestrAccessEvent. First event extended info: <RestrAccessEvent targetType="4" owner="SUPPORTLAB\Administrator" publisherStatus="1" timeFirst="133807568379028951" timeLast="133807568379028951" count="1" policyId="147902" policyAction="1" targetId="{B9B1BCA7-37F4-437A-A611-DA7AA6C91572}" userIsAdmin="true" user="SUPPORTLAB\Administrator" id="{b33e4067-8f66-4524-b49c-9481efafeca4}" zeroTouch="false" fullTrace="false" allowed="false" accessTargetType="1" pid="9064" procStartTime="133807568328060785"><AccessTarget>C:\Users\administrator\Desktop\test.txt</AccessTarget><Description>test.bat</Description><Hash>SHA1##012FFB513CF7503ADC05E0AA891FE96CB7CB4ECB</Hash><Path>C:\Users\administrator\Desktop\test.bat</Path><LocType>FIXED</LocType><Size>51</Size><ModifTime>133807528606740721</ModifTime><PolicyName>access control test</PolicyName><FileOrigin><FileOrigin version="1"><Installer installTime="133807528606896840"><Process order="0" publisher="Microsoft Corporation" publisherStatus="4" hash="8559908BE6C729D0BA17021725931B17CA3D9A1B" hashAlgorithm="SHA1"><Path locationType="FIXED">C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2410.21.0_x64__8wekyb3d8bbwe\AppxManifest.xml</Path><Args>"C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2410.21.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe" </Args><User sid="S-1-5-21-279092831-2758002539-1835282715-500" name="SUPPORTLAB\Administrator" limited="true"><Group sid="S-1-5-32-544"/><Group sid="S-1-18-1"/><Group sid="S-1-5-21-279092831-2758002539-1835282715-512"/><Group sid="S-1-5-21-279092831-2758002539-1835282715-513"/><Group sid="S-1-5-21-279092831-2758002539-1835282715-8609"/><Group sid="S-1-5-21-279092831-2758002539-1835282715-518"/><Group sid="S-1-5-21-279092831-2758002539-1835282715-519"/><Group sid="S-1-5-21-279092831-2758002539-1835282715-520"/><Group sid="S-1-5-21-279092831-2758002539-1835282715-572"/></User></Process><Process order="1" wellKnown="explorer"/></Installer></FileOrigin></FileOrigin></RestrAccessEvent>
5. How to monitor events in EPM console
Enable Policy Audit in the policy. then you can look in "Policy Audit" in the EPM console and you should be able to see an event with event type of "Access restricted".
6. How to reproduce or demonstrate in lab
- Create test.bat on the desktop. The contents of this script should be just one line:
- echo %date% %time%>%userprofile%\desktop\test.txt
- Create a policy with the action being elevate if necessary.
- Add a "script" definition for test.bat
- Update policies on the endpoint
- run test.bat on the endpoint. You should notice that it updates test.txt with a timestamp.
- Now edit the policy and go to options and then "Application access control". Set it to "On". In the Resources section click Edit next to "Files on the local disk". Add filename test.txt. Click done. Set "Notify end users" to use am EPM dialog. In the "Audit section of the policy, enable policy audit. Save the policy changes.
- On the endpoint, request policies.
- launch test.bat again. You should now get a restricted access EPM dialog, and it should NOT write anything to test.txt
- If you get SupportInfo logs and look in the trace subfolder, then vf_agent_srv.trace, search for RestrAccessEvent
- If you enable DemoMode and check Policy Audit in the EPM Console, you should see an event with event type of "Access restricted".