Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Moved the notice that C++ recommendations have been removed to the opening paragraph of the page.

CERT coding standards consist of rules and recommendations. Rules are meant to provide normative requirements for code; recommendations are meant to provide guidance that, when followed, should improve the safety, reliability, and security of software systems. However, a violation of a recommendation does not necessarily indicate the presence of a defect in the code. Rules and recommendations are collectively referred to as guidelines.

NOTE: The CERT C++ Coding Standard does not currently expose any recommendations; all C++ recommendations have been removed pending further review and development.

Rules

Rules must meet the following criteriaThis secure coding standard consists of rules and recommendations. Coding practices are defined to be rules when all of the following conditions are met:

  1. Violation of the coding practice guideline is likely to result in a defect that may adversely affect the safety, reliability, or security of a system, for example, by introducing a security flaw that  that may result in an exploitable exploitable vulnerability.There is a denumerable set of conditions for which violating the coding practice is necessary to ensure correct behavior
  2. The guideline does not rely on source code annotations or assumptions.
  3. Conformance to the coding practice guideline can be determined through automated analysis (either static or dynamic), formal methods, or manual inspection techniques.

...

Recommendations

Recommendations are guidelines or suggestions . Coding practices for improving code quality. Guidelines are defined to be recommendations when all of the following conditions are met:

  1. Application of the coding practice a guideline is likely to improve system securitythe safety, reliability, or security of software systems.
  2. One or more of the requirements necessary for a coding practice guideline to be considered a rule cannot be met.

The set of recommendations that a particular development effort adopts depends on the security requirements of the final software product. Projects with high-security requirements can stricter requirements may decide to dedicate more resources to security and are consequently likely to adopt a larger set of recommendations.

To ensure that the source code conforms to this secure coding standard, it is necessary to have measures in place that check for rules violations. The most effective means of achieving this is to use one or more static analysis tools. Where a rule cannot be checked by a tool, then a manual review is required.

Identifiers

Each rule and recommendation is given a unique identifier. These identifiers consist of three parts:

  • a three-letter mnemonic representing the section of the standard
  • a two-digit numeric value in the range of 00-99
  • the letters "CPP" indicate that this is a C++ language guideline

The three-letter mnemonic can be used to group similar coding practices and to indicate to which category a coding practice belongs.

The numeric value is used to give each coding practice a unique identifier. Numeric values in the range of 00-29 are reserved for recommendations, while values in the range of 30-99 are reserved for rules.

ensuring the safety, reliability, and security of a system and consequently are likely to adopt a broader set of recommendations.


 Image Removed      00. Introduction      Image Removed