Info icon
End of Life Notice: For Trend Cloud One™ - Conformity Customers, Conformity will reach its End of Sale on “July 31st, 2025” and End of Life “July 31st, 2026”. The same capabilities and much more is available in TrendAI Vision One™ Cloud Risk Management. For details, please refer to Upgrade to TrendAI Vision One™

Configure Data Deletion Policy for Knowledge Base Data

TrendAI Vision One™ provides continuous assurance that gives peace of mind for your cloud infrastructure, delivering over 1400 automated best practice checks.

Risk Level: Medium (should be achieved)
Rule ID: Bedrock-016

To comply with industry regulations and preserve data for future analysis, ensure that vector store data is retained when deleting Amazon Bedrock knowledge base data sources.

Security
Operational
excellence

By default, the vector store data will be deleted when the Amazon Bedrock knowledge base data source is deleted. Setting the data deletion policy to "RETAIN" for your Amazon Bedrock knowledge base data sources ensures that your data and any associated metadata are preserved even after the data source is deleted. This can be mandatory for compliance with regulatory requirements, auditing, and historical analysis.


Audit

To check the data deletion policy for your Amazon Bedrock knowledge base data sources, perform the following operations:

Using AWS Console

  1. Sign in to the AWS Management Console.

  2. Navigate to Amazon Bedrock console available at https://console.aws.amazon.com/bedrock/.

  3. In the main navigation panel, under Build, select Knowledge bases.

  4. Select the Knowledge bases tab to list the Amazon Bedrock knowledge bases available in the current AWS region.

  5. Click on the name (link) of the knowledge base that you want to examine, available in the Name column.

  6. In the Data source section, click on the name (link) of the knowledge base data source that you want to examine, available in the Data source name column.

  7. In the Data source overview section, check the Data deletion policy attribute value to determine the deletion policy configured for the selected data source. If the Data deletion policy attribute value is set to DELETE, the vector store data is not retained after the selected Amazon Bedrock knowledge base data source is deleted.

  8. Repeat steps no. 6 and 7 for each data source configured for the selected knowledge base.

  9. Repeat steps no. 5 - 8 for each Amazon Bedrock knowledge base available within the current AWS region.

  10. Change the AWS cloud region from the navigation bar to repeat the Audit process for other regions.

Using AWS CLI

  1. Run list-knowledge-bases command (OSX/Linux/UNIX) to list the identifier (ID) of each Amazon Bedrock knowledge base available in the selected AWS cloud region:

    aws bedrock-agent list-knowledge-bases
    --region us-east-1
    --query 'knowledgeBaseSummaries[*].knowledgeBaseId'
    
  2. The command output should return the requested knowledge base identifiers (IDs):

    [
        "ABCDACBDAB"
    ]
    
  3. Run list-data-sources command (OSX/Linux/UNIX) using the ID of the knowledge base that you want to examine as the identifier parameter to list the identifier (ID) of each data source configured for the selected knowledge base:

    aws bedrock-agent list-data-sources
    --region us-east-1
    --knowledge-base-id ABCDACBDAB
    --query 'dataSourceSummaries[*].dataSourceId'
    
  4. The command output should return the requested data source identifiers (IDs). Note that list-data-sources does not return the data deletion policy value — this can only be retrieved through the get-data-source command below:

    [
        "MNOP9012QR"
    ]
    
  5. Run get-data-source command (OSX/Linux/UNIX) using the IDs of the knowledge base and the data source that you want to examine as identifier parameters and output query filters to describe the data deletion policy configured for the selected data source:

    aws bedrock-agent get-data-source
    --region us-east-1
    --knowledge-base-id ABCDACBDAB
    --data-source-id MNOP9012QR
    --query 'dataSource.dataDeletionPolicy'
    
  6. The command output should return the configured data deletion policy value:

    "DELETE"
    

    If the get-data-source command output returns "DELETE", the vector store data is not retained after the selected Amazon Bedrock knowledge base data source is deleted, therefore the data deletion policy configuration is not compliant.

  7. Repeat steps no. 3 - 6 for each Amazon Bedrock knowledge base available in the selected AWS region.

  8. Change the AWS cloud region by updating the --region command parameter value and repeat steps no. 1 - 7 to perform the Audit process for other regions.

