In the development of an organization's web system (containing sensitive information) with credentials, where the actions carried out must be monitored, what information should I keep when each action takes place?

For example, let's suppose the administrator accepts a transaction and months later he says "It wasn't me". We should have the correct pieces of information (apart from the login credentials used at the moment) to check if it was him or not, at least to support a legal act.

The minimum information I guess that should be considered:

  • IP at the moment of the action.
  • Exact date.
  • The values before and after the transaction.
  • Username.

I understand that this depends a lot on the context, so in that case, let's answer for the example I wrote.

  • 1
    There is no single answer here. It depends on what your service does, and even individual parts of the service. I've had systems which include detailed logs (including most of the above) in some parts and then kept no audit logs elsewhere because no one would ever care. in particular, if you are in a regulated industry then you should look very careful at what legal/financial/other regulations might have to say about this topic. – Conor Mancone Apr 6 at 18:24
  • Your question is a little like asking "how long is a piece of string?" You collect the details you need to achieve your goals. What that looks like will depend on your goals and your service. A quick search for "audit logs" will give you all that you would need to consider. – schroeder Apr 6 at 19:26
  • @ConorMancone your first comment in fact is the answer I was looking for, as well as Schroeder's. It absolutely depends on the client needs and enough for the scenario. I also wanted to make sure I was not missing any important attribute in the list. Thank you very much. – J. Francis Apr 6 at 21:14
  • I made a mistake about the Login credentials. I meant the username or whatever he used to login, of course without the password. – J. Francis Apr 6 at 21:15

I will assume the example that you mentioned:

IP at the moment of the action.

This is good

Exact date.

Also good if you add the time as well

The values before and after the transaction.

This is also good but I would probably detail it and add some more info as:

  • Transaction ID
  • Quantity sent
  • Type of transaction
  • Sender and Receiver (including the accounts id, for example)

Login credentials.

This is an absolutely NONO for many reasons:

  • If you mention credentials I assume that you mean cleartext password, which would imply that they are not hashing psw -> BIG NO
  • The idea of logging is to keep a track of the user actions. If an admin is checking logs, why would he need the credentials of the account? Also, take into account that your app should always follow the least privilege principle

In the end what we want to achieve with logging is to ensure non-repudiation. It would not make a lot of sense to add credentials in there. Just imagine how catastrophic would be if that page would be exposed through a XSS or something similar!

  • 1
    Thank you for your answer. Just in case, by credentials I meant username or user ID. – J. Francis Apr 6 at 21:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.