rapid7 / recog

Pattern recognition for hosts, services, and content
Other
671 stars 199 forks source link

Enforce all fingerprints to require examples #416

Open dabdine opened 2 years ago

dabdine commented 2 years ago

Is your feature request related to a problem? Please describe. Fingerprint elements in fingerprint XML files should always contain examples. Work has been done in previous PRs to settle many broken <example> tags. However, several other <fingerprint> XML elements are missing <example> elements altogether. We should enforce that examples are always present.

Describe the solution you'd like

  1. Update all fingerprint files to have an example, even if the data must be mocked (with an XML comment indicating as such).
  2. Update fingerprints.xsd after #410 is merged so that minOccurs on <example> is 1 instead of 0: https://github.com/rapid7/recog/blob/master/xml/fingerprints.xsd#L106. With this simple change, once #410 lands the XML schema validation logic in recog_verify should automatically flag any missing example elements as an error (thus, giving developers immediate feedback & ensuring CI PR builds fail if one is not included).

Describe alternatives you've considered None.

Additional context Clearing out all warnings & errors from the existing XML fingerprint files should help greatly in enforcing strict standards for new fingerprints that are added, and ultimately ensure recog is kept high quality.