Documentation Nexus IQ Server 1.17

Our documentation site has moved. For the most current version, please see http://help.sonatype.com

8.1. Labels

Labels are actually one of the more powerful features of policy management, and they should have a familiar look, since you’ve likely used other systems that employ a sort of tagging or labeling.

Essentially, labels are metadata. More specifically a label is metadata that is assigned to a component within the context of a particular application or organization. Labels can assist with identifying components you want to review, approve, or even avoid altogether. We call this label assignment.

When labels are assigned, this is an action that takes place in the application composition report. Before it can be assigned though, a label needs to exist for a particular organization or application.

As we learned in our Organization and Application Management chapter, inheritance plays a big role in policy. The same thing is true for labels, in that if a label is created in an organization, any application attached to that organization will also have the label available for use when assigned. In fact, the system will prompt you to choose the scope (organization or application) a label should exist in when it is assigned.

8.1.1. Creating, Editing, and Deleting a Label

We’ve determined that assigning a label is an important action, but how do we build policy around this? That’s actually simple, we just add a condition, based on a specific label that you have created, being present. The one caveat, is that the label needs to exist within the application or the organization in which you are creating the condition.

To create a label:

  1. Click the Manage Applications and Organizations icon figs/web/clm-server-manage-app-org-icon.png on the Nexus IQ Server toolbar.
  2. In the sidebar, select the desired organization or application.
  3. In the Manage Applications and Organizations area, click Labels.
  4. Click the New Label button.

    figs/web/clm-server-new-label-create.png

    Figure 8.1. Using New Label Button


    When creating your label, remember to use something that is easily identifiable. If you’re following along with our example in the next section, Architecture-Approved is a good example.

  5. Enter a name in the Label Name box.
  6. Select a color for the label.
  7. Enter an optional description in the Description box.
  8. Click the Save button.

    figs/web/clm-server-label-example.png

    Figure 8.2. Label Example


    Editing Labels
    To make changes to a label, click on the label and the label information will be displayed below.
    Deleting Labels
    To delete a label, just click on the X next to the label name.

A few things to remember:

  • An organization’s labels can be seen by any of its applications, the reverse is not true.
  • Labels can only be edited (or deleted) at the level they were created.

8.1.2. Creating a Condition Based on a Label

In the example below a new condition for the label Architecture-Approved will be added to an existing policy with an existing constraint and condition.

In our instructions, we’ve made an assumption that you understand how to create a policy.

figs/web/clm-server-label-condition-create.png

Figure 8.3. Creating a Label Condition


  1. Open an existing policy.
  2. In the Constraints area of the policy, click on the + icon, located next to the right of an existing condition.

    [Tip]

    Make sure you use the correct + icon, as it can be easy to add a new constraint by mistake.

  3. Now, in the Conditions area, change Label in the first drop down menu from Age to’Label'.
  4. Next, in the second drop down menu select is not for the operator.
  5. Finally, in the third drop down menu, select the Architecture-Approved label you just created.
  6. Click the Save button to finish.
[Tip]

Because our example uses a constraint with an existing condition, we have also chosen to force a violation only when all conditions have been met. In this scenario it may be appropriate to consider a waiver as an alternative.