42Crunch API Conformance Scan
Now that we have reviewed and locked down our contract, we are going to perform a conformance scan.
API Contract Conformance Scan is a dynamic runtime analysis of your API to check that the behavior of the API conforms to the contract it advertises in its OpenAPI (formerly known as Swagger) definition.
You can run a scan on an API you have imported to 42Crunch Platform and deployed to find out if there are any mismatches between the API definition describing your API and what it actually does. If Conformance Scan testing finds any discrepancies, it reports the issues clearly so that you can fix them.
Authentication in Conformance Scan
If you have defined security requirements in your API, Conformance Scan must provide the information to fulfill those requirements when it sends requests to the API. When you configure the scan, you must therefore fill in the details that Conformance Scan can use to authenticate.
The configuration wizard shows the security requirements defined on the root level in the OpenAPI (Swagger) definition of your API in a drop-down list. Each line on the list corresponds to a security requirement in the API definition, and the text lists the names of the security schemes and their types in that security requirement.
Now 42Crunch fuzzes the OpenAPI (Swagger) file by sending it requests outside of the contract: different paths, different verbs, different transports, different parameters. Each and every one of these requests are not compliant with the contract, and SHOULD get rejected.
In this particular case 61 requests that were invalid did not get rejected. All of these discrepancies are potential vulnerabilities that we were not aware of. So, the backend code somehow still works with these inputs that are not valid. Typically APIs are tested for scenarios within the design of the API – by fuzzing outside of the contract, we are able to find unknown vulnerabilities that could have led to a data breach.
Conformance Scan produces a scan report that provides valuable information on how well your API conforms to its API definition. The report summarizes what was scanned and how the scan went, including the API’s response times, the received HTTP status codes, as well as any unexpected response status codes and their reasons. Clicking a found issue provides further details on it.
Tutorials: In our next tutorial we'll provide an overview of our API micro-firewall protection
Want to learn more? Here are some resources to help you out!