Remediation / Resolution

To ensure that the vector store data is retained when your Amazon Bedrock knowledge base data sources are deleted, perform the following operations:

Using AWS Console

  1. Sign in to the AWS Management Console.

  2. Navigate to Amazon Bedrock console available at https://console.aws.amazon.com/bedrock/.

  3. In the main navigation panel, under Build, select Knowledge bases.

  4. Select the Knowledge bases tab to list the Amazon Bedrock knowledge bases available in the current AWS cloud region.

  5. Click on the name (link) of the knowledge base that you want to access, available in the Name column.

  6. In the Data source section, select the knowledge base data source that you want to configure, and choose Edit to change the data source deletion policy.

  7. Choose Advanced settings - optional, and select Retain from the Data deletion policy dropdown list, to set the data deletion policy to "RETAIN" for the selected Amazon Bedrock knowledge base data source.

  8. Choose Submit to apply the configuration changes.

  9. Repeat steps no. 6 - 8 for each data source configured for the selected knowledge base.

  10. Repeat steps no. 5 - 9 for each Amazon Bedrock knowledge base available in the selected AWS region.

  11. Change the AWS cloud region from the navigation bar to repeat the Remediation process for other regions.

Using AWS CLI

  1. Run get-data-source command (OSX/Linux/UNIX) to retrieve the current configuration of the data source that you want to reconfigure (see Audit section part II to identify the right resource):

    aws bedrock-agent get-data-source
    --region us-east-1
    --knowledge-base-id ABCDACBDAB
    --data-source-id MNOP9012QR
    --query 'dataSource.[name,dataSourceConfiguration]'
    
  2. The command output should return the data source name and configuration required for the update command:

    [
        "cc-bedrock-kb-datasource",
        {
            "type": "S3",
            "s3Configuration": {
                "bucketArn": "arn:aws:s3:::cc-bedrock-kb-data"
            }
        }
    ]
    
  3. Run update-data-source command (OSX/Linux/UNIX) using the knowledge base ID, data source ID, name, and data source configuration retrieved at the previous step to update the data deletion policy to "RETAIN". Note: The update-data-source command overwrites all fields, so you must pass the existing values for --name and --data-source-configuration alongside the changed --data-deletion-policy to avoid accidentally clearing those fields:

    aws bedrock-agent update-data-source
    --region us-east-1
    --knowledge-base-id ABCDACBDAB
    --data-source-id MNOP9012QR
    --name cc-bedrock-kb-datasource
    --data-source-configuration '{"type":"S3","s3Configuration":{"bucketArn":"arn:aws:s3:::cc-bedrock-kb-data"}}'
    --data-deletion-policy RETAIN
    
  4. The command output should return the updated data source configuration confirming the new data deletion policy value:

    {
        "dataSource": {
            "knowledgeBaseId": "ABCDACBDAB",
            "dataSourceId": "MNOP9012QR",
            "name": "cc-bedrock-kb-datasource",
            "dataSourceConfiguration": {
                "type": "S3",
                "s3Configuration": {
                    "bucketArn": "arn:aws:s3:::cc-bedrock-kb-data"
                }
            },
            "dataDeletionPolicy": "RETAIN"
        }
    }
    
  5. Repeat steps no. 1 - 4 for each Amazon Bedrock knowledge base data source that you want to configure, available in the selected AWS region.

  6. Change the AWS cloud region by updating the --region command parameter value and repeat steps no. 1 - 5 to perform the Remediation process for other regions.

References

Publication date Jun 13, 2024