Policy Type Can't Be Set on New Policy Created - Sonatype Lifecycle & Repository Firewall - Sonatype Community

Policy Type Can’t Be Set on New Policy Created

post by jfinnessy on Apr 22, 2020

James Finnessy

When you create your own Policy in Nexus IQ, it doesn’t give you the option to set the Policy Type. This info is key when using the REST API to find either “security”,“license” or “other” policy violations. This information is set for all of the default policies that come within nexus iq.


post by jwhitehouse on Apr 22, 2020

Jamie Whitehouse

@jfinnessy thanks for taking a look at creating your own policy. The type is calculated based on what conditions are used. The documentation for this is a bit buried so no wonder it wasn’t obvious. Here’s where that’s mentioned: Understanding the Parts of a Policy

Copied here for ease of reference:

When setting conditions, you will also want to consider Policy Type (one of the available filters for the Dashboard). Based on the condition that is chosen, a policy type will be assigned. This is done automatically and can’t be overridden. The following rules are used to determine a policy’s type:

A policy can only ever be of one type. In cases where a policy has conditions that meet more than one of the rules above, the order above dictates the type of policy. For example, if a policy has security and license conditions, it is considered to be of type Security.