Class EventMetadata

java.lang.Object
com.ironcorelabs.tenantsecurity.logdriver.v1.EventMetadata

public class EventMetadata extends Object
Holds metadata fields as part of a security event. Each event will have metadata that associates it to a tenant ID, which service is accessing the data, it's classification, as well as optional fields for other arbitrary key/value pairs and a request ID to send to the Tenant Security Proxy.
  • Constructor Details

    • EventMetadata

      public EventMetadata(String tenantId, String requestingUserOrServiceId, String dataLabel, Map<String,String> otherData, String requestId, String sourceIp, String objectId, Long timestampMillis) throws IllegalArgumentException
      Constructor for EventMetadata class which contains arbitrary key/value pairs and a unique request ID to send to the Tenant Security Proxy.
      Parameters:
      tenantId - Unique ID of tenant that is performing the operation.
      requestingUserOrServiceId - Unique ID of user/service that triggered the event.
      dataLabel - Classification of the event if more than the event category is needed.
      otherData - Additional String key/value pairs to add to metadata.
      requestId - Unique ID that ties host application request ID to Tenant Security Proxy logs.
      sourceIp - IP address of the initiator of the event.
      objectId - ID of the object being acted on when the event occured.
      timestampMillis - Linux epoch millis of when the event occured. If this isn't passed, now will be assumed.
      Throws:
      IllegalArgumentException - If the provided tenantId is not set
    • EventMetadata

      public EventMetadata(String tenantId, String requestingUserOrServiceId, String dataLabel, Map<String,String> otherData, String requestId)
      Constructor for EventMetadata class which contains arbitrary key/value pairs and a unique request ID to send to the Tenant Security Proxy.
      Parameters:
      tenantId - Unique ID of tenant that is performing the operation.
      requestingUserOrServiceId - Unique ID of user/service that triggered the event.
      dataLabel - Classification of the event if more than the event category is needed.
      otherData - Additional String key/value pairs to add to metadata.
      requestId - Unique ID that ties host application request ID to Tenant Security Proxy logs.
      Throws:
      IllegalArgumentException - If the provided tenantId is not set
    • EventMetadata

      public EventMetadata(String tenantId, String requestingUserOrServiceId, String dataLabel, Map<String,String> otherData) throws IllegalArgumentException
      Constructor for EventMetadata class which contains arbitrary key/value pairs to send to the Tenant Security Proxy.
      Parameters:
      tenantId - Unique ID of tenant that is performing the operation.
      requestingUserOrServiceId - Unique ID of user/service that triggered the event.
      dataLabel - Classification of the event if more than the event category is needed.
      otherData - Additional String key/value pairs to add to metadata.
      Throws:
      IllegalArgumentException - If the provided tenantId is not set
    • EventMetadata

      public EventMetadata(String tenantId, String requestingUserOrServiceId, String dataLabel, String requestId)
      Constructor for EventMetadata class which contains a unique request ID to send to the Tenant Security Proxy.
      Parameters:
      tenantId - Unique ID of tenant that is performing the operation.
      requestingUserOrServiceId - Unique ID of user/service that triggered the event.
      dataLabel - Classification of the event if more than the event category is needed.
      requestId - Unique ID that ties host application request ID to Tenant Security Proxy logs.
      Throws:
      IllegalArgumentException - If the provided tenantId is not set
    • EventMetadata

      public EventMetadata(String tenantId, String requestingUserOrServiceId, String dataLabel)
      Constructor for EventMetadata class which has no additional metadata.
      Parameters:
      tenantId - Unique ID of tenant that is performing the operation.
      requestingUserOrServiceId - Unique ID of user/service that triggered the event.
      dataLabel - Classification of the event if more than the event category is needed.
      Throws:
      IllegalArgumentException - If the provided tenantId is not set
  • Method Details

    • getTenantId

      public String getTenantId()
      Get the tenant ID.
      Returns:
      Metadata tenant ID
    • getRequestingUserOrServiceId

      public String getRequestingUserOrServiceId()
      Get the requesting user or service ID.
      Returns:
      Requesting user or service ID
    • getRequestId

      public String getRequestId()
      Get the provided request ID
      Returns:
      Unique ID that ties host application request ID to Tenant Security Proxy logs.
    • getDataLabel

      public String getDataLabel()
      Get the data classification label.
      Returns:
      Data classification label
    • getOtherData

      public Map<String,String> getOtherData()
      Get any other metadata.
      Returns:
      Any other key/value metadata
    • getAsPostData

      public Map<String,Object> getAsPostData()
      Convert all of the metadata into a HashMap that can be used to POST all the data to the Tenant Security Proxy. Adds all required fields to the Map, all optional fields to a sub map, and then builds up another sub map for any custom fields.
      Returns:
      Metadata converted into POST data Map