SCAIFE Statistics Module API Definition

This API definition facilitates auditing static analysis alerts using classifiers, optional adaptive heuristics (active learning), and alert prioritization. The API enables jump-starting labeled datasets using test suites. It is intended to enable a wide range of users (with widely varying datasets, static analysis tools, machine learning expertise, and amount of labeled data) to benefit from using classifiers and sophisticated prioritization to automatically triage static analysis alerts.
More information: https://www.sei.cmu.edu/research-capabilities/all-work/display.cfm?customel_datapageid_4050=6453
Contact Info: lflynn@cert.org
Version: 1.2.1
BasePath:
SCAIFE API Copyright 2007-2020 Carnegie Mellon University. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Products derived from this software may not include 'Carnegie Mellon University,' 'SEI' and/or 'Software Engineering Institute' in the name of such derived product, nor shall 'Carnegie Mellon University,' 'SEI' and/or 'Software Engineering Institute' be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact permission@sei.cmu.edu. ACKNOWLEDGMENTS AND DISCLAIMERS: This material is based upon work funded and supported by the Department of Defense under Contract No. FA8702-15-D-0002 with Carnegie Mellon University for the operation of the Software Engineering Institute, a federally funded research and development center. The view, opinions, and/or findings contained in this material are those of the author(s) and should not be construed as an official Government position, policy, or decision, unless designated by other documentation. NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN 'AS-IS' BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. [DISTRIBUTION STATEMENT A] This material has been approved for public release and unlimited distribution. Please see Copyright notice for non-US Government use and distribution. This material includes field names used in the Software Assurance Marketplace (SWAMP), a service that provides continuous software assurance capabilities to developers and researchers at https://www.mir-swamp.org/#. Copyright © 2012-2020 The Morgridge Institute for Research, Inc. All rights reserved. This material includes field names used in the Software Assurance Tool (SwAT), a tool that is used by analysts to analyze static analysis alerts from multiple static analysis tools. https://www.cerdec.army.mil/ Combat Capabilities Development Command (CCDC) C5ISR Center. All rights reserved. DM19-0572
http://apache.org/licenses/LICENSE-2.0.html

Access

Methods

[ Jump to Models ]

Table of Contents

DataHubToStats

StatsServer

UIToStats

DataHubToStats

Up
put /projects/{project_id}/packages/{package_id}/alerts
Forward new Alerts that have been uploaded to the DataHub and have a current open adaptive heuristic request for its respective package. Returns status message for the DataHub to track if the request was completed. (sendAlertUpdatesForClassifier)

Path parameters

project_id (required)
Path Parameter — The id of the project associated with these alerts
package_id (required)
Path Parameter — The id of the package associated with these alerts

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

multiple_alerts multiple_alerts (required)
Body Parameter — Updated alert data

Request headers

Return type

alert_updates_response

Example data

