3.2. Elytron のファイル監査ロギングの有効化


ファイル監査ロギングは、監査ログメッセージをファイルシステムにあるファイル 1 つに保存します。

デフォルトでは、Elytron はファイル監査ロガーとして local-audit を指定します。

local-audit を有効にして、スタンドアロンサーバーでは EAP_HOME/standalone/log/audit.log に、マネージドドメインでは EAP_HOME/domain/log/audit.log に、Elytron 監査ログを書き込めるようにする必要があります。

前提条件

手順

  1. ファイルの監査ログを作成します。

    構文

    /subsystem=elytron/file-audit-log=<audit_log_name>:add(path="<path_to_log_file>",format=<format_type>,synchronized=<whether_to_log_immediately>)

    /subsystem=elytron/file-audit-log=exampleFileAuditLog:add(path="file-audit.log",relative-to=jboss.server.log.dir,format=SIMPLE,synchronized=true)

  2. ファイル監査ログをセキュリティードメインに追加します。

    構文

    /subsystem=elytron/security-domain=<security_domain_name>:write-attribute(name=security-event-listener,value=<audit_log_name>)

    /subsystem=elytron/security-domain=exampleSecurityDomain:write-attribute(name=security-event-listener,value=exampleFileAuditLog)

検証

  1. ブラウザーで、セキュリティー保護されたアプリケーションにログインします。

    たとえば、セキュリティードメインを使用したアプリケーションユーザーの認証と認可 で作成したアプリケーションにログインするには、http://localhost:8080/simple-webapp-example/secured に移動してログインします。

  2. 監査ログを保存するように設定されたディレクトリーに移動します。この手順のコマンド例を使用する場合、ディレクトリーは EAP_HOME/standalone/log です。

    file-audit.log というファイルが作成されることに注意してください。これには、アプリケーションへのログインによってトリガーされたイベントのログが含まれています。

    file-audit.log ファイルの例

    2023-10-24 23:31:04,WARNING,{event=SecurityPermissionCheckSuccessfulEvent,event-time=2023-10-24 23:31:04,security-identity=[name=user1,creation-time=2023-10-24 23:31:04],success=true,permission=[type=org.wildfly.security.auth.permission.LoginPermission,actions=,name=]}
    2023-10-24 23:31:04,WARNING,{event=SecurityAuthenticationSuccessfulEvent,event-time=2023-10-24 23:31:04,security-identity=[name=user1,creation-time=2023-10-24 23:31:04],success=true}

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る