Class Audit


  • public class Audit
    extends AuditModule
    Audit support class.

    This class provides convenience methods for producing audit output. Audit output is logged using the standard iAS logger SECURITYLOGGER. However, audit output is only produced if auditing is active. Auditing is configured in server.xml in the security-service element.

    Audit output if logged with Level.WARNING.

    Some diagnostic methods are also provided for debugging.

    • Constructor Detail

      • Audit

        public Audit()
    • Method Detail

      • isActive

        public static boolean isActive()
        Check auditing state.
      • init

        public void init​(Properties props)
        Description copied from class: BaseAuditModule
        Method is invoked at server startup, during AuditModule initialization. If method returns without any exception then Payara assumes that the module is ready to serve any requests.
        Overrides:
        init in class BaseAuditModule
        Parameters:
        props - the properties for the AuditModule. These properties are defined in the domain.xml
      • authentication

        public void authentication​(String user,
                                   String realm,
                                   boolean success)
        Invoked post authentication request for a user in a given realm
        Overrides:
        authentication in class BaseAuditModule
        Parameters:
        user - username for whom the authentication request was made
        realm - the realm name under which the user is authenticated.
        success - the status of the authentication
      • webInvocation

        public void webInvocation​(String user,
                                  jakarta.servlet.http.HttpServletRequest req,
                                  String type,
                                  boolean success)
        Invoked post web authorization request.
        Overrides:
        webInvocation in class AuditModule
        Parameters:
        user - the username for whom the authorization was performed
        req - the HttpRequest object for the web request
        type - either hasResourcePermission, hasUserDataPermission or hasRoleRefPermission
        success - the status of the web authorization request
      • ejbInvocation

        public void ejbInvocation​(String user,
                                  String ejb,
                                  String method,
                                  boolean success)
        Invoked post ejb authorization request.
        Overrides:
        ejbInvocation in class AuditModule
        Parameters:
        user - the username for whom the authorization was performed
        ejb - the ejb name for which this authorization was performed
        method - the method name for which this authorization was performed
        success - the status of the ejb authorization request
      • webServiceInvocation

        public void webServiceInvocation​(String uri,
                                         String endpoint,
                                         boolean success)
        Invoked during validation of the web service request
        Overrides:
        webServiceInvocation in class AuditModule
        Parameters:
        uri - The URL representation of the web service endpoint
        endpoint - The name of the endpoint representation
        success - the status of the web service request validation
      • ejbAsWebServiceInvocation

        public void ejbAsWebServiceInvocation​(String endpoint,
                                              boolean success)
        Invoked during validation of the web service request
        Overrides:
        ejbAsWebServiceInvocation in class AuditModule
        Parameters:
        endpoint - The URL representation of the web service endpoint
        success - the status of the web service request validation
      • serverStarted

        public void serverStarted()
        Invoked upon completion of the server startup
        Overrides:
        serverStarted in class BaseAuditModule
      • serverShutdown

        public void serverShutdown()
        Invoked upon completion of the server shutdown
        Overrides:
        serverShutdown in class BaseAuditModule
      • showACL

        public static void showACL​(Application app)
        Diagnostic method. Read roles and ACLs from the given Application and dump a somewhat organized summary of what has been set. This can be used to diagnose deployment or runtime deployment errors as well as to help in configuring application descriptors.

        Implementation is not particularly efficient but this is only called for debugging purposes at startup. All errors are ignored.

        Parameters:
        app - Application object to analyze.