Continuum / Client / create_package_decision

create_package_decision

Continuum.Client.create_package_decision(**kwargs)

Evaluates one package against the service-managed malicious-package baseline and the calling account’s policies, and records an immutable decision. Call it before installing a package to learn whether to allow or deny it.

See also: AWS API Documentation

Request Syntax

response = client.create_package_decision(
    purl='string',
    clientToken='string'
)
Parameters:
  • purl (string) –

    [REQUIRED]

    The package URL (purl) of the package version to evaluate, such as pkg:npm/lodash@4.17.21.

  • clientToken (string) –

    Idempotency token. Generated SDKs fill it automatically. Within one hour, the same token with the same parameters returns the original decision, and the same token with different parameters returns ValidationException. Requests without a token are rejected with ValidationException.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'decisionId': 'string',
    'canonicalPurl': 'string',
    'evaluatedAction': 'ALLOW'|'DENY',
    'enforcementAction': 'ALLOW'|'DENY',
    'enforcementMode': 'NONE'|'AUDIT'|'ENFORCE',
    'reason': 'NO_DENY_MATCH'|'MALICIOUS_PACKAGE'|'POLICY_RULE_MATCHED'
}

Response Structure

  • (dict) –

    Output for CreatePackageDecision.

    • decisionId (string) –

      The ID of the decision. Use it with GetPackageDecision and ListDecisionEvidence.

    • canonicalPurl (string) –

      The package URL (purl) that was evaluated, as accepted by the service.

    • evaluatedAction (string) –

      The result of policy evaluation: DENY when the malicious-package baseline or a deny rule matched and no policy exception suppressed it, otherwise ALLOW.

    • enforcementAction (string) –

      The action to take. It differs from evaluatedAction only when enforcementMode is AUDIT: evaluatedAction is then DENY and enforcementAction is ALLOW.

    • enforcementMode (string) –

      The strongest enforcement mode among matches that a policy exception didn’t suppress: ENFORCE for the malicious-package baseline or an enforced rule, AUDIT for an audit-mode rule. NONE when there is no such match, including when policy exceptions suppressed every match.

    • reason (string) –

      Why the decision was made.

Exceptions