Creating a Custom Detection Rule from Scratch
When you want to create a custom detection rule but do not have access to the Analysis Workbench, you must create the rule from scratch, providing all the necessary details that define the rule. These details include, along with other information, the set of file criteria used to detect the third-party or OSS component and create the associated inventory. The set of criteria can be based on either the file path or MD5 value of the files.
Refer to the following procedure for creating the custom detection rule from scratch.
To create a custom detection rule from scratch, do the following:
1. | Open the Custom Detection Rules tab, using the procedure in Viewing All Current Custom Detection Rules. |
2. | Click Create Custom Rule to open the Custom Detection Rule dialog. |
3. | Use Lookup Component to select or create a component for the rule. Once the component instance is selected, its information is populated in the dialog. |
4. | Update the populated information if necessary and provide values for the blank As-Found License Text, Notices Text, and Audit Notes fields as needed. (For a description of each field, refer to Create Custom Detection Rule Dialog.) The information provided in these fields defines the inventory created or updated by this rule in future scans. |
Note that you can use the Inventory Name field to overwrite the default name component version (license) otherwise assigned to inventory items created by this rule.
5. | In the Detection Criteria field, select the type of file criteria you are specifying to detect the presence of the component—file MD5 values or file paths. (The set of files can use only one criteria type. The default type is File MD5.) |
Note:If you attempt to set up detection criteria for both types (File MD5 or File Path), keep in mind that you lose the criteria for the type that is currently not selected for Detection Criteria when you save the rule. A custom detection rule allows only a single set of criteria to exist at any one time.
• | When you select File MD5, the File MD5 grid is displayed. |
For each file criterion you want to add for detecting the component, click the Add File button and provide the file’s name and MD5 value in the new row in the grid.
To remove a file from the grid, click to the right of its row.
• | When you select File Path, the File Path text box is displayed. |
For each file criterion you want to add for detecting the component, click the Add icon and enter the file’s path. You can provide the file’s absolute or relative path or enter a path pattern.
A path pattern consists of the asterisk symbol * within the path, denoting any number of directories or files. For example, the path pattern used in the screenshot above indicates that any file whose file name ends with .designer and has a .cs extension will be considered detection criteria for the rule.
To remove a path, click the Remove icon .
6. | Click Save and then click Yes to confirm that you want to proceed with creating the rule and adding it to the Code Insight Data Library, where it will be available for global use. |