Interface FileAuditListener

All Superinterfaces:
EventListener
All Known Subinterfaces:
AgentAuditPolicy
All Known Implementing Classes:
DefaultAgentAuditPolicy

public interface FileAuditListener extends EventListener
The FileAuditListener interface is implemented by objects that want to monitor and optionally prevent file system access (read, write, create and delete) within the SNMP4J-Agent. Implementations are notified before a file is read, written, created or deleted through the single fileAudit(FileAuditEvent) method.

The fileAudit(FileAuditEvent) method acts both as an authorization hook and as an audit hook: returning false denies (prevents) the corresponding file access, while returning true allows it. Implementations may additionally write the audited FileAuditEvent to a dedicated audit log.

This interface is the file system equivalent of the TransportAuditListener used for transport level auditing.

Since:
3.12.0
Version:
3.12.0
Author:
Frank Fock
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Audits a file system operation described by the provided FileAuditEvent and decides whether the operation is permitted.
  • Method Details

    • fileAudit

      boolean fileAudit(FileAuditEvent event)
      Audits a file system operation described by the provided FileAuditEvent and decides whether the operation is permitted.
      Parameters:
      event - the FileAuditEvent describing the file operation to be audited.
      Returns:
      true if the operation is permitted, false to deny (prevent) it. The return value is ignored for FileAuditEvent.FileOperation.DELETE events that report an already executed deletion.