Inspector2 / Client / update_configuration

update_configuration

Inspector2.Client.update_configuration(**kwargs)

Updates the scan configuration for your Amazon Inspector account. If you don’t specify an accountId, this operation updates the delegated administrator’s configuration and propagates it to member accounts that have not been individually configured. If you specify an accountId, this operation updates that member account’s configuration. Only the delegated administrator can specify an accountId; member accounts cannot call this operation.

See also: AWS API Documentation

Request Syntax

response = client.update_configuration(
    accountId='string',
    ecrConfiguration={
        'rescanDuration': 'LIFETIME'|'DAYS_30'|'DAYS_180'|'DAYS_14'|'DAYS_60'|'DAYS_90'|'DAYS_3'|'DAYS_7',
        'pullDateRescanDuration': 'DAYS_14'|'DAYS_30'|'DAYS_60'|'DAYS_90'|'DAYS_180'|'DAYS_3'|'DAYS_7',
        'pullDateRescanMode': 'LAST_PULL_DATE'|'LAST_IN_USE_AT'
    },
    ec2Configuration={
        'scanMode': 'EC2_SSM_AGENT_BASED'|'EC2_HYBRID',
        'activateVMScanner': True|False
    },
    amiConfiguration={
        'lastLaunchedWithin': 'DAYS_180'|'DAYS_90'|'DAYS_60'|'DAYS_30'|'DAYS_14'|'DAYS_7',
        'createdWithin': 'DAYS_180'|'DAYS_90'|'DAYS_60'|'DAYS_30'|'DAYS_14'|'DAYS_7',
        'scanModeConfiguration': {
            'scanMode': 'SCAN_ALL'|'TARGET_SCANNING',
            'tags': [
                {
                    'key': 'string',
                    'value': 'string'
                },
            ],
            'excludeCopiedAmis': True|False,
            'excludeBackupDlmAmis': True|False
        }
    },
    updateConfigurationInheritance={
        'ec2Configuration': 'INHERIT_FROM_ADMIN',
        'ecrConfiguration': 'INHERIT_FROM_ADMIN',
        'amiConfiguration': 'INHERIT_FROM_ADMIN'
    }
)
Parameters:
  • accountId (string) – The 12-digit Amazon Web Services account ID of the member account whose scan configuration you want to update. When specified, you must be the delegated administrator for this member account. If not specified, the operation updates your own configuration and propagates changes to any member accounts that have not been individually configured.

  • ecrConfiguration (dict) –

    Specifies how the ECR automated re-scan will be updated for your environment.

    • rescanDuration (string) – [REQUIRED]

      The rescan duration configured for image push date.

    • pullDateRescanDuration (string) –

      The rescan duration configured for image pull date.

    • pullDateRescanMode (string) –

      The pull date for the re-scan mode.

  • ec2Configuration (dict) –

    Specifies how the Amazon EC2 automated scan will be updated for your environment.

    • scanMode (string) – [REQUIRED]

      The scan method that is applied to the instance.

    • activateVMScanner (boolean) –

      Whether to activate Amazon Inspector VM scanner for Amazon EC2 scanning.

  • amiConfiguration (dict) –

    The Amazon Machine Image (AMI) scan configuration to apply to the account.

    • lastLaunchedWithin (string) –

      Restricts scanning to AMIs that were last launched within the specified duration.

    • createdWithin (string) –

      Restricts scanning to AMIs that were created within the specified duration.

    • scanModeConfiguration (dict) – [REQUIRED]

      The scan mode configuration that determines which AMIs are scanned.

      • scanMode (string) – [REQUIRED]

        The scan mode that determines whether all AMIs are scanned or only those matching the specified tags.

      • tags (list) –

        The tag filters used to select which AMIs are scanned when using targeted scanning.

        • (dict) –

          A filter that matches Amazon Machine Images (AMIs) by tag key and, optionally, tag value.

          • key (string) – [REQUIRED]

            The tag key to match against an AMI’s tags.

          • value (string) –

            The tag value to match against an AMI’s tags. If omitted, the filter matches on the tag key alone.

      • excludeCopiedAmis (boolean) –

        Whether to exclude AMIs that are copies of other AMIs from scanning.

      • excludeBackupDlmAmis (boolean) –

        Whether to exclude AMIs created by Amazon Data Lifecycle Manager (DLM) backups from scanning.

  • updateConfigurationInheritance (dict) –

    Specifies which scan-type configurations to reset to the delegated administrator’s inherited values for the targeted member account. Each member of this structure is independently optional. When specified, ec2Configuration and ecrConfiguration must be absent, and accountId must also be present. Only INHERIT_FROM_ADMIN is valid for each member. If not specified, the operation uses the ec2Configuration and ecrConfiguration parameters instead.

    • ec2Configuration (string) –

      The inheritance mode for Amazon EC2 scan configuration. Set to INHERIT_FROM_ADMIN to reset the member account’s Amazon EC2 scan configuration to inherit from the delegated administrator. If omitted, the member account’s existing Amazon EC2 scan configuration is not changed.

    • ecrConfiguration (string) –

      The inheritance mode for Amazon ECR scan configuration. Set to INHERIT_FROM_ADMIN to reset the member account’s Amazon ECR scan configuration to inherit from the delegated administrator. If omitted, the member account’s existing Amazon ECR scan configuration is not changed.

    • amiConfiguration (string) –

      The inheritance behavior for a scan-type configuration. Used with UpdateConfigurationInheritance to reset a member account’s configuration to inherit from the delegated administrator. The only valid value is INHERIT_FROM_ADMIN, which resets the member account’s configuration so that it inherits scan settings from the delegated administrator.

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

Exceptions