NationalSecurityAgency/datawave-audit-service

Java

9

223 commits

updated Mar 10, 2025

See the code

README

Audit Service

Apache License Build Status

The audit service is a DATAWAVE microservice that provides query audit capabilities.

Audit Context

https://host:port/audit/v1/

User API

MethodOperationDescriptionPath ParamRequest Body
POST/auditSends an audit requestN/A[AuditRequest]

Replay Context

https://host:port/audit/v1/replay/

Replay API

MethodOperationDescriptionPath ParamRequest Body
POST/createCreates an audit replay requestN/A[ReplayRequest]
POST/createAndStartCreates an audit replay request, and starts itN/A[ReplayRequest]
PUT/{id}/startStarts an audit replay[ReplayId]N/A
GET/{id}/statusGets the status of an audit replay[ReplayId]N/A
PUT/{id}/updateUpdates an audit replay[ReplayId][SendRate]
PUT/{id}/stopStops an audit replay[ReplayId]N/A
PUT/{id}/resumeResumes an audit replay[ReplayId]N/A
DELETE/{id}/deleteDeletes an audit replay[ReplayId]N/A
PUT/startAllStarts all audit replaysN/AN/A
GET/statusAllGets the status for all audit replaysN/AN/A
PUT/updateAllUpdates all audit replaysN/A[SendRate]
PUT/stopAllStops all audit replaysN/AN/A
PUT/resumeAllResumes all audit replaysN/AN/A
DELETE/deleteAllDeletes all audit replaysN/AN/A

Getting Started

  1. First, refer to services/README for launching the config and authorization services.

    • The authorization service should be launched with the mock profile to leverage test PKI materials and associated user configuration (see authorization-mock.yml).
  2. Launch this service as follows, with the remoteauth profile to enable client cert authentication...

    java -jar service/target/audit-service*-exec.jar --spring.profiles.active=dev,remoteauth,mock
    
  3. Ensure that the PKI Dir is checked out locally somewhere, and set in the environment variable PKI_DIR.

  4. Submit an audit request using curl.

    curl -q -k --cacert $PKI_DIR/ca.pem -E $PKI_DIR/user.pem \
    --data-urlencode "auditUserDN=testUser" \
    --data-urlencode "auditType=LOCALONLY" \
    --data-urlencode "query=no query--testing the audit service" \
    --data-urlencode "queryDate=1514764800000" \
    --data-urlencode "auditColumnVisibility=USER" \
    --data-urlencode "logicClass=EventQuery" \
    --data-urlencode "auths=TEST" \
    https://localhost:8743/audit/v1/audit
    

    See sample_configuration/audit-dev.yml and configure as desired

hacktoberfest

NationalSecurityAgency/datawave-audit-service

Java

9

223 commits

updated Mar 10, 2025

See the code

README

Audit Service

Apache License Build Status

The audit service is a DATAWAVE microservice that provides query audit capabilities.

Audit Context

https://host:port/audit/v1/

User API

MethodOperationDescriptionPath ParamRequest Body
POST/auditSends an audit requestN/A[AuditRequest]

Replay Context

https://host:port/audit/v1/replay/

Replay API

MethodOperationDescriptionPath ParamRequest Body
POST/createCreates an audit replay requestN/A[ReplayRequest]
POST/createAndStartCreates an audit replay request, and starts itN/A[ReplayRequest]
PUT/{id}/startStarts an audit replay[ReplayId]N/A
GET/{id}/statusGets the status of an audit replay[ReplayId]N/A
PUT/{id}/updateUpdates an audit replay[ReplayId][SendRate]
PUT/{id}/stopStops an audit replay[ReplayId]N/A
PUT/{id}/resumeResumes an audit replay[ReplayId]N/A
DELETE/{id}/deleteDeletes an audit replay[ReplayId]N/A
PUT/startAllStarts all audit replaysN/AN/A
GET/statusAllGets the status for all audit replaysN/AN/A
PUT/updateAllUpdates all audit replaysN/A[SendRate]
PUT/stopAllStops all audit replaysN/AN/A
PUT/resumeAllResumes all audit replaysN/AN/A
DELETE/deleteAllDeletes all audit replaysN/AN/A

Getting Started

  1. First, refer to services/README for launching the config and authorization services.

    • The authorization service should be launched with the mock profile to leverage test PKI materials and associated user configuration (see authorization-mock.yml).
  2. Launch this service as follows, with the remoteauth profile to enable client cert authentication...

    java -jar service/target/audit-service*-exec.jar --spring.profiles.active=dev,remoteauth,mock
    
  3. Ensure that the PKI Dir is checked out locally somewhere, and set in the environment variable PKI_DIR.

  4. Submit an audit request using curl.

    curl -q -k --cacert $PKI_DIR/ca.pem -E $PKI_DIR/user.pem \
    --data-urlencode "auditUserDN=testUser" \
    --data-urlencode "auditType=LOCALONLY" \
    --data-urlencode "query=no query--testing the audit service" \
    --data-urlencode "queryDate=1514764800000" \
    --data-urlencode "auditColumnVisibility=USER" \
    --data-urlencode "logicClass=EventQuery" \
    --data-urlencode "auths=TEST" \
    https://localhost:8743/audit/v1/audit
    

    See sample_configuration/audit-dev.yml and configure as desired

hacktoberfest