Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune listing policies that are enabled and scoped to static user groups #28

Open
gtdragon980 opened this issue Nov 8, 2022 · 3 comments

Comments

@gtdragon980
Copy link

When using Prune to scan policies in the JSS, it will not consider policies that are using static user scopes as being "In Use". I saw several enabled and scoped policies in the "Unused" list of policies when testing this.

@BIG-RAT
Copy link
Owner

BIG-RAT commented Nov 10, 2022

Nice catch, and unfortunately this looks to be an issue with the API as scoped users, smart user groups, and static user groups information is missing when you view a policy through the API. For example here is a policy and configuration policy scoped exactly the same.
policy (scope) xml:

<scope>
  <all_computers>false</all_computers>
  <computers/>
  <computer_groups>
	<computer_group>
	  <id>172</id>
	  <name>laptops</name>
	</computer_group>
  </computer_groups>
  <buildings/>
  <departments/>
  <limit_to_users>
	<user_groups/>
  </limit_to_users>
  <limitations>
	<users/>
	<user_groups/>
	<network_segments/>
	<ibeacons/>
  </limitations>
  <exclusions>
	<computers/>
	<computer_groups/>
	<buildings/>
	<departments/>
	<users/>
	<user_groups/>
	<network_segments/>
	<ibeacons/>
  </exclusions>
</scope>

Configuration Profile (scope) xml:

<scope>
  <all_computers>false</all_computers>
  <all_jss_users>false</all_jss_users>
  <computers/>
  <buildings/>
  <departments/>
  <computer_groups>
	<computer_group>
	  <id>172</id>
	  <name>laptops</name>
	</computer_group>
  </computer_groups>
  <jss_users/>
  <jss_user_groups>
	<user_group>
	  <id>2</id>
	  <name>Group 1</name>
	</user_group>
	<user_group>
	  <id>27</id>
	  <name>Test Smart Grp</name>
	</user_group>
  </jss_user_groups>
  <limitations>
	<users/>
	<user_groups/>
	<network_segments/>
	<ibeacons/>
  </limitations>
  <exclusions>
	<computers/>
	<buildings/>
	<departments/>
	<computer_groups/>
	<users/>
	<user_groups/>
	<network_segments/>
	<ibeacons/>
	<jss_users/>
	<jss_user_groups/>
  </exclusions>
</scope>

Notice the policy is missing the jss_users and jss_user_groups keys. I might suggest openning a ticket with Jamf Support to get the issue addressed.

@gtdragon980
Copy link
Author

Thanks for the quick response. I will reach out to Jamf support and let them know about this finding.

@BIG-RAT
Copy link
Owner

BIG-RAT commented Nov 16, 2022

Thank you. I'd encourage others encountering this issue to do the same as I discovered I'd mentioned this years ago. The more people it impacts the more likely it is to get addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants