AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

監査ログの構成

注意

  • この機能は、M0 クラスターと Flex クラスターでは使用できません。

You can use Atlas Kubernetes Operator to configure audit logs. To learn more, see Set Up Database Auditing.

データベース監査により、管理者は複数のユーザーによる配置のシステム アクティビティを追跡できます。 Atlas 管理者は、監査するアクション、データベースユーザー、Atlas ロール、および LDAP グループを選択できます。 Atlas は次の制限付きで、文書化された システム イベント アクション のほとんどの 監査 をサポートしています。

  • When an Atlas user performs an action in the Atlas UI on a cluster, both the audit logs and mongodb.log file log the mms-automation database user as the user performing the auditable action. However, the Project Activity Feed logs the actual username of the Atlas user responsible for the action.

  • Atlas はこれらの操作を admin データベースで直接実行するので、Atlas 監査ログではユーザーの作成または変更イベントは追跡されません。

重要

完全なデータベース監査の実行

これらの制限があるため、完全な監査を実行するには、監査ログ、 mongodb.log 、およびプロジェクト アクティビティ フィードを組み合わせて使用する必要があります。

authCheck イベント アクションは、プロジェクト内のクラスター内のデータベースに対して読み取りや書込みを試行するユーザーによる承認試行を記録します。Atlas では、次の特定のコマンドが監査されます。

[1](1, 2, 3) MongoDB versions 4.2 and later don't support these commands.

Atlas は、authCheck イベント アクションを次の 4 つの個別のアクションとして実装します。

イベント アクション
説明

authChecksReadFailures

authCheck event action for all failed reads with the auditAuthorizationSuccess parameter set to false. This event action is the default for read-related event actions.

authChecksReadAll

authCheck 成功と失敗の両方を含むすべての読み取りに対するイベント アクション。このイベント アクションは authChecksReadFailures と同じですが、auditAuthorizationSuccess パラメーターが true に設定されています。

警告: auditAuthorizationSuccessを有効にすると、クラスターのパフォーマンスに重大な影響を与える可能性があります。 このオプションを有効にする場合は注意が必要です。

authChecksWriteFailures

authCheck event action for all failed writes with the auditAuthorizationSuccess parameter set to false. This event action is the default for write-related event actions.

authChecksWriteAll

authCheck 成功と失敗の両方を含むすべての書き込み (write) に対するイベント アクション。このイベント アクションは authChecksWriteFailures と同じですが、auditAuthorizationSuccess パラメーターが true に設定されています。

警告: auditAuthorizationSuccessを有効にすると、クラスターのパフォーマンスに重大な影響を与える可能性があります。 このオプションを有効にする場合は注意が必要です。

To learn about how MongoDB writes audit events to disk, see Audit Guarantee in the MongoDB Manual.

To configure audit logs, you must have Project Owner access to the project that you want to update or Organization Owner access to the organization that contains the project that you want to update.

注意

一時データベースユーザーの**アクション**を**監査する**ための**ベストプラクティス**については、一時**データベースユーザー**の**監査**を**学ぶ**を参照してください。

監査するログを有効にするには、trueAtlasProject カスタム リソース で spec.auditing.enabled を に設定します。

例:

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: TestAuditing
connectionSecretRef:
name: my-atlas-key
projectIpAccessList:
- cidrBlock: "0.0.0.0/1"
comment: "Everyone has access. For test purposes only."
- cidrBlock: "128.0.0.0/1"
comment: "Everyone has access. For test purposes only."
auditing:
enabled: true
EOF

To retrieve the audit logs in Atlas, see MongoDB Logs. To retrieve the audit logs using the API, see Logs.

注意

  • この機能は、M0 クラスターと Flex クラスターでは使用できません。

Atlas は、MongoDB Auditing をカスタマイズする JSON 形式の監査フィルターの指定をサポートしています。

Custom audit filters lets users forgo the managed Atlas UI auditing filter builder in favor of hand-tailored granular control of event auditing. Atlas checks only that the custom filter uses valid JSON syntax, and doesn't validate or test the filter's functionality.

監査フィルター ドキュメントは、監査イベント メッセージ内の 1 つ以上のフィールドに一致するクエリに解決される必要があります。フィルター ドキュメントでは、必要な監査メッセージを一致させるために、クエリ演算子と等価条件の組み合わせを使用できます。

To view example auditing filters, see Example Auditing Filters. To learn more about configuring MongoDB auditing filters, see Configure Audit Filter.

重要

Atlas uses a rolling update strategy for enabling or updating audit configuration settings across all clusters in the Atlas project. Rolling updates require at least one election per replica set.

To learn more about testing application resilience to replica set elections, see /tutorial/test-resilience/test-primary-failover. To learn more about how Atlas provides high availability, see Atlas High Availability.

カスタム監査フィルタを構成するには、 カスタム リソースでspec.auditing.auditFilter 設定を指定します。AtlasProjectこの設定の値を指定するには、spec.auditing.enabled を true に設定する必要があります。

例:

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: TestAuditing
connectionSecretRef:
name: my-atlas-key
projectIpAccessList:
- cidrBlock: "0.0.0.0/1"
comment: "Everyone has access. For test purposes only."
- cidrBlock: "128.0.0.0/1"
comment: "Everyone has access. For test purposes only."
auditing:
enabled: true
auditFilter: "{"atype": "authenticate"}"
EOF

To learn more about the configuration parameters available from the API, see the Atlas Auditing.