harbor icon indicating copy to clipboard operation
harbor copied to clipboard

Add client IP for audit logs

Open NitroCao opened this issue 2 years ago • 6 comments

Currently audit logs don't contain client IP, which isn't enough for security audit. Can we add it for audit log?

NitroCao avatar May 12 '23 09:05 NitroCao

Currently, the client IP is not stored in the database, but maybe it can be grabbed from the nginx or core logs.

chlins avatar May 15 '23 00:05 chlins

Currently, the client IP is not stored in the database, but maybe it can be grabbed from the nginx or core logs.

Yeah Nginx logs contain client IPs but it's difficult to associate them with corresponding accounts. I just found related issues:

  • #16423 just records the IPs failed to login.
  • #5561 is the exact same as my issue, and a related proposal goharbor/community#10 is still open and has no any progress.

NitroCao avatar May 15 '23 02:05 NitroCao

@chlins I think this is valuable, do you agree to do it? If yes, I can contribute.

lengrongfu avatar May 16 '23 08:05 lengrongfu

Any news on this...

This is important to track security related issues...

I can try and fix this, if you think it's a good first issue.

dioguerra avatar Jun 21 '23 09:06 dioguerra

I agree having IP information is helpful, but it's secure only when it's accurate. I'm no expert in networking, but if the client is using VPN or from a different network, getting the source IP may be complicated.

Storing inaccurate information will only have negative effect to security.

reasonerjt avatar Aug 13 '24 07:08 reasonerjt

I agree having IP information is helpful, but it's secure only when it's accurate. I'm no expert in networking, but if the client is using VPN or from a different network, getting the source IP may be complicated.

@reasonerjt It's unnecessary for developers to consider such complicated situations, it's for security team's.

NitroCao avatar Aug 13 '24 08:08 NitroCao

In our case of cloud's customer, they required record client ip to the audit logs. But it is difficult to obtain the client IP accurately if the user uses a proxy, or the server is deployed in some special network area, such as behind CloudFlare.

kofj avatar Sep 04 '24 14:09 kofj