Content-Type: application/json
{
  "project_id" : "project_id",
  "package_id" : "package_id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK alert_updates_response

400

Unable to Upload Alerts

401

Invalid Token Request

403

Missing Required Tokens

404

Required Resources Not Found

default

Unexpected Error error

Up
put /packages/tools/{tool_id}
Send FFSA or code metrics tool info to the Stats Module. When a new tool is uploaded, the DataHub can send new tool info for packages with open adaptive heuristic requests automatically to keep the Stats Module in sync. (sendNewTool)

Path parameters

tool_id (required)
Path Parameter — The id of the tool uploaded to the DataHub

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

packages_with_tool_data packages_with_tool_data (required)
Body Parameter — Tool info, including name, version, plus FFSA checker info OR code metrics field info and package ids associated with this new tool.

Request headers

Return type

request_token

Example data

Content-Type: application/json
{
  "message" : "message",
  "request_id" : "request_id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK request_token

400

Invalid Request

401

Invalid Token Request

403

Missing Required Tokens

404

Package Not Found

default

Unexpected Error error

StatsServer

Up
get /status
Provides Server Status (getStatus)

Request headers

Return type

request_token

Example data

Content-Type: application/json
{
  "message" : "message",
  "request_id" : "request_id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Server Is Running request_token

400

Database Connection Lost

default

Unexpected Error error

UIToStats

Up
put /classifiers/{classifier_instance_id}/adaptive_heuristics/close
Stop adaptive heuristic forward request. Send a request to close (set to false) the adaptive heuristic for the packages listed in the classifier instance. (closeAdaptiveHeuristicDataForwarding)

Path parameters

classifier_instance_id (required)
Path Parameter — The id of the classifier instance to run on the target domain

Consumes

This API call consumes the following media types via the Content-Type request header:

Request headers

Return type

close_adaptive_heuristics_response

Example data

Content-Type: application/json
{
  "message" : "message",
  "classifier_instance_id" : "classifier_instance_id"
}

Responses

200

OK close_adaptive_heuristics_response

400

Invalid Close Request

401

Invalid Token Request

403

Missing Required Tokens

404

Classifier Instance Unavailable

default

Unexpected Error error

Up
post /classifiers
Create a new classifier instance. Send Classifier information including Automated Hyper-Parameter Optimization (AHPO) and Adaptive Heuristics to the Stats Module along with package_ids for packages to use in creating/training a classifier. Returns an id that is used to then run the classifier and any additional information for the classifier. (createClassifierInstance)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

classifier_instance classifier_instance (required)
Body Parameter — Classifier information to create

Request headers

Return type

create_classifier_response

Example data

Content-Type: application/json
{
  "analysis_messages" : "{}",
  "project_id" : "project_id",
  "classifier_instance_id" : "classifier_instance_id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK create_classifier_response

400

Unable to Create Classifier

401

Invalid Token Request

403

Missing Required Tokens

404

Required Resources Not Found

422

Data Lacks Verdicts Labeled 'True' and 'False'

501

Error Retrieving DataHub Information

default

Unexpected Error error

Up
delete /classifiers/{classifier_instance_id}
Delete a specific classifier from the Stats module by classifier_instance_id. (deleteClassifierInstance)

Path parameters

classifier_instance_id (required)
Path Parameter — The id of the classifier to delete

Consumes

This API call consumes the following media types via the Content-Type request header:

Request headers

Return type

request_token

Example data

Content-Type: application/json
{
  "message" : "message",
  "request_id" : "request_id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Classifier Successfully Deleted request_token

400

Invalid Request

401

Invalid Token Request

403

Missing Required Tokens

404

Unable to Delete Classifier

default

Unexpected Error error

Up
put /classifiers/{classifier_instance_id}
Edit a specific classifier from the Stats module by classifier_instance_id. (editClassifierInstance)

Path parameters

classifier_instance_id (required)
Path Parameter — The id of the classifier instance to edit

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

classifier_instance classifier_instance (required)
Body Parameter — Classifier information to edit

Request headers

Return type

create_classifier_response

Example data

Content-Type: application/json
{
  "analysis_messages" : "{}",
  "project_id" : "project_id",
  "classifier_instance_id" : "classifier_instance_id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK create_classifier_response

400

Unable to Edit Classifier

401

Invalid Token Request

403

Missing Required Tokens

404

Required Resources Not Found

422

Data Lacks Verdicts Labeled 'True' and 'False'

501

Error Retrieving DataHub Information

default

Unexpected Error error

Up
get /classifiers/{classifier_instance_id}
Get analysis for a specific Classifier including performance metrics. (getClassifierInstanceAnalysis)

Path parameters

classifier_instance_id (required)
Path Parameter — The id of the classifier to get analysis info

Consumes

This API call consumes the following media types via the Content-Type request header:

Request headers

Return type

analysis_results

Example data

Content-Type: application/json
{
  "probability_data" : [ {
    "probability" : 0.8008281904610115,
    "meta_alert_id" : "meta_alert_id"
  }, {
    "probability" : 0.8008281904610115,
    "meta_alert_id" : "meta_alert_id"
  } ],
  "performance_metrics" : "{}",
  "classifier_analysis" : "{}",
  "classifier_instance_id" : "classifier_instance_id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK analysis_results

400

Invalid Request

401

Invalid Token Request

403

Missing Required Tokens

404

Classifier Information Unavailable

default

Unexpected Error error

Up
get /classifiers
List all classifiers and their associated data. Use the ids returned from this request to work with classifiers. (listClassifiers)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request headers

Return type

array[list_classifiers_response]

Example data

Content-Type: application/json
[ {
  "classifier_id" : "classifier_id",
  "classifier_type" : "classifier_type",
  "adaptive_heuristics" : [ {
    "adaptive_heuristic_name" : "adaptive_heuristic_name",
    "adaptive_heuristic_id" : "adaptive_heuristic_id",
    "adaptive_heuristic_parameters" : "{}"
  }, {
    "adaptive_heuristic_name" : "adaptive_heuristic_name",
    "adaptive_heuristic_id" : "adaptive_heuristic_id",
    "adaptive_heuristic_parameters" : "{}"
  } ],
  "ahpos" : [ {
    "ahpo_id" : "ahpo_id",
    "ahpo_name" : "ahpo_name",
    "ahpo_parameters" : "{}"
  }, {
    "ahpo_id" : "ahpo_id",
    "ahpo_name" : "ahpo_name",
    "ahpo_parameters" : "{}"
  } ]
}, {
  "classifier_id" : "classifier_id",
  "classifier_type" : "classifier_type",
  "adaptive_heuristics" : [ {
    "adaptive_heuristic_name" : "adaptive_heuristic_name",
    "adaptive_heuristic_id" : "adaptive_heuristic_id",
    "adaptive_heuristic_parameters" : "{}"
  }, {
    "adaptive_heuristic_name" : "adaptive_heuristic_name",
    "adaptive_heuristic_id" : "adaptive_heuristic_id",
    "adaptive_heuristic_parameters" : "{}"
  } ],
  "ahpos" : [ {
    "ahpo_id" : "ahpo_id",
    "ahpo_name" : "ahpo_name",
    "ahpo_parameters" : "{}"
  }, {
    "ahpo_id" : "ahpo_id",
    "ahpo_name" : "ahpo_name",
    "ahpo_parameters" : "{}"
  } ]
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK

400

Invalid Request

401

Invalid Token Request

403

Missing Required Tokens

default

Unexpected Error error

Up
put /classifiers/{classifier_instance_id}/retrain
Returns new probability values if there are updates from the selected classifier_instance. (retrain)

Path parameters

classifier_instance_id (required)
Path Parameter — The id of the classifier instance to run on the target domain

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

classifier_instance_data classifier_instance_data (required)
Body Parameter — Information to send close adaptive heuristic request

Request headers

Return type

classifier_results

Example data

Content-Type: application/json
{
  "probability_data" : [ {
    "probability" : 0.8008281904610115,
    "meta_alert_id" : "meta_alert_id"
  }, {
    "probability" : 0.8008281904610115,
    "meta_alert_id" : "meta_alert_id"
  } ],
  "project_id" : "project_id",
  "classifier_analysis" : "{}",
  "classifier_instance_id" : "classifier_instance_id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK classifier_results

204

Not Updates

400

Unable to Run Classifier

401

Invalid Token Request

403

Missing Required Tokens

404

Required Resources Not Found

422

Data Lacks Verdicts Labeled 'True' and 'False'

501

Error Retrieving DataHub Information

default

Unexpected Error error

Up
put /classifiers/{classifier_instance_id}/projects/{project_id}
Run a specific classifier instance on the project identified by id in the path. The response contains estimated class probablities and analysis of classifier performance. (runClassifierInstance)

Path parameters

classifier_instance_id (required)
Path Parameter — The id of the classifier instance to run on the target domain
project_id (required)
Path Parameter — The id of the project containing the packages

Consumes

This API call consumes the following media types via the Content-Type request header:

Request headers

Return type

classifier_results

Example data

Content-Type: application/json
{
  "probability_data" : [ {
    "probability" : 0.8008281904610115,
    "meta_alert_id" : "meta_alert_id"
  }, {
    "probability" : 0.8008281904610115,
    "meta_alert_id" : "meta_alert_id"
  } ],
  "project_id" : "project_id",
  "classifier_analysis" : "{}",
  "classifier_instance_id" : "classifier_instance_id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK classifier_results

400

Unable to Run Classifier

401

Invalid Token Request

403

Missing Required Tokens

404

Required Resources Not Found

501

Error Retrieving DataHub Information

default

Unexpected Error error

Models

[ Jump to Methods ]

Table of Contents

  1. alert -
  2. alert_updates_response -
  3. analysis_results -
  4. checker_mappings -
  5. classifier_instance -
  6. classifier_instance_data -
  7. classifier_results -
  8. classifier_results_probability_data -
  9. close_adaptive_heuristics_response -
  10. condition -
  11. create_classifier_response -
  12. determination -
  13. determination_dangerous_construct_list -
  14. determination_dead_list -
  15. determination_flag_list -
  16. determination_ignored_list -
  17. determination_inapplicable_environment_list -
  18. determination_notes_list -
  19. determination_verdict_list -
  20. error -
  21. list_classifiers_response -
  22. list_classifiers_response_adaptive_heuristics -
  23. list_classifiers_response_ahpos -
  24. message -
  25. meta_alert -
  26. metrics -
  27. multiple_alerts -
  28. packages_with_tool_data -
  29. packages_with_tool_data_tool_data -
  30. request_token -
  31. source_mappings -
  32. sourcefile -
  33. sourcefunction -
  34. taxonomy -
  35. secondary_message -

alert - Up

alert_id
tool_id
checker_id
primary_message
secondary_messages (optional)

alert_updates_response - Up

project_id (optional)
package_id (optional)

analysis_results - Up

classifier_instance_id (optional)
probability_data (optional)
classifier_analysis (optional)
performance_metrics (optional)

checker_mappings - Up

checker_id (optional)
checker_name (optional)
tool_id (optional)
conditions (optional)

classifier_instance - Up

classifier_id
classifier_type (optional)
classifier_instance_name (optional)
project_ids
ahpo_id (optional)
ahpo_name (optional)
ahpo_parameters (optional)
adaptive_heuristic_id (optional)
adaptive_heuristic_name (optional)
adaptive_heuristic_parameters (optional)

classifier_instance_data - Up

project_id
String The id of the target project to run the classifier on
timestamp
Date The current time format: date-time

classifier_results - Up

classifier_instance_id (optional)
project_id
String ID of project in the target domain
probability_data
classifier_analysis (optional)

classifier_results_probability_data - Up

meta_alert_id (optional)
probability (optional)
Double format: double

close_adaptive_heuristics_response - Up

classifier_instance_id (optional)
message (optional)

condition - Up

condition_id (optional)
condition_name (optional)
title (optional)
platforms (optional)
code_language_ids (optional)
condition_fields (optional)
Object Fields associated with this condition, i.e., likelihood
taxonomy (optional)

create_classifier_response - Up

classifier_instance_id (optional)
project_id (optional)
analysis_messages (optional)
Object Additional information that will help to understand this classifier instance's performance

determination - Up

flag_list (optional)
verdict_list (optional)
ignored_list (optional)
dead_list (optional)
inapplicable_environment_list (optional)
dangerous_construct_list (optional)
notes_list (optional)

determination_dangerous_construct_list - Up

dangerous_construct (optional)
String Options for this field include Unknown, No Risk, Low Risk, Medium Risk, and High Risk
timestamp (optional)
Date format: date-time

determination_dead_list - Up

dead (optional)
String Options for this field include True, False, and Unknown
timestamp (optional)
Date format: date-time

determination_flag_list - Up

flag (optional)
timestamp (optional)
Date format: date-time

determination_ignored_list - Up

ignored (optional)
String Options for this field include True, False, and Unknown
timestamp (optional)
Date format: date-time

determination_inapplicable_environment_list - Up

inapplicable_environment (optional)
String Options for this field include True, False, and Unknown
timestamp (optional)
Date format: date-time

determination_notes_list - Up

notes (optional)
timestamp (optional)
Date format: date-time

determination_verdict_list - Up

verdict (optional)
String 'Options for this field include Unknown, Complex, False, Dependent, and True
timestamp (optional)
Date format: date-time

error - Up

code
message

list_classifiers_response - Up

classifier_id (optional)
classifier_type (optional)
ahpos (optional)
adaptive_heuristics (optional)

list_classifiers_response_adaptive_heuristics - Up

adaptive_heuristic_id (optional)
adaptive_heuristic_name (optional)
adaptive_heuristic_parameters (optional)

list_classifiers_response_ahpos - Up

ahpo_id (optional)
ahpo_name (optional)
ahpo_parameters (optional)

message - Up

line_start
line_end (optional)
filepath
source_file_id
source_function_id (optional)

meta_alert - Up

meta_alert_id
condition_id (optional)
filepath (optional)
line_number (optional)
determination (optional)
alert_ids (optional)
auto_verdict (optional)

metrics - Up

multiple_alerts - Up

source_files (optional)
meta_alerts (optional)
alerts (optional)

packages_with_tool_data - Up

package_ids (optional)
tool_data (optional)

packages_with_tool_data_tool_data - Up

tool_name (optional)
tool_version (optional)
tool_type (optional)
source_mappings (optional)
code_metrics_data (optional)

request_token - Up

request_id
String Id used to correlate messages with each other
message (optional)

source_mappings - Up

mapping_source (optional)
checker_mappings (optional)

sourcefile - Up

source_file_id (optional)
filename (optional)
filepath (optional)
filepath_depth (optional)
defect_info (optional)
code_metrics_data (optional)
functions (optional)

sourcefunction - Up

source_function_id (optional)
name (optional)
line_start (optional)
line_end (optional)
code_metrics_data (optional)

taxonomy - Up

taxonomy_id
taxonomy_name
String Name of the taxonomy, i.e., CERT or CWE
taxonomy_version
description (optional)

secondary_message - Up

line_start
line_end (optional)
filepath
source_file_id
source_function_id (optional)
message_text