The CLM Book - Optimized Component Lifecycle

Transcription

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLMThe CLM Book - Optimized ComponentLifecycle Management with Sonatype CLMi

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLMiiContents1How to Use This Book12Downloads33Sonatype CLM - Requirements43.1CLM Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53.2CLM Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63.3REST API Versioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73.4Command Line Scanner Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . .73.5Sonatype CLM for Eclipse Requirements . . . . . . . . . . . . . . . . . . . . . . . . .73.6Sonatype CLM for Hudson / Jenkins Requirements . . . . . . . . . . . . . . . . . . . .83.7Sonatype CLM for Maven Requirements . . . . . . . . . . . . . . . . . . . . . . . . . .93.8Sonatype CLM for Nexus Pro Requirements . . . . . . . . . . . . . . . . . . . . . . . .9

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLM3.949Component Lifecycle Management104.1Increasing Component Usage and Open Source Components . . . . . . . . . . . . . . .104.2Security Vulnerability and License Compliance Risks . . . . . . . . . . . . . . . . . . .114.3Complicating Factors for CLM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114.4Stages of CLM Adoption and Performance . . . . . . . . . . . . . . . . . . . . . . . . .124.5The Four Requirements for True Component Lifecycle Management . . . . . . . . . . .134.6Sonatype and Sonatype CLM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144.6.1Who is Sonatype? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144.6.2What is Sonatype CLM? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144.6.3How does Sonatype CLM work? . . . . . . . . . . . . . . . . . . . . . . . . . .154.6.4Which component ecosystems does Sonatype CLM support? . . . . . . . . . . .15Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .164.75Sonatype CLM for SonarQube Requirements . . . . . . . . . . . . . . . . . . . . . . .iiiSonatype CLM - Server Setup175.1CLM Server Installation and Configuration . . . . . . . . . . . . . . . . . . . . . . . .175.1.1Starting CLM Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185.1.2License Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .195.1.3CLM Server Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLM5.1.4ivRunning the CLM Server as a Service . . . . . . . . . . . . . . . . . . . . . . .21Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245.2.1Initial Configuration of CLM Server . . . . . . . . . . . . . . . . . . . . . . . .255.2.2Running the CLM Server Behind a HTTP Proxy Server . . . . . . . . . . . . . .255.2.3Setting the Base URL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265.2.4Appending a User Agent String . . . . . . . . . . . . . . . . . . . . . . . . . .265.2.5File Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .275.2.6Email Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .275.2.7Logging Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285.2.8HTTP Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285.2.9HTTPS/SSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285.2.10 Anonymous Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .295.3Backing Up the CLM Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .295.4Upgrading the CLM Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .305.4.1Upgrade Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .315.4.1.1Upgrading from Sonatype CLM 1.9x or Later . . . . . . . . . . . . .315.4.1.2Upgrading from Sonatype CLM 1.8x . . . . . . . . . . . . . . . . . .315.4.1.3Upgrading from Sonatype CLM 1.7x and 1.6x:: . . . . . . . . . . . .325.2

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLM5.4.1.46Upgrading from Sonatype CLM 1.5x or Earlier . . . . . . . . . . . .v33Sonatype CLM - Security Administration346.1User Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .356.1.1Logging in to Sonatype CLM . . . . . . . . . . . . . . . . . . . . . . . . . . .356.1.2Viewing Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366.1.3Changing the Admin Password . . . . . . . . . . . . . . . . . . . . . . . . . . .366.1.4Creating a User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .376.1.5Editing and Deleting User Information . . . . . . . . . . . . . . . . . . . . . . .38LDAP Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .396.2.1Configuring the LDAP Server Connection . . . . . . . . . . . . . . . . . . . . .406.2.2LDAP Configuration Parameters . . . . . . . . . . . . . . . . . . . . . . . . . .426.2.3Mapping LDAP Users to Sonatype CLM . . . . . . . . . . . . . . . . . . . . .436.2.4LDAP User Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .456.2.5Mapping LDAP Groups to Sonatype CLM . . . . . . . . . . . . . . . . . . . .466.2.6LDAP Group Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .486.2.6.1Static Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .486.2.6.2Dynamic Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49Verifying LDAP Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . .506.26.2.7

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLM6.37vi6.2.7.1Test Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . .506.2.7.2Check User and Group Mapping . . . . . . . . . . . . . . . . . . . .516.2.7.3Check Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51Role Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .526.3.1Viewing Role and Permission Descriptions . . . . . . . . . . . . . . . . . . . .526.3.2Assigning Users to Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .536.3.3Creating Custom Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .546.3.4Excluding Groups from Search Results . . . . . . . . . . . . . . . . . . . . . .55Sonatype CLM - Policy Management577.1Organization and Application Management . . . . . . . . . . . . . . . . . . . . . . . .587.1.1Organizational Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .597.1.2Creating an Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .597.1.3Creating an Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .607.1.4Organization, Application, and Inheritance . . . . . . . . . . . . . . . . . . . .627.1.5Avoiding Policy Micromanagement . . . . . . . . . . . . . . . . . . . . . . . .63Policy Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .637.2.1Advanced Anatomy of a Policy . . . . . . . . . . . . . . . . . . . . . . . . . .647.2.2Risk and Organizational Intent . . . . . . . . . . . . . . . . . . . . . . . . . . .677.2

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLM7.3viiPolicy Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .677.3.1Step 1: Understand the Policy Intent . . . . . . . . . . . . . . . . . . . . . . . .697.3.2Step 2: Decide on a Descriptive Policy Name . . . . . . . . . . . . . . . . . . .707.3.3Step 3: Choose an Appropriate Threat Level . . . . . . . . . . . . . . . . . . . .717.3.4Step 4: Choose the Application Matching Parameters . . . . . . . . . . . . . . .737.3.5Step 5: Create Constraints with Conditions . . . . . . . . . . . . . . . . . . . .737.3.6Step 6: Set Policy Actions And Notifications . . . . . . . . . . . . . . . . . . .787.3.6.1Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .787.3.6.2Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .797.3.6.3Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .807.4Policy Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .827.5Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .827.5.1Creating, Editing and Deleting a Label . . . . . . . . . . . . . . . . . . . . . . .837.5.2Creating a Condition Based on a Label . . . . . . . . . . . . . . . . . . . . . .85License Threat Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .867.6.1Creating, Editing, and Deleting a License Threat Group . . . . . . . . . . . . . .877.6.2Creating a Condition Based on a License Threat Group . . . . . . . . . . . . . .907.6.3Creating a Condition Based on an Unassigned License Threat Group . . . . . . .907.6

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLMviii7.6.4Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .917.6.5Creating, Editing, and Deleting Tags . . . . . . . . . . . . . . . . . . . . . . . .937.6.6Applying a Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .957.6.7Matching Policies to Specific Applications . . . . . . . . . . . . . . . . . . . .967.6.8Viewing Tag-based Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . .977.7Evaluating via the CLM Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .987.8Reviewing Evaluation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1017.9Importing Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087.9.1Sonatype Sample Policy Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087.9.2Importing a Policy to an Organization . . . . . . . . . . . . . . . . . . . . . . . 1097.9.3Importing a Policy to an Application . . . . . . . . . . . . . . . . . . . . . . . . 1107.10 Policy Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1117.10.1 Setup Policy Monitoring for an Application . . . . . . . . . . . . . . . . . . . . 1137.10.2 Configuring Notification Times . . . . . . . . . . . . . . . . . . . . . . . . . . 1168Sonatype CLM - Dashboard1178.1Accessing the Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1188.2Viewing CLM Data in the Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . 1188.2.1Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLM8.2.28.38.49ixVisual Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122Highest Risk Violations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258.3.1Newest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1268.3.2By Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1278.3.3By Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Viewing Component Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131Sonatype CLM - Report1349.1Accessing an Application Composition Report . . . . . . . . . . . . . . . . . . . . . . . 1369.2Reviewing a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1389.2.1Summary Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1399.2.2Policy Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1419.2.3Security Issues Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1439.2.4License Analysis Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1449.3Printing and Reevaluating the Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1459.4The Component Information Panel (CIP) . . . . . . . . . . . . . . . . . . . . . . . . . . 1459.5Resolving Security Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1529.5.1Security Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1529.5.2The Component Information Panel (CIP) . . . . . . . . . . . . . . . . . . . . . 154

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLM9.69.79.89.9x9.5.3Editing Vulnerability Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1549.5.4Matching to Violations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156License Analysis Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1579.6.1License Threat Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1579.6.2License Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1589.6.3The Component Information Panel (CIP) . . . . . . . . . . . . . . . . . . . . . 1599.6.4Editing License Status and Information . . . . . . . . . . . . . . . . . . . . . . 160Component Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1629.7.1Matching Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1639.7.2Managing Proprietary Components . . . . . . . . . . . . . . . . . . . . . . . . 1649.7.3Claiming a Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167Label Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1699.8.1Where do labels begin? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1699.8.2Assigning a Label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171Waivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1729.9.1A Use Case for Waivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1729.9.2Adding a Waiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1749.9.3Viewing and Removing a Waiver . . . . . . . . . . . . . . . . . . . . . . . . . . 175

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLMxi9.10 Policy Reevaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1769.11 Sonatype CLM PDF Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1789.11.1 Creating the PDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1789.11.2 Reviewing the PDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17810 Sonatype CLM and Repository Management19011 Sonatype CLM for Nexus Pro19211.1 Repository Health Check (RHC) vs. Sonatype CLM . . . . . . . . . . . . . . . . . . . . 19311.2 Connecting Nexus to CLM Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19411.3 Accessing CLM Component Information . . . . . . . . . . . . . . . . . . . . . . . . . 19611.4 The Component Information Panel (CIP) . . . . . . . . . . . . . . . . . . . . . . . . . . 20011.5 Component Details (CLM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20311.6 Sonatype CLM for Nexus Staging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20411.6.1 Staging Profile Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 20511.6.2 Policy Actions for Staging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20611.7 Policy Actions for Release Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . 20812 Sonatype CLM and Continuous Integration20913 Sonatype CLM for Bamboo211

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLMxii13.1 Install Sonatype CLM for Bamboo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21213.2 Configure Sonatype CLM for Bamboo . . . . . . . . . . . . . . . . . . . . . . . . . . . 21313.3 Adding the Sonatype CLM Analysis Task . . . . . . . . . . . . . . . . . . . . . . . . . 21513.4 Reviewing CLM Policy Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21814 Sonatype CLM for Hudson and Jenkins21914.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22014.2 Global Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22114.3 Job Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22314.4 Inspecting Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22515 Sonatype CLM and IDEs22716 Sonatype CLM for Eclipse22916.1 Installing Sonatype CLM for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22916.2 Configuring Sonatype CLM for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . 23116.3 Using the Component Info View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23516.4 Filtering the Component List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24016.5 Searching for Component Usages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24116.6 Inspecting Component Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLMxiii16.7 Migrating to Different Component Versions . . . . . . . . . . . . . . . . . . . . . . . . 24217 Sonatype CLM for SonarQube24617.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24717.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24817.3 Proxy Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24917.4 Select the CLM Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25017.5 Add and Configure the Sonatype CLM Widget . . . . . . . . . . . . . . . . . . . . . . . 25117.6 Accessing the Application Composition Report . . . . . . . . . . . . . . . . . . . . . . 25218 Sonatype CLM for CLI25318.1 Downloading Sonatype CLM for CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . 25418.2 Locating Your Application Identifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25418.3 Evaluating an Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25518.3.1 Additional Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25618.4 Example Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25618.5 Using Sonatype CLM for CLI with a CI Server . . . . . . . . . . . . . . . . . . . . . . 25819 Sonatype CLM for Maven25919.1 Evaluating Project Components with Sonatype CLM Server . . . . . . . . . . . . . . . 260

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLMxiv19.1.1 Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26219.1.2 Simplifying Command Line Invocations . . . . . . . . . . . . . . . . . . . . . . 26319.1.3 Skipping Executions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26319.2 Creating a Component Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26419.2.1 Excluding Module Information Files in Continuous Integration Tools . . . . . . 26519.3 Creating a Component Info Archive for Nexus Pro CLM Edition . . . . . . . . . . . . . 26619.4 Using Sonatype CLM for Maven with Other IDEs . . . . . . . . . . . . . . . . . . . . . 26719.4.1 Maven Plugin Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26719.4.2 IntelliJ IDEA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26819.4.3 NetBeans IDE . . . . . . . . . . . . . . . . . . . . . . . . . .

The CLM Book - Optimized Component Lifecycle Management with Sonatype CLM ii Contents 1 How to Us