Removing a Group From a SharePoint Online Site Leaves Its Files Open Through an Amazon Bedrock Knowledge Base
Overview
SharePoint says the group is gone. The Bedrock knowledge base disagrees, because it never held SharePoint permissions and answers anyone with bedrock:Retrieve.
At a glance
- Symptom
- A SharePoint Online site owner removes a group from the HR site, and those people can no longer open its files in SharePoint.
- Likely cause
- A customer-managed knowledge base keeps no SharePoint permissions, so access to what it holds is decided only in IAM.
- Impact
- The impact is quiet disclosure, not an outage.
- Verification signal
- Success is that the site's documents no longer come back to anyone outside its SharePoint audience.
- Safe correction
- Take the site out of the shared knowledge base before you build anything new, so access only ever narrows.
- Rollback or recovery
- Every step here is reversible except deleting a data source, which this order never does.
Symptom
A SharePoint Online site owner removes a group from the HR site, and those people can no longer open its files in SharePoint. But the internal assistant built on an Amazon Bedrock knowledge base still answers their questions from those files, and its citations point at the HR site. The SharePoint change worked; it never reached the knowledge base. AWS documents that all data synced from a data source becomes available to anyone with bedrock:Retrieve permission on the knowledge base, including data that has controlled permissions in the source. Take the site out of the shared knowledge base, or move it to a Bedrock Managed Knowledge Base with document-level access control turned on. Then limit bedrock:Retrieve on each knowledge base to the application role that authenticates users. Don’t delete the SharePoint data source to purge the content.
This applies to a customer-managed knowledge base with a SharePoint data source ("type": "SHAREPOINT" with a sharePointConfiguration). AWS still marks that connector as a preview release.
Why removing the group looks safe
In SharePoint, removing a group from a site is the normal way to revoke access to it. The knowledge base also syncs incrementally and picks up added, modified and deleted documents, so it is easy to assume it follows SharePoint permissions too. It doesn’t. The connector signs in to SharePoint as an Entra ID application, not as each user. For a customer-managed knowledge base, AWS’s setup asks for the Microsoft Graph application permission Sites.Read.All, which lets the application enumerate and read all SharePoint sites. The files never stopped being readable to the connector.
Root cause
A customer-managed knowledge base keeps no SharePoint permissions, so access to what it holds is decided only in IAM. The data source configuration holds a tenant ID, the domain, a list of siteUrls, the auth type and a Secrets Manager secret with the app’s clientId and clientSecret. Nothing in it describes who may read which file. At query time, the identity check that matters is the AWS one. The Retrieve action is authorised against the knowledge-base resource, arn:${Partition}:bedrock:${Region}:${Account}:knowledge-base/${KnowledgeBaseId}. An assistant usually calls it with one application role on behalf of everybody, so everyone who can use the assistant can reach every synced site.
Who manages the data source matters too. AWS notes that CreateDataSource, UpdateDataSource and StartIngestionJob don’t pass a role, so ingestion runs with the role already bound to the knowledge base. Anyone who can edit the data source and start a sync can add any site the Entra app can read; with bedrock:Retrieve as well, they can query it.
Impact
The impact is quiet disclosure, not an outage. Users who lost access in SharePoint can still get answers drawn from the site’s documents, and so can anyone who never had it, as long as they can reach the assistant or hold bedrock:Retrieve. Nothing in SharePoint shows it: access reviews and the site’s membership all look correct, and the leak only shows up in a citation.
Two fixes that make it worse
The first is a rule in the application: a metadata filter or a prompt instruction that keeps HR content out of answers. A filter is optional on every Retrieve call, so it only protects the code path that sets it. Any other caller with bedrock:Retrieve gets the full content.
The second is deleting the SharePoint data source with a DELETE data deletion policy, which removes all of that data source’s vector embeddings. It does remove the content, but it removes every other site in that data source too. Since 30 September 2026, AWS no longer supports creating new SharePoint connectors on customer-managed knowledge bases. Existing ones keep working. So you can’t simply recreate the one you deleted.
How to confirm it, read-only
Save the data source configuration; it is also your backup.
aws bedrock-agent list-data-sources --knowledge-base-id KB12345678
aws bedrock-agent get-data-source --knowledge-base-id KB12345678 --data-source-id DS12345678 > ds-before.json
In ds-before.json, look at dataSource.dataSourceConfiguration.sharePointConfiguration.sourceConfiguration.siteUrls. The restricted site’s URL is there.
Then ask the knowledge base something only the restricted site answers, using the same role the assistant uses:
aws bedrock-agent-runtime retrieve --knowledge-base-id KB12345678 --retrieval-query text="parental leave policy" --query "retrievalResults[].location.sharePointLocation.url"
URLs from the HR site in the output confirm the trap. Finally, list who can query it.:
aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:role/assistant-app --action-names bedrock:Retrieve --resource-arns arn:aws:bedrock:eu-west-2:111122223333:knowledge-base/KB12345678
An EvalDecision of allowed means that principal’s IAM policies let it read everything the knowledge base holds. The simulator only checks authorization and doesn’t call the API.
Correction
Take the site out of the shared knowledge base before you build anything new, so access only ever narrows.
- Decide where the content belongs. If the shared assistant should never answer from the site, take it out of that data source. If a smaller audience still needs answers from it, plan a separate Bedrock Managed Knowledge Base data source for it first.
- Remove the site from the shared data source. Precondition:
ds-before.jsonis saved and you holdbedrock:UpdateDataSource. Copy itsdataSourceConfigurationintods-new.jsonand delete only the restricted site fromsiteUrls. Copy itsvectorIngestionConfigurationintovic-before.jsonand pass it back unchanged, because AWS says you can’t change the chunking configuration after creation and must specify the existing one. Ifds-before.jsonshows adataDeletionPolicyorserverSideEncryptionConfiguration, pass those back too with--data-deletion-policyand--server-side-encryption-configuration.aws bedrock-agent update-data-source --knowledge-base-id KB12345678 --data-source-id DS12345678 --name "SharePoint Online connector" --data-source-configuration file://ds-new.json --vector-ingestion-configuration file://vic-before.jsonRollback: run the same command with the configuration from
ds-before.json. - Sync and watch the job.
aws bedrock-agent start-ingestion-job --knowledge-base-id KB12345678 --data-source-id DS12345678, thenget-ingestion-jobwith the returned ID untilstatusisCOMPLETE. ChecknumberOfDocumentsDeletedin its statistics. AWS doesn’t document whether dropping a site URL removes documents already indexed from it, so the next check decides. - Re-run the read-only
retrievetest. If HR URLs still come back, stop. Don’t delete the data source. Restrictbedrock:Retrieveon that knowledge base to the people allowed to see the site, and raise it with AWS Support. - Build the restricted replacement, if one is needed. In a Bedrock Managed Knowledge Base, create a SharePoint data source with
aclEnabledset totrueand theENTRA_ID_APP_ONLYauth type. Grant the Entra appSites.Selectedwith the fullcontrol role on that site only, plusUser.Read.AllandGroupMember.Read.Allon Microsoft Graph. This auth type uses a certificate, which the connector reads from Amazon S3 as a PKCS#12 file. ACL configuration is permanent: you can’t add it to a data source later or turn it off. This only adds a new resource, so until the application points at it, there is nothing to roll back. - Close IAM to the application only. ACL-aware retrieval filters on the user you pass in
--user-context, and AWS says it is not authorization: it can’t verify that identity. Grantbedrock:Retrieveon each knowledge base ARN only to the application role that signs users in and passes their verified email. Save each policy before you edit it and keep the old version to roll back. For a related case where one control doesn’t block a path another one grants, see a permissions boundary that doesn’t block KMS decrypt.
Validation
Success is that the site’s documents no longer come back to anyone outside its SharePoint audience. Re-run the retrieve test against the shared knowledge base: no HR site URLs. On the managed knowledge base, run it with --user-context userId= set to the email of someone removed from the site: no results from that site. With a member’s email, results come back. Re-run simulate-principal-policy for every principal you found earlier: only the application role is allowed.
Rollback
Every step here is reversible except deleting a data source, which this order never does. To undo the site removal, run update-data-source with the configuration from ds-before.json and sync again; this brings back the exposure, so do it only to restore service while you agree another fix. Switch the application back to the old knowledge base ID if the managed one misbehaves. Restore any IAM policy from the copy you saved before editing it.
Stop it happening again
Treat a knowledge base as its own access boundary. Before you add a SharePoint site, decide who may read it in AWS, not in SharePoint, and give each audience its own knowledge base or an ACL-enabled managed one. On a managed knowledge base, grant the connector’s Entra app Sites.Selected for named sites instead of tenant-wide read. Treat UpdateDataSource and StartIngestionJob as privileged. Rotate the connector’s client secret on a schedule, as AWS recommends. When a SharePoint site owner revokes access, check whether any knowledge base lists that site. Removing a site member is like resetting a console password while the access keys stay active: it closes one path and leaves another open.
Apply the safer control
Before you change production
Confirm the affected scope, export the current configuration, and test the replacement control in a non-production environment first.
Fix commands and configuration
bedrock:Retrieve"type": "SHAREPOINT"sharePointConfigurationWhen to escalate
Validation and rollback are covered in the sections above.
Escalate
Escalate when the blast radius is uncertain, the control cannot be tested safely, or remediation requires an outage or security exception.
Fixed? Get the next one before it hits you: The KBY Brief
Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.
About this page
Credited to
Dates
Published
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.