Amazon Neptune DB クラスターでの監査ログの有効化方法について教えてください

2023.04.24

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

困っていた内容

Amazon Neptune DB クラスターで監査ログを有効化するための方法を教えてください。

どう対応すればいいの?

Amazon Neptune DB クラスターにて監査ログを有効化するためには下記の設定を行う必要があります。

  1. 「ログのエクスポート - Amazon CloudWatch Logs に発行するログタイプを選択します」→「監査ログ」 を選択
  2. 「DB クラスターのパラメータグループ」→「neptune_enable_audit_log」の値を 0 から 1 に変更
  3. 「DB クラスターのパラメータグループ」を 2. で設定したものに変更
  4. 「neptune_enable_audit_log」パラメータの適用タイプが static(静的) のため、Neptune DB インスタンスを再起動する

なお、デフォルトの DB クラスターパラメータグループは変更できないため、デフォルトの DB クラスターパラメータグループしかない場合は、 「パラメーターグループの作成」より、新しいクラスターのパラメーターグループを作成してから、上記項番 2. ~ 3. の手順を実施ください。

Important

This step is required if you only have the default DB cluster parameter group because the default DB cluster parameter group can't be modified.

Amazon Neptune parameter groups - Amazon Neptune

具体的な手順や内容の詳細については参考資料の AWS 公式ドキュメントをご参照ください。

参考資料

  • Amazon Neptune parameters - Amazon Neptune

    neptune_enable_audit_log (cluster-level parameter)

    This parameter toggles audit logging for Neptune.

    Allowed values are 0 (disabled) and 1 (enabled). The default value is 0.

    This parameter is static, meaning that changes to it do not take effect on any instance until it has been rebooted.

    You can publish audit logs to Amazon CloudWatch, as described in Using the CLI to publish Neptune audit logs to CloudWatch Logs.

  • Amazon Neptune parameter groups - Amazon Neptune

    Static parameters

    A static parameter is one that takes effect only after a DB instance is rebooted. In other words, when you change a static parameter and save the instance DB parameter group, you must manually reboot the DB instance for the parameter change to take effect. Currently, all the Neptune instance-level parameters (in a DB parameter group rather than a DB cluster parameter group) are static.

    When you change a cluster-level static parameter and save the DB cluster parameter group, the parameter change takes effect after you manually reboot every DB instance in the cluster.

  • Rebooting a DB instance in Amazon Neptune - Amazon Neptune

    In some cases, if you modify an Amazon Neptune DB instance, change the DB parameter group that is associated with the instance, or change a static DB parameter in a parameter group that the instance uses, you must reboot the instance to apply the changes.

    Rebooting a DB instance restarts the database engine service. A reboot also applies to the DB instance any changes to the associated DB parameter group that were pending. Rebooting a DB instance results in a momentary outage of the instance, during which the DB instance status is set to rebooting. If the Neptune instance is configured for Multi-AZ, the reboot might be conducted through a failover. A Neptune event is created when the reboot is completed.

  • Using Audit Logs with Amazon Neptune Clusters - Amazon Neptune

    Enabling Neptune Audit Logs

    Use the neptune_enable_audit_log parameter to enable (1) or disable (0) audit logs.

    Set this parameter in the parameter group that is used by your DB cluster. You can use the procedure shown in Editing a DB Cluster Parameter Group or DB Parameter Group to modify the parameter using the AWS Management Console, or use the modify-db-cluster-parameter-group AWS CLI command or the ModifyDBClusterParameterGroup API command to modify the parameter programatically.

    You must restart your DB cluster after modifying this parameter in order to apply the change.

  • Amazon Neptune parameter groups - Amazon Neptune

    Important

    This step is required if you only have the default DB cluster parameter group because the default DB cluster parameter group can't be modified.