The Parasoft CERT for Java Compliance extension is a set of assets for your DTP infrastructure that enable you to demonstrate compliance with CERT Oracle Coding Standard for Java guidelines. The extension is shipped as part of the Security Compliance Pack. Contact your Parasoft representative to download and license the Security Compliance Pack.
In this section:
Background
The CERT Oracle Coding Standard for Java was developed by the CERT Coordination Center to improve the safety, reliability, and security of software systems. CERT coding standards consist of "rules" and "recommendations" and are organized into a set of categories. Rules provide code requirements for adhering to the standard, whereas recommendations are intended to provide guidance that improves the safety, reliability, and security of software systems.
Rules and recommendations are collectively referred to as "guidelines." Guidelines in the CERT Oracle Secure Coding Standard for Java are cross-referenced with Common Weakness Enumeration (CWE) entries. Programming patterns that fail to meet CWE's guidelines are called "weaknesses."
In terms of risk analysis, CERT uses three metrics to help quantify weaknesses:
- The severity of the consequences associated with a failure to comply with the rule.
- The likelihood that a coding flaw introduced by ignoring the rule will result in an exploitable vulnerability.
- The remediation cost associated with complying with the rule.
The metrics are used to prioritize violations into three levels: L1 (highest priority), L2, and L3. The CERT for Java Compliance extension configures your DTP implementation to show static analysis violations according to their CERT for Java priority, guideline, type, and guideline category.
See https://wiki.sei.cmu.edu/confluence/display/java/SEI+CERT+Oracle+Coding+Standard+for+Java to learn more about the standard.
Prerequisites
Jtest with the Flow Analysis license feature enabled. See Security Compliance Pack for additional information.
Process Overview
- Install the Security Compliance Pack into DTP Extension Designer.
- Deploy the CERT for Java Compliance artifact into your DTP environment. This also deploys CERT for Java Compliance extension assets.
- Analyze code with Jtest using the CERT for Java test configuration and report violations to DTP. You can configure Jtest to use the local test configuration or the test configuration shipped with the Security Compliance Pack. The test configuration and rulemap.xml file configures analysis rules to report violations according to CERT for Java guidelines.
- Add the CERT for Java Compliance dashboard and widgets to your DTP interface. The dashboard widgets and shows the reported violations within the context of CERT for Java guidelines.
- Interact with the widgets and reports to identify code that needs to be fixed, as well as print out the reports for auditing purposes.
Achieving 100% Compliance
CERT for Java is currently a work in progress and includes guidelines that are incomplete and/or subject to change. As a result, DTP will report 100% compliance against only those guidelines that are mapped to a Parasoft static analysis rule.
CERT for Java Compliance Extension Assets
The Parasoft CERT for Java Compliance extension helps you create the documentation required for demonstrating compliance with CERT for Java. The following artifacts are included in the package.
Rule Map and Test Configuration
Parasoft static and flow analysis rules normally report violations according to a category (for example, Possible Bug, Interoperability, and so on) and severity (1-5). In order to view code analysis violations as CERT for Java guideline violations, DTP requires a rule map file that realigns Parasoft rules to report violations according to CERT for Java guidelines. In addition, the code analysis tool (Jtest) needs a test configuration file that ensures that only the rules related to the remapped CERT for Java rules are executed. These files are shipped with Jtest.
Category and Guideline Definition Files
The following configuration files shipped with the extension provide compliance categories in DTP interfaces that are oriented toward CERT for Java:
- CERT_JAVA-Category.xml
- CERT_JAVA-Guideline.xml
- CERT_JAVA-Priority.xml
Test Configurations
You can configure Jtest to run the test configurations shipped with the tool or with the Security Compliance Pack. Refer to the Jtest documentation for details. The following test configurations are included with the pack:
- CERT for Java
Dashboards
After installing the Security Compliance Pack and deploying the CERT compliance artifacts, you will be able to quickly add widgets configured to show CERT-related data by using the following dashboard templates:
- SEI_CERT_JAVA_Compliance.json
See Custom Dashboard Templates for additional information about understanding dashboard templates.
CERT Compliance.json
This is the DTP Workflow you must install and deploy in Extension Designer. It extends DTP’s data processing functionality to produce dashboard widgets and reports specific to CERT for Java. It helps you track compliance status and document guideline enforcement, deviations, and rule re-categorization.
Model and Profiles
Profiles provide a range of functions in a DTP infrastructure, such as providing inputs for custom calculations executed by an extension and providing data for compliance reports. Profiles take their structure from models, which define fields, headers, or other components used in the profile. See Working with Model Profiles for information about understanding profiles in DTP Enterprise Pack. The following profiles are included with the CERT for Java artifact.
- cert-compliance.json: This model file describes how the CERT for Java profiles render the data.
- cert-java.json: This is the default profile that renders data according to the cert-compliance.json model. This profile should be enabled to generate compliance audit reports.
Cross-reference PDF
For your convenience, a PDF that shows the association between Parasoft rules and CERT guidelines is located in the <PACK>/rules/jtest
directory.
package.json
This file describes the contents of the extension.
Deploying the CERT for Java Compliance Assets
The CERT for Java Compliance files are installed as part of the Security Compliance Pack (see Installation for instructions). After installing the artifact, you must deploy the assets to your DTP environment.
CERT C, CERT C++, and CERT for Java
If you are already using the CERT C Compliance or the CERT C++ Compliance artifacts, you do not need to perform this step. All of these artifacts use the same DTP Workflow.
- Choose Extension Designer from the DTP settings (gear icon) menu.
- Click the Services tab and expand the DTP Workflows services category. You can deploy assets under any service category you wish, but we recommend using the DTP Workflows category to match how Parasoft categorizes the assets. You can also click Add Category to create your own service category (see Working with Services for additional information).
- You can deploy the artifact to an existing service or add a new service. The number of artifacts deployed to a service affects the overall performance. See Extension Designer Best Practices for additional information. Choose an existing service and continue to step 5 or click Add Service.
- Specify a name for the service and click Confirm.
- The tabbed interface helps you keep artifacts organized within the service. Organizing your artifacts across one or more tabs does not affect the performance of the system. Click on a tab (or click the + icon to add a new tab) and choose Import the vertical ellipses menu.
- Choose Local > Flows > Workflows > Security > CERT Compliance and click Import.
- Click anywhere in the open area to drop the artifact into the service.
- Click Deploy and return to your DTP dashboard.
- Refresh your browser.
You can now add the CERT for Java Compliance dashboard and widgets.
Adding the CERT for Java Compliance Dashboard
The CERT for Java dashboard template will be available after installing the Security Compliance Pack. If you do not see dashboard template, restart DTP (see Stopping DTP Services and Starting DTP Applications).
- Click Add Dashboard in the DTP toolbar and specify a name when prompted.
- (Optional) You can configure the default view for the dashboard by specifying the following information:
- Choose the filter associated with your project in the filter drop-down menu. A filter represents a set of run configurations that enabled custom views of the data stored in DTP. See DTP Concepts for additional information.
- Specify a range of time from the Period menu.
- Specify a range of builds from the Baseline Build and Target Build menus.
- Enable Create dashboard from a template and choose the SEI CERT Oracle Coding Standard for Java Compliance template from the associated menu.
- Click Create to finish adding the dashboard.
If you have already executed Jtest on your project using the CERT for Java test configuration, most widgets will render data as soon as the dashboard is added. You can immediately begin using these widgets and working with the data to help you track your compliance goals (see CERT for Java Compliance Widgets).
Manually Adding the CERT for Java Widgets
You can manually add the CERT for Java widgets to an existing dashboard. See Adding Widgets for general instructions on how to add widgets to a dashboard. After deploying the artifact, widgets will appear in the SEI CERT category.
The following configurations are available:
Title | You can rename the widget in the Title field. This setting is available for all widgets. |
---|---|
Filter | Choose a specific filter or Dashboard Settings from the menu. See Configuring Filters for additional information. This setting is available for all widgets. |
Target Build | Choose a specific build from the menu. The build selected for the entire dashboard is selected by default. See Using Build Administration for additional information about understanding builds. This setting is available for all widgets. |
Type | This rule specifies which type of guideline you want to view in the widget. Choose either Rule, Recommendation, or All from the menu. See Background for additional information about guideline types. This setting is available for the following widgets:
|
Level | This rule specifies which priority level you want to view in the widget. Choose either L1, L2, or L3 from the menu. See Background for additional information about guideline priorities. This setting is available for the following widgets:
|
Compliance Profile | Specify the compliance profile you want to use to view the data. In most cases, this should be the default profile shipped with the extension (see CERT for Java Compliance Profile). This setting is available for all widgets. |
CERT for Java Compliance Widgets
The following widgets are shipped with the CERT for Java Compliance DTP Workflow to help you achieve CERT for Java Compliance goals.
CERT Compliance - Status
This widget provides an overview of the project's CERT compliance status.
By default, the widget shows Rules and Recommendations, as well as all priority levels. You can add multiple instances of the widget and configure different combinations to create robust views of the compliance status. Click on the widget to open the CERT for Java Compliance Report.
CERT Levels - Target
This widget shows the highest concentration of static analysis violations per CERT category. It provides an overview of the compliance status, as well as applicable deviations, in the tooltip. Click on the widget to open the CERT for Java Compliance Report.
CERT Compliance - Status
The widget shows the overall compliance status, as well as the compliance status for each CERT level. You can add multiple instances of the widget configured to use a different profile, for example, a profile with disabled guidelines, to view your current compliance status. Click on the widget to open the CERT for Java Compliance Report.
The code can be compliant with deviations and violations that have been deemed acceptable. See Deviation Report for additional information about deviations.
The status will be set to Not Compliant if Parasoft code analysis rules documented in your profile were not included in the specified build or if unacceptable violations have been reported. Make sure all rules are enabled in Jtest and re-run analysis.
CERT Compliance - Percentage Widget
This widget shows the completeness of CERT compliance as a percentage. Completeness is based on the number of guidelines being enforced in the profile. The CERT for Java dashboard includes three instances of this widget, one for each level. Click on the widget to open the CERT for Java Compliance Report.
CERT Compliance - Guidelines by Status
This widget shows the compliance status for a specific Rule or Recommendation per priority level.
You can add multiple instances of the widget configured to different type/priority level combinations to help you understand your compliance status from different perspectives. The pie chart can represent up to four different guideline statuses for the selected category:
Green | Guidelines your code is in compliance with for the selected type and level. |
Yellow | Guidelines that your code is deviating from but are still considered compliant. A deviation is when the guideline is not being followed according to the Parasoft static analysis rule, but is considered acceptable because it does not affect the safety of the software. Deviations represent Parasoft static analysis rules that have been suppressed. |
Orange | Guidelines that your code is considered compliant with, even though the static analysis rules that enforce them contain violations. Only Recommendations can have this status. |
Red | Guidelines that your code is not compliant with. |
You can perform the following actions:
- Mouse over a pie slice to view details.
- Click on a section to open the CERT for Java Compliance Report filtered by the type, priority, and compliance status.
- Click on the number of violations counter to open the CERT for Java Compliance Report filtered by the type, priority, and compliance status.
- Click on the number of deviations counter to open the Deviation Report filtered by the type and priority.
CERT Violations by Category - TreeMap Widget
This widget provides a representation of the highest concentration of static analysis violations per type and priority level. Tiles are color-coded according the priority level:
- Red tiles represent L1 violations.
- Yellow tiles represent L2 violations.
- Green tiles represent L3 violations.
The Parasoft rule(s) enforcing violations are also presented. Tiles are proportional to the number of static analysis violations reported for each rule.
The widget uses the hierarchy established in the model profile to correlate Parasoft rules with CERT rules, recommendations, and priorities. You can mouse over a tile in the widget to view the number of violations associated with each rule/guideline/category.
Click on a rule to see the violation in the Violations Explorer.
CERT Compliance by Priority
This widget is an implementation of the standard Compliance By Category widget shipped with DTP. It shows the number and percentage of rules in compliance grouped by rule categories.
Click on an entry in the table to open the Violations by Compliance Category report.
Top 5 CERT Categories
This widget is an implementation of the standard Categories - Top 5 Table widget shipped with DTP. It shows the five CERT guideline categories with the most violations.
Click on a link in the Name column or the more... link to open the Violations by Compliance Category report.
Top 5 CERT Guidelines
This widget is an implementation of the standard Categories - Top 5 Table widget shipped with DTP. It shows the five CERT guidelines with the most violations.
Click on a link in the Name column or the more... link to open the Violations by Compliance Category report.
CERT Analysis Compliance
This widget is an implementation of the standard Rules in Compliance - Summary widget shipped withe DTP. This widgets shows the following information:
- How many static analysis rules for the selected compliance standard were enabled during code analysis.
- How many violations were reported.
- The overall percentage of rules that did not report violations.
- The change in number of violations from the baseline build to the target build as a percentage (if applicable).
Click on the widget to open the Violations by Compliance Category report.
CERT for Java Compliance Reports
The CERT Compliance Report provides an overview of your CERT compliance status and serves as the primary document for demonstrating compliance.
You can perform the following actions:
- Use the menus to sort by the following criteria:
- Guideline type: Rule, Recommendation, or All
- Priority level: L1, L2, L3, or All
- Compliance status: All, No Rules Enabled, Compliant, Compliant With Deviations, Compliant With Violations, Not Compliant, Missing Rule(s) in Analysis
- Click a link in the # of Violations to view the violations in the Violations Explorer.
- Click a link in the # of Deviations to view the suppressed violations in the Violations Explorer.
- Open one of the CERT Compliance sub-reports.
- Click Download PDF to download a printer-friendly PDF version of the report data. If you added a custom graphic to DTP as described in Adding a Custom Graphic to the Navigation Bar, the PDF will also be branded with the graphic.
The CERT Compliance Report contains the following supporting reports:
Conformance Testing Plan
The Conformance Testing Plan cross-references CERT guidelines with Parasoft static analysis rules using the data specified in the compliance profile. You can change the severity, likelihood, remediation cost, and other values to meet your project goals by configuring the profile. Click on a guideline to view the CERT documentation on the CERT website.
Deviation Report
Your code can contain violations and still be CERT-compliant as long as the deviations from the standard are documented and that the safety of the software is unaffected. Deviations are code analysis rules that have been suppressed either directly in the code or in the DTP Violations Explorer. See the Jtest documentation for details on suppressing violations in the code. See Suppressing Violations in the Violations Explorer documentation for information about suppressing violations in DTP.
Click the Deviation Report link in the CERT Compliance Report to open the Deviation Report.
The Deviations Report shows all guideline IDs and headers, but guidelines that have been suppressed will show additional information. You can perform the following actions:
- Filter the report by type (Rule, Recommendation, All).
- Filter the report by level (L1, L2, L3).
- Enable Only Deviations to only show deviations.
- Enable Hide Modification History to exclude the modification history for deviations.
Build Audit Report
The Build Audit Report is native functionality in DTP. It shows an overview of code analysis violations, as well as test results and coverage information, associated with the build. This report also allows you to download an archive of the data, which is an artifact you can use to demonstrate compliance with CERT during a regulatory audit.
In order to download an archive, the build has to be locked. See Build Audit Report for additional details about this report.
Profiles
The Security Compliance Pack includes a profile associated with the core CERT for Java workflow.
CERT for Java Compliance Profile
The CERT for Java Compliance DTP Workflow ships with a default profile that includes information necessary for generating CERT compliance reports. The default profile shows the correlation between CERT guidelines and Parasoft code analysis rules and is suitable for most normal use cases.
Do not modify the CERT profile
We strongly advise you to avoid changing the default CERT for Java profile because doing so will affect any reports you may need to generate for auditing purposes.
If necessary, you can make a copy of the default profile and adjust the correlation between Parasoft code analysis rules and CERT for Java guidelines to achieve your software quality and compliance goals.
- Open Extension Designer and click the Model Profile tab.
- Expand the CERT Compliance model and choose the SEI CERT Oracle Coding Standard for Java profile.
- Click Export Profile to download a copy.
- Rename the copy and click Import Profile.
- Browse for the copy and confirm to upload.
- Rename the profile and click Edit.
- Make your adjustments and click Save.