Right to erasure in Bitbucket Server and Data Center

GRPR の第 17 条において、個人には個人データの削除権が保証されています。これは、"忘れられる権利" としても知られます。この権利は絶対的なものではなく、特定の状況でのみ適用されます。個人データの削除の削除について、個人の要求に対応するために必要となる妥当な対応の範囲は場合によって異なるため、弁護士に相談することをおすすめします。個人データの削除義務があると判断された場合は、特定のアトラシアン製品内でこれを実行するための方法について、以降の手順をご確認ください。  

製品に保存される個人データは、1) アカウントレベルの個人データと 2) フリーフォーム テキスト形式の個人データに区別されます。アカウントレベルの個人データとは、製品内に存在し、製品で各ユーザーを区別するためにのみ使用されるデータ フィールドです。アカウントレベルの個人データの例には、ユーザーの表示名、プロファイル画像またはアバター、メール アドレスが含まれます。これらのデータ要素は通常ユーザーのプロファイル内で確認でき、スペースやコンテンツ内でユーザーが @メンションやタグ付けされた場合にプロフィールを参照できるようにするため、製品全体で使用されます。構造化された個人データ要素を削除すると、製品内で関連する構造化データ要素が表示される箇所やデータベース (後述の制限事項を参照) からデータ要素が取り除かれます。 

フリーフォームのテキスト形式で個人データを追加していた場合 (コンテンツのスペースへの入力やカスタム フィールドのラベル名など)、製品のグローバル検索機能を使ってこのような個人データを検出し、個別に削除する必要があります。

説明

In Bitbucket Server and Data Center 5.16 and later, administrators can anonymize a deleted user account to remove that user's personal data. See Users and groups for more information.


In Bitbucket Server and Data Center 5.15 and earlier, there are workarounds available to help you remove a specific user's personal data from Bitbucket Server. The SQL queries in this guide are written for PostgreSQL, but can be easily adapted to your system's database.

回避策にはデータベースでの SQL の直接実行が含まれるため、本番環境データベースでスクリプトを実行する前に、本番環境以外のステージング環境またはテスト環境でこれを実行しておくことを強くおすすめします。また、SQL スクリプトで変更を加える前にデータのバックアップを作成しておくことを強くおすすめします。

バージョンの互換性

All below workarounds are compatible with Bitbucket Server and Data Center 4.0 to 5.15.

回避策

Deleting a user and removing their personal data

This workaround applies to Bitbucket Server and Data Center 4.0 to 5.15. 

Step 1 - Delete the user

A deleted user is no longer able to login or make changes, but their data (SSH keys, GPG keys, access tokens, etc) is preserved for 7 days. After 7 days, the data will be deleted automatically.

This step must be completed to ensure the following steps can be performed successfully. If you don't complete this step first, and have attempted to perform the following steps, which subsequently fail, you will need to restore your system from your backup, and start the full process again.

To delete a user, use one of the following methods, depending on whether your Bitbucket Server instance is using an internal or external user directory.

Internal User DirectoryDelete the user from within  Bitbucket Server User Management Settings.
External User Directory
  1. Delete the user or replace the user's email address and display name in the External Directory with a non-identifying data element.
  2. Perform a manual resync of the external directory in Bitbucket Server.

Step 2 - Find the user's ID

Find the user_id of the user being deleted, and keep it handy for use in subsequent steps.

__username__ is the login name of the user whose personal data you wish to remove.

SELECT 
   user_id 
FROM 
   sta_normal_user
WHERE
   name='__username__';

Step 3 - Remove the user and their personal project

Change the username and personal project to the user's ID. The queries below must be run in the order given.

__user_id__ is the userid value obtained in step 2
__username__ is the login name of the user whose personal data you wish to remove.

Note the tilde (~) in the second query.

UPDATE 
   sta_normal_user 
SET 
   name='__user_id__',
   slug='__user_id__'
WHERE 
   user_id = __user_id__;

UPDATE 
  project
SET 
   name='~__user_id__',
   project_key='~__user_id__'
WHERE 
   name = '~__username__';

Step 4 - Remove user mentions

Replace user mentions with the new, anonymized username.

__user_id__ is the userid value obtained in step 2
__username__ is the login name of the user whose personal data you wish to remove.

For Bitbucket Server 4.0.0 to 5.3.7, replace user mentions in the sta_comment table.

UPDATE
    sta_comment
SET
    comment_text=REPLACE(comment_text, '@__username__', '@__user_id__')
WHERE
    comment_text like '%@__username__%';

For Bitbucket Server 5.0.0 and above, replace user mentions in the bb_comment table. Please note, in Bitbucket Server 5.0.0 - 5.3.7, user mentions will be in both tables.

UPDATE
    bb_comment
SET
    comment_text=REPLACE(comment_text, '@__username__', '@__user_id__')
WHERE
    comment_text like '%@__username__%';

Replace user mentions in pull request descriptions.

UPDATE
    sta_pull_request
SET
    description=REPLACE(description, '@__username__', '@__user_id__')
WHERE
    description like '%@__username__%';

Step 5 - Delete the user's OAuth tokens

The user's OAuth tokens allow Bitbucket Server to perform actions on behalf of the user in other systems (like Jira or Bamboo).

__username__ is the login name of the user whose personal data you wish to remove.

DELETE FROM 
    plugin_setting
WHERE
    key_name like 'com.atlassian.oauth.serviceprovider.ServiceProviderTokenStore%'
AND key_value like '%__username__%' 

Step 6 - Remove the user's dismissed dialogs

