US-EPA-CAMD / easey-ui

Project Management repo for EPA Clean Air Markets Division (CAMD) Business Suite of applications
MIT License
0 stars 0 forks source link

Requirements and Implementation for Audit Log for Data Changes #4732

Open MaeganWood64 opened 1 year ago

MaeganWood64 commented 1 year ago

Next steps:

Needs to be implemented before performance testing.

MaeganWood64 commented 1 year ago
JanellC commented 1 year ago

Need requirements for what needed to be audited. Mike H will send over requirements . Requirements will be sent week of 5/29

JanellC commented 1 year ago

Aiming to work on this after the ECMPS BETA functionality is completed

JanellC commented 1 year ago

@JanellC add requirements to this ticket for whoever picks this ticket up

mark-hayward-erg commented 3 months ago

@maheese Is this covered by #6246, or does additional logging need to be defined in this ticket (or other new tickets)?

maheese commented 3 months ago

@maheese Is this covered by #6246, or does additional logging need to be defined in this ticket (or other new tickets)?

6246 was intended to cover AC-6(9) which just deals with privileged functions. In our case we are defining these as any action that requires ECMPS Admin. Privileged audit records are called out separately in the controls.

This ticket was created to cover general audit requirements. Since this ticket was initially created we have received additional guidance on what event types need to have audit records. Here's what was provided:

For each event we are supposed to be capturing:

We should have a discussion and come to a consensus on what these mean for our system and then create additional tickets to implement.

alangmaid commented 1 month ago

@maheese for each of the bullets above can you add the applicable NIST Standard and/or Security control? Doing so will enable us to tag the logs and facilitate providing evidence for annual security reviews.

maheese commented 2 weeks ago

@maheese for each of the bullets above can you add the applicable NIST Standard and/or Security control? Doing so will enable us to tag the logs and facilitate providing evidence for annual security reviews.

@alangmaid sorry, just seeing this now. These requirements come from NIST 800-53 AU-2 Event Logging and AU-3 Content of Audit Records. The specific EPA requirements for these controls are in the EPA's Audit Policy. The Audit Policy defers to M-21-31 as to what to audit. The list that I supplied in the comment above is from M-21-31, Appendix C, page 40.

alangmaid commented 2 weeks ago

Thanks @maheese.

maheese commented 2 weeks ago

@ergjustin I think most of what is required can be covered by adding logging to the API's since the endpoints identify the type of event (checkout, revert, create activity, etc.).

For content:

It would be good if we could use a structured format:

{
   "eventName": "Revert monitoring plan",
   "eventOutcome": "success",
   "eventSource": "0.0.0.0",
   "userId": "test-user",
   "moreInfo": "..."
}

There are process that run outside of the API requests, such as Quartz jobs, that we also need to make sure we are logging.

Lastly, we need to make sure that we are trapping any errors/exceptions that are being thrown and make sure those are logged.

ergjustin commented 1 week ago

LoggingInterceptor Doc : https://docs.nestjs.com/interceptors#aspect-interception

Now, it's not deployed in dev env, so I couldn't test with cloud.gov and kibana. I only tested on local env. Image Image

The below listed APIs I used the LoggingInterceptor

auth-api camd-services monitor-plan-api
sign-in evaluation revert
sign-out queue [Creates submission] POST - check-outs/plans/{planid}
create-activity PUT - check-outs/plans/{planid}
DELETE - check-outs/plans/{planid}

When the error occurs from Auth Guard, it does not catch the interceptor (link, link)