harbor icon indicating copy to clipboard operation
harbor copied to clipboard

Add option to store IP-Addresses and/or user-agents details in audit logs

Open tpoxa opened this issue 1 year ago • 8 comments

This PR adds the option to log IP addresses and user agents in audit logs. This new functionality is optional and can be enabled/disabled by the admin in the configuration.

related to https://github.com/goharbor/community/pull/10

Issue being fixed

closes #18675, #16423, #5561

Please indicate you've done the following:

  • [x] Well Written Title and Summary of the PR
  • [x] Label the PR as needed. release-note/new-feature
  • [x] Accepted the DCO. Commits without the DCO will delay acceptance.
  • [x] Made sure tests are passing and test coverage is added if needed.
  • [x] Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

Screenshots: Screenshot 2024-01-08 at 19 44 27 Screenshot 2024-01-08 at 19 45 16

tpoxa avatar Dec 18 '23 08:12 tpoxa

Codecov Report

Attention: Patch coverage is 52.71318% with 61 lines in your changes are missing coverage. Please review.

Project coverage is 67.46%. Comparing base (b7b8847) to head (d849179). Report is 117 commits behind head on main.

:exclamation: Current head d849179 differs from pull request most recent head eb5fc28. Consider uploading reports for the commit eb5fc28 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #19725      +/-   ##
==========================================
- Coverage   67.56%   67.46%   -0.10%     
==========================================
  Files         991      997       +6     
  Lines      109181   109959     +778     
  Branches     2719     2724       +5     
==========================================
+ Hits        73768    74185     +417     
- Misses      31449    31789     +340     
- Partials     3964     3985      +21     
Flag Coverage Δ
unittests 67.46% <52.71%> (-0.10%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/controller/systeminfo/controller.go 68.35% <100.00%> (+1.68%) :arrow_up:
src/lib/config/config.go 86.04% <100.00%> (ø)
src/lib/config/userconfig.go 67.51% <100.00%> (-0.46%) :arrow_down:
src/lib/context.go 100.00% <100.00%> (ø)
src/pkg/audit/model/model.go 100.00% <ø> (ø)
...portal/src/app/base/left-side-nav/config/config.ts 100.00% <100.00%> (ø)
...ide-nav/config/system/system-settings.component.ts 54.54% <ø> (ø)
src/portal/src/app/services/app-config.ts 100.00% <ø> (ø)
src/core/middlewares/middlewares.go 0.00% <0.00%> (ø)
...app/base/left-side-nav/log/recent-log.component.ts 60.46% <50.00%> (-3.43%) :arrow_down:
... and 7 more

... and 22 files with indirect coverage changes

codecov[bot] avatar Dec 19 '23 23:12 codecov[bot]

Strongly hope that this PR will be merged into 2.11.0!! This PR will close #18675, #16423, #5561 and https://github.com/goharbor/community/pull/10

NitroCao avatar Jan 05 '24 03:01 NitroCao

Hello Harbor team, we are looking forward for this feature. Could you please provide an update on the plans for it? Are there any blockers, or is it a work in progress?

Ankurk99 avatar Mar 26 '24 16:03 Ankurk99

Hey harbor team, we need this feature))

WAR-S avatar May 28 '24 15:05 WAR-S

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

github-actions[bot] avatar Jul 28 '24 09:07 github-actions[bot]

In terms of the client IP. I still have some concerns regarding the accuracy.

Have you tested when the client is from a different network or behind a VPN?

reasonerjt avatar Aug 13 '24 07:08 reasonerjt