Update records of the user's dismissed dialogs.

__user_id__ is the userid value obtained in step 2
__username__ is the login name of the user whose personal data you wish to remove.

UPDATE
    plugin_setting
SET
    key_name=REPLACE(key_name, '__username__', '__user_id__')
WHERE
    key_name like 'chaperone:%:__username__';

Step 7 - Remove the user's avatar images

If the user uploaded any personal avatar photos, they will be at <Bitbucket home directory>/shared/data/avatars/users/__user_id__(where  __user_id__ is the userid value obtained in step 2).

Delete any files in that directory.

Step 8 - Restart the server

Restart the server to flush all caches and force the UI to update.

制限事項

Data in Git repositories

This limitation applies to all versions of Bitbucket Server and Data Center. 

This guide does not discuss removing a user's personal data from a Git repository. The personal data stored within a Git repository is essential for auditing and providing a chain of license contribution and authorship.

Each Git repository hold the user's display name and email address against every change they made to the repository. Bitbucket Server will display this information and use a hash of the user's email address to look up an avatar photo on the third-party Gravatar site.

If you are considering anonymizing a user's data in a Git repository, you can achieve this by following the Git documentation on filter branch .

Anonymizing data in this way could have a significant impact on development teams, their tools and continuous integration systems. As a result, we strongly recommend against purging the user from Git history.

If you do attempt to rewrite history (using filter branch or another method), old commits will still be retained in two circumstances:

  1. A forked repository will never remove the old commits in case a fork requires them.
  2. If a commit was commented on in a pull request or commit view, the commit will not be removed in order to show the comment in its original context.

Audit, access and application logs

Bitbucket Server logs information for auditing and diagnostic purposes. All these logs may contain the user's username, display name and email address. The access and application logs may also contain the user's IP address.


説明 目的場所
監査ログA list of all audited eventsIdentify authorized and unauthorized changes, or suspicious activity over a period of time (see Audit logging in Bitbucket Server and How to read the Bitbucket Server Log Formats)<Bitbucket home directory>/log/audit/
Audit tableA truncated list of recent audit eventsデータベース
アクセス ログ

A list of who accessed the system and what they accessed

<Bitbucket home directory>/log/atlassian-bitbucket-access.log
<Bitbucket home directory>/log/atlassian-bitbucket-access-YYYY-MM-DD.log
アプリケーション ログ

A list of errors, warnings and diagnostic information

May be required to diagnose problems with Bitbucket Server (see Bitbucket Server debug logging and Configure Bitbucket Server Logging)<Bitbucket home directory>/log/atlassian-bitbucket.log
<Bitbucket home directory>/log/atlassian-bitbucket-YYYY-MM-DD.log

You can safely delete any audit logs, access logs or application logs that you no longer need for auditing/diagnostic purposes.

If you wish to delete the list of recent audit events generated by a user, use the following queries:

__user_id__ below is the userid value obtained in step 2

DELETE FROM
	"AO_BD73C3_PROJECT_AUDIT"
WHERE 
	"USER" = __user_id__;

DELETE FROM
	"AO_BD73C3_REPOSITORY_AUDIT"
WHERE 
	"USER" = __user_id__;

Webhook logging

If you're running Bitbucket Server 5.4.0 or above, Bitbucket Server keeps a record of triggered webhooks in the database, please read  Troubleshooting webhooks. Webhooks sent as the result of a user action will contain that user's username. If you no longer need these entries for auditing purposes, you can delete them.

__username__ below is the login name of the user whose personal data you wish to remove.

DELETE FROM
    "AO_371AEF_HIST_INVOCATION"
WHERE
    "REQUEST_BODY" like '%"name":"__username__"%';

Search data

Search data is essential for Bitbucket's repository and code search features. The user's display name, username and avatar are stored in the search data in order to allow searching their personal project.

When the system is restarted, it will reindex all projects and remove the deleted user's data. If you want to force this process to happen before a restart, follow the steps in Resolve Elasticsearch 404 error by rebuilding the index. 

Browser cache

The user's avatar image is cached aggressively by the browser and such caching is not completely under the control of Bitbucket Server. The browser may periodically refresh/purge its cache, and so the avatars will eventually disappear, but exact timings depends on the browser and user's local configuration.

その他の注意事項

お使いの製品バージョンに応じた制約がある可能性があります

上記に関連する GDPR 回避策は、本製品の最新バージョン用に最適化されていることにご注意ください。製品のレガシー バージョンを実行している場合、回避策の効果は限定的である可能性があります。この記事で案内されている回避策を最適化するには、最新の製品バージョンにアップグレードすることを検討してください。

サードパーティ製アドオンは、独自のデータベース テーブルまたはファイルシステム内に個人データを保存する可能性があります。

GDPR コンプライアンスへの取り組みに関する上記の記事は、アトラシアンのサーバーおよびデータセンター製品内に保存されている個人データのみを対象としています。サーバーまたはデータセンター環境にサードパーティ製アドオンをインストールしている場合、お客様のサーバーまたはデータセンター環境でアクセス、転送、または処理する可能性がある個人データと GDPR コンプライアンスへの取り組みについて、サードパーティのアドオン プロバイダにお問い合わせください。

サーバーまたはデータ センターのお客様の場合、アトラシアンはお客様が製品内で保存するように選択した個人データへのアクセス、保管、または処理は行いません。アトラシアンが処理する個人データの詳細については、プライバシー ポリシーを参照してください。

最終更新日: 2022 年 10 月 4 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.