Class LoggingAuditTrail

java.lang.Object
org.elasticsearch.xpack.security.audit.logfile.LoggingAuditTrail
All Implemented Interfaces:
org.elasticsearch.cluster.ClusterStateListener, AuditTrail

public class LoggingAuditTrail extends Object implements AuditTrail, org.elasticsearch.cluster.ClusterStateListener
  • Field Details

  • Constructor Details

    • LoggingAuditTrail

      public LoggingAuditTrail(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.cluster.service.ClusterService clusterService, org.elasticsearch.threadpool.ThreadPool threadPool)
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface AuditTrail
    • authenticationSuccess

      public void authenticationSuccess(String requestId, org.elasticsearch.xpack.core.security.authc.Authentication authentication, org.elasticsearch.rest.RestRequest request)
      Specified by:
      authenticationSuccess in interface AuditTrail
    • authenticationSuccess

      public void authenticationSuccess(String requestId, org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest transportRequest)
      Specified by:
      authenticationSuccess in interface AuditTrail
    • anonymousAccessDenied

      public void anonymousAccessDenied(String requestId, String action, org.elasticsearch.transport.TransportRequest transportRequest)
      Specified by:
      anonymousAccessDenied in interface AuditTrail
    • anonymousAccessDenied

      public void anonymousAccessDenied(String requestId, org.elasticsearch.rest.RestRequest request)
      Specified by:
      anonymousAccessDenied in interface AuditTrail
    • authenticationFailed

      public void authenticationFailed(String requestId, org.elasticsearch.xpack.core.security.authc.AuthenticationToken token, String action, org.elasticsearch.transport.TransportRequest transportRequest)
      Specified by:
      authenticationFailed in interface AuditTrail
    • authenticationFailed

      public void authenticationFailed(String requestId, org.elasticsearch.rest.RestRequest request)
      Specified by:
      authenticationFailed in interface AuditTrail
    • authenticationFailed

      public void authenticationFailed(String requestId, String action, org.elasticsearch.transport.TransportRequest transportRequest)
      Specified by:
      authenticationFailed in interface AuditTrail
    • authenticationFailed

      public void authenticationFailed(String requestId, org.elasticsearch.xpack.core.security.authc.AuthenticationToken token, org.elasticsearch.rest.RestRequest request)
      Specified by:
      authenticationFailed in interface AuditTrail
    • authenticationFailed

      public void authenticationFailed(String requestId, String realm, org.elasticsearch.xpack.core.security.authc.AuthenticationToken token, String action, org.elasticsearch.transport.TransportRequest transportRequest)
      Specified by:
      authenticationFailed in interface AuditTrail
    • authenticationFailed

      public void authenticationFailed(String requestId, String realm, org.elasticsearch.xpack.core.security.authc.AuthenticationToken token, org.elasticsearch.rest.RestRequest request)
      Specified by:
      authenticationFailed in interface AuditTrail
    • accessGranted

      public void accessGranted(String requestId, org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest msg, org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.AuthorizationInfo authorizationInfo)
      Specified by:
      accessGranted in interface AuditTrail
    • explicitIndexAccessEvent

      public void explicitIndexAccessEvent(String requestId, AuditLevel eventType, org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, String index, String requestName, InetSocketAddress remoteAddress, org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.AuthorizationInfo authorizationInfo)
      Description copied from interface: AuditTrail
      This is a "workaround" method to log index "access_granted" and "access_denied" events for actions not tied to a TransportMessage, or when the connection is not 1:1, i.e. several audit events for an action associated with the same message. It is currently only used to audit the resolved index (alias) name for each BulkItemRequest comprised by a BulkShardRequest. We should strive to not use this and TODO refactor it out!
      Specified by:
      explicitIndexAccessEvent in interface AuditTrail
    • accessDenied

      public void accessDenied(String requestId, org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest transportRequest, org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.AuthorizationInfo authorizationInfo)
      Specified by:
      accessDenied in interface AuditTrail
    • tamperedRequest

      public void tamperedRequest(String requestId, org.elasticsearch.rest.RestRequest request)
      Specified by:
      tamperedRequest in interface AuditTrail
    • tamperedRequest

      public void tamperedRequest(String requestId, String action, org.elasticsearch.transport.TransportRequest transportRequest)
      Specified by:
      tamperedRequest in interface AuditTrail
    • tamperedRequest

      public void tamperedRequest(String requestId, org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest transportRequest)
      Specified by:
      tamperedRequest in interface AuditTrail
    • connectionGranted

      public void connectionGranted(InetAddress inetAddress, String profile, SecurityIpFilterRule rule)
      Description copied from interface: AuditTrail
      The AuditTrail.connectionGranted(InetAddress, String, SecurityIpFilterRule) and AuditTrail.connectionDenied(InetAddress, String, SecurityIpFilterRule) methods do not have a requestId because they related to a potentially long-lived TCP connection, not a single request. For both Transport and Rest connections, a single connection granted/denied event is generated even if that connection is used for multiple Elasticsearch actions (potentially as different users)
      Specified by:
      connectionGranted in interface AuditTrail
    • connectionDenied

      public void connectionDenied(InetAddress inetAddress, String profile, SecurityIpFilterRule rule)
      Specified by:
      connectionDenied in interface AuditTrail
    • runAsGranted

      public void runAsGranted(String requestId, org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest transportRequest, org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.AuthorizationInfo authorizationInfo)
      Specified by:
      runAsGranted in interface AuditTrail
    • runAsDenied

      public void runAsDenied(String requestId, org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest transportRequest, org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.AuthorizationInfo authorizationInfo)
      Specified by:
      runAsDenied in interface AuditTrail
    • runAsDenied

      public void runAsDenied(String requestId, org.elasticsearch.xpack.core.security.authc.Authentication authentication, org.elasticsearch.rest.RestRequest request, org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.AuthorizationInfo authorizationInfo)
      Specified by:
      runAsDenied in interface AuditTrail
    • coordinatingActionResponse

      public void coordinatingActionResponse(String requestId, org.elasticsearch.xpack.core.security.authc.Authentication authentication, String action, org.elasticsearch.transport.TransportRequest transportRequest, org.elasticsearch.transport.TransportResponse transportResponse)
      Specified by:
      coordinatingActionResponse in interface AuditTrail
    • registerSettings

      public static void registerSettings(List<org.elasticsearch.common.settings.Setting<?>> settings)
    • clusterChanged

      public void clusterChanged(org.elasticsearch.cluster.ClusterChangedEvent event)
      Specified by:
      clusterChanged in interface org.elasticsearch.cluster.ClusterStateListener