Continuum / Client / update_supply_chain_policy
update_supply_chain_policy¶
- Continuum.Client.update_supply_chain_policy(**kwargs)¶
Updates an existing policy. You can change the description, add rules, and change rules that have no active policy exception. The name can’t be changed, existing rules can’t be removed, and rules with an active policy exception can’t be changed until the exception expires or is deleted. The policy’s ID, ARN, and tags don’t change.
See also: AWS API Documentation
Request Syntax
response = client.update_supply_chain_policy( id='string', policy={ 'name': 'string', 'description': 'string', 'rules': [ { 'ruleId': 'string', 'enforcementMode': 'AUDIT'|'ENFORCE', 'denyWhen': { 'allOf': [ { 'signal': 'PACKAGE_IDENTITY'|'INSPECTOR_SEVERITY'|'KEV'|'MALICIOUS', 'operator': 'MATCHES'|'AT_LEAST'|'EQUALS'|'NOT_EQUALS'|'IN'|'PRESENT', 'value': { 'packageIdentity': { 'ecosystem': 'string', 'name': 'string', 'version': 'string', 'versionRange': 'string' }, 'severity': 'LOW'|'MEDIUM'|'HIGH'|'CRITICAL'|'UNTRIAGED', 'stringValue': 'string', 'stringSet': [ 'string', ] } }, ] } }, ] } )
- Parameters:
id (string) –
[REQUIRED]
The ID of the policy to update.
policy (dict) –
[REQUIRED]
The updated policy. The name must match the existing name, and the rules must include every existing rule ID.
name (string) – [REQUIRED]
The display name of the policy.
description (string) –
A description of the policy.
rules (list) – [REQUIRED]
The deny rules of the policy, from 1 to 5.
(dict) –
A single deny rule. The rule matches a package when all of its conditions are true. When several rules match, the strongest enforcement mode wins.
ruleId (string) – [REQUIRED]
The identifier of the rule, unique within the policy. Policy exceptions and decision evidence refer to rules by this ID.
enforcementMode (string) – [REQUIRED]
What happens when the rule matches. ENFORCE denies the package. AUDIT records the match and allows the package.
denyWhen (dict) – [REQUIRED]
The conditions that must all be true for the rule to match.
allOf (list) – [REQUIRED]
The conditions, from 1 to 20. All of them must be true for the rule to match.
(dict) –
A single condition: a signal, an operator, and a value. The service checks that the operator and value are valid for the signal when the policy is created or updated.
signal (string) – [REQUIRED]
The package attribute that the condition tests.
operator (string) – [REQUIRED]
How the signal is compared with the value.
value (dict) –
The value to compare the signal with. Omit it for the PRESENT operator, which takes no value.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
packageIdentity,severity,stringValue,stringSet.packageIdentity (dict) –
The package to match, for the PACKAGE_IDENTITY signal.
ecosystem (string) – [REQUIRED]
The package ecosystem, such as
npmorpypi.name (string) – [REQUIRED]
The package name, as used in its ecosystem.
version (string) –
Exact version. Mutually exclusive with versionRange, validated server-side.
versionRange (string) –
A version range as one or more comparisons separated by commas, such as
>=1.0, <2.0. Each comparison is=,>,>=,<, or<=followed by a version in the ecosystem’s own format. Ecosystem shorthands such as^1.0or~=1.2aren’t accepted. Mutually exclusive with version.
severity (string) –
An Amazon Inspector severity, for the INSPECTOR_SEVERITY signal.
stringValue (string) –
A single value, for the EQUALS and NOT_EQUALS operators.
stringSet (list) –
A set of up to 20 values, for the IN operator.
(string) –
A condition value, from 1 to 256 characters.
- Return type:
dict
- Returns:
Response Syntax
{ 'id': 'string', 'arn': 'string', 'policy': { 'name': 'string', 'description': 'string', 'rules': [ { 'ruleId': 'string', 'enforcementMode': 'AUDIT'|'ENFORCE', 'denyWhen': { 'allOf': [ { 'signal': 'PACKAGE_IDENTITY'|'INSPECTOR_SEVERITY'|'KEV'|'MALICIOUS', 'operator': 'MATCHES'|'AT_LEAST'|'EQUALS'|'NOT_EQUALS'|'IN'|'PRESENT', 'value': { 'packageIdentity': { 'ecosystem': 'string', 'name': 'string', 'version': 'string', 'versionRange': 'string' }, 'severity': 'LOW'|'MEDIUM'|'HIGH'|'CRITICAL'|'UNTRIAGED', 'stringValue': 'string', 'stringSet': [ 'string', ] } }, ] } }, ] }, 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) –
Output for
UpdateSupplyChainPolicy.id (string) –
The ID of the policy.
arn (string) –
The ARN of the policy.
policy (dict) –
The policy as stored after the update.
name (string) –
The display name of the policy.
description (string) –
A description of the policy.
rules (list) –
The deny rules of the policy, from 1 to 5.
(dict) –
A single deny rule. The rule matches a package when all of its conditions are true. When several rules match, the strongest enforcement mode wins.
ruleId (string) –
The identifier of the rule, unique within the policy. Policy exceptions and decision evidence refer to rules by this ID.
enforcementMode (string) –
What happens when the rule matches. ENFORCE denies the package. AUDIT records the match and allows the package.
denyWhen (dict) –
The conditions that must all be true for the rule to match.
allOf (list) –
The conditions, from 1 to 20. All of them must be true for the rule to match.
(dict) –
A single condition: a signal, an operator, and a value. The service checks that the operator and value are valid for the signal when the policy is created or updated.
signal (string) –
The package attribute that the condition tests.
operator (string) –
How the signal is compared with the value.
value (dict) –
The value to compare the signal with. Omit it for the PRESENT operator, which takes no value.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
packageIdentity,severity,stringValue,stringSet. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBERas the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBERis as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
packageIdentity (dict) –
The package to match, for the PACKAGE_IDENTITY signal.
ecosystem (string) –
The package ecosystem, such as
npmorpypi.name (string) –
The package name, as used in its ecosystem.
version (string) –
Exact version. Mutually exclusive with versionRange, validated server-side.
versionRange (string) –
A version range as one or more comparisons separated by commas, such as
>=1.0, <2.0. Each comparison is=,>,>=,<, or<=followed by a version in the ecosystem’s own format. Ecosystem shorthands such as^1.0or~=1.2aren’t accepted. Mutually exclusive with version.
severity (string) –
An Amazon Inspector severity, for the INSPECTOR_SEVERITY signal.
stringValue (string) –
A single value, for the EQUALS and NOT_EQUALS operators.
stringSet (list) –
A set of up to 20 values, for the IN operator.
(string) –
A condition value, from 1 to 256 characters.
createdAt (datetime) –
The time the policy was created.
updatedAt (datetime) –
The time of this update.
Exceptions