Create Risk Policy Set

POST {{apiPath}}/environments/{{envID}}/riskPolicySets

The POST /environments/{{envID}}/riskPolicySets operation adds a new risk policy set to the specified environment.

This example uses the Scores approach for combining the individual predictors.

Note that condition.type is set to AGGREGATED_SCORES, and that the request contains the array condition.aggregatedScores rather than condition.aggregatedWeights.

Prerequisites

See Risk Predictors for more information, including the data models.

Base data model

PropertyTypeRequired?
createdAtDateRequired
defaultBooleanOptional
defaultResultObjectOptional
descriptionStringOptional
environment.idStringRequired
evaluatedPredictorsString[]Optional
idStringRequired
nameStringRequired
riskPoliciesString[]Required
triggersObject[]Optional
triggers.typeStringRequired
triggers.policySetObjectRequired
triggers.policySet.idStringRequired
triggers.expiresAtStringRequired
updatedAtDateRequired

Risk policies data model

This table lists the fields and objects that can be included in each of the elements in the riskPolicies array.

PropertyTypeRequired?
conditionObjectRequired
condition.aggregatedScoresArrayRequired/Optional
condition.aggregatedScores.valueStringRequired
condition.aggregatedScores.scoreIntegerRequired
condition.typeStringRequired
condition.between.minScoreIntegerRequired/Optional
condition.between.maxScoreIntegerRequired/Optional
createdAtDateRequired
descriptionStringOptional
idStringRequired
nameStringRequired
priorityIntegerRequired
result.levelStringRequired
updatedAtDateRequired

Request Body

{"name"=>"Score-based policy", "default"=>false, "defaultResult"=>{"level"=>"Low"}, "riskPolicies"=>[{"name"=>"ANONYMOUS_NETWORK_DETECTION", "result"=>{"level"=>"HIGH"}, "condition"=>{"value"=>"${details.anonymousNetworkDetected}", "equals"=>true}}, {"name"=>"GEOVELOCITY_ANOMALY", "result"=>{"level"=>"MEDIUM"}, "condition"=>{"value"=>"${details.impossibleTravel}", "equals"=>true}}, {"name"=>"Medium scored policy", "result"=>{"level"=>"MEDIUM"}, "condition"=>{"type"=>"AGGREGATED_SCORES", "aggregatedScores"=>[{"value"=>"${details.userLocationAnomaly.level}", "score"=>40}, {"value"=>"${details.anonymousNetwork.level}", "score"=>60}, {"value"=>"${details.ipRisk.level}", "score"=>40}], "between"=>{"minScore"=>700, "maxScore"=>900}}}, {"name"=>"High scored policy", "result"=>{"level"=>"HIGH"}, "condition"=>{"type"=>"AGGREGATED_SCORES", "aggregatedScores"=>[{"value"=>"${details.userLocationAnomaly.level}", "score"=>40}, {"value"=>"${details.anonymousNetwork.level}", "score"=>60}, {"value"=>"${details.ipRisk.level}", "score"=>40}], "between"=>{"minScore"=>900, "maxScore"=>1000}}}]}

RESPONSES

status: Created

{"_links":{"self":{"href":"https://api.pingone.eu/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/riskPolicySets/f394426f-9b71-4e01-ac78-2956a2e92ac2"},"environment":{"href":"https://api.pingone.eu/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"}},"id":"f394426f-9b71-4e01-ac78-2956a2e92ac2","environment":{"id":"abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"name":"Score-based policy","createdAt":"2022-07-21T06:54:42.494Z","updatedAt":"2022-07-21T06:54:42.494Z","defaultResult":{"level":"LOW","type":"VALUE"},"riskPolicies":[{"id":"e58475bc-ae86-44fa-aabe-37fcc59390f3","environment":{"id":"abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"policySet":{"id":"f394426f-9b71-4e01-ac78-2956a2e92ac2"},"name":"ANONYMOUS_NETWORK_DETECTION","priority":1,"result":{"level":"HIGH","type":"VALUE"},"condition":{"equals":true,"value":"${details.anonymousNetworkDetected}","type":"VALUE_COMPARISON"},"createdAt":"2022-07-21T06:54:42.494Z","updatedAt":"2022-07-21T06:54:42.494Z"},{"id":"bcb992d2-133b-438c-9d04-1f720a4e4011","environment":{"id":"abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"policySet":{"id":"f394426f-9b71-4e01-ac78-2956a2e92ac2"},"name":"GEOVELOCITY_ANOMALY","priority":2,"result":{"level":"MEDIUM","type":"VALUE"},"condition":{"equals":true,"value":"${details.impossibleTravel}","type":"VALUE_COMPARISON"},"createdAt":"2022-07-21T06:54:42.494Z","updatedAt":"2022-07-21T06:54:42.494Z"},{"id":"70ab14c2-bfbd-4c75-8d14-e6b85fbee064","environment":{"id":"abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"policySet":{"id":"f394426f-9b71-4e01-ac78-2956a2e92ac2"},"name":"Medium scored policy","priority":3,"result":{"level":"MEDIUM","type":"VALUE"},"condition":{"between":{"minScore":700,"maxScore":900},"aggregatedScores":[{"value":"${details.userLocationAnomaly.level}","score":40},{"value":"${details.anonymousNetwork.level}","score":60},{"value":"${details.ipRisk.level}","score":40}],"type":"AGGREGATED_SCORES"},"createdAt":"2022-07-21T06:54:42.494Z","updatedAt":"2022-07-21T06:54:42.494Z"},{"id":"3fabcf6f-1eb0-426b-9b1d-e448b9159866","environment":{"id":"abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"policySet":{"id":"f394426f-9b71-4e01-ac78-2956a2e92ac2"},"name":"High scored policy","priority":4,"result":{"level":"HIGH","type":"VALUE"},"condition":{"between":{"minScore":900,"maxScore":1000},"aggregatedScores":[{"value":"${details.userLocationAnomaly.level}","score":40},{"value":"${details.anonymousNetwork.level}","score":60},{"value":"${details.ipRisk.level}","score":40}],"type":"AGGREGATED_SCORES"},"createdAt":"2022-07-21T06:54:42.494Z","updatedAt":"2022-07-21T06:54:42.494Z"}],"default":false}