Skip to content

Get a preview of key risk and policy suggestion changes based on threat level changes

PATCH
/v1/threats/preview

This endpoint is only guaranteed to work correctly IF every threat position is valid for the organization, and all of the threat positions are passed in the request body.

Array<object>

A position of a threat.

This is used to calculate the consequence of moving a threat objective to a certain likelihood and impact.

In most cases, it’s better to use a ThreatProfile than to use a Vec<ThreatPosition>.

object
impact
required

Y-axis for the threat objective

string
Allowed values: Very Low Low Medium High Severe
likelihood
required

X-axis for the threat objective

string
Allowed values: Remote Unlikely Possible Probable Imminent
name
required

PK of the threat objective in the database

string
Allowed values: Sabotage Data Disclosure Extortion Customer Targeting Resource Hijacking Fraud

Get a threat level preview

Determines that the ramifications of a current threat proposal will be compared to the “cannon” version

object
document_changes_list
required

Contains a list of policy changes that will affect how adversarial notifies users about their policies

Array<object>

Contains a list of changes for a single document that will occur if a proposal is approved.

object
changes
required
One of:
object
change_type
required
string
Allowed values: uninitialized
value
required
Array<object>

Contains a list of changes that will occur if a proposal is approved.

Does contain the driver field like [PolicySuggestion] because the value provides this information.

object
id
required

The node id the selector

string
value
required

The value of the selector upon document initialization.

object
association
One of:
null
name
required
string
value
object | null
weight
required
integer format: int32
document_id
required

A slug and version pair that uniquely identifies a document.

As a string, the format should be slug:version, where slug is a string that is a valid slug and version is a string that is a valid version.

Example

# use std::str::FromStr;
# use backend::views::document::{DocumentId, Version};
# use backend::views::common::Slug;

let document_id_str = "cybersecurity-policy:1.0.0";
let document_id: DocumentId = DocumentId::from_str(document_id_str).unwrap();
assert_eq!(document_id.slug.as_str(), "cybersecurity-policy");
assert_eq!(document_id_str.to_string(), DocumentId::new(Slug::from_str("cybersecurity-policy").unwrap(), Version::new(1, 0, 0)).to_string());
object
slug
required

The slug of the document. i.e. cybersecurity-policy

string
version
required

The version of the document. i.e. 1.0.0

Array<integer>
>= 3 items <= 3 items
risk_changes
required

Contains a list of changes that will occur for AKRs if the proposed state is approved

Array<object>

Defines the change between an akr in its original state, to an akr after its been modified.

object
new_position
required

Describes the new position and the responsible threat objective for a risk change

should be renamed to new_score

object
position
required

Usually part of a larger struct, defines a combination of likelihood and impact Sometimes these distinct values are necessary, since they contain more “information” than [Urgency] alone.

object
impact
required
string
Allowed values: Very Low Low Medium High Severe
likelihood
required
string
Allowed values: Remote Unlikely Possible Probable Imminent
threat_objectives
required

The threat objective that caused this change to occur

TODO: use fnv once utoipa supports different hasher derivations

Array<string>
unique items
Allowed values: Sabotage Data Disclosure Extortion Customer Targeting Resource Hijacking Fraud
original_position
required

Should be renamed to original_score

object
position
required

Usually part of a larger struct, defines a combination of likelihood and impact Sometimes these distinct values are necessary, since they contain more “information” than [Urgency] alone.

object
impact
required
string
Allowed values: Very Low Low Medium High Severe
likelihood
required
string
Allowed values: Remote Unlikely Possible Probable Imminent
threat_objectives
required

The threat objective that caused this change to occur

TODO: use fnv once utoipa supports different hasher derivations

Array<string>
unique items
Allowed values: Sabotage Data Disclosure Extortion Customer Targeting Resource Hijacking Fraud
risk
required

Describes the short summary of a risk

object
description
required
string
id
required
integer format: int64
title
required
string