Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tpoxa
Copy link
Contributor

@tpoxa tpoxa commented Dec 18, 2023

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 goharbor/community#10

Issue being fixed

closes #18675, #16423, #5561

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. release-note/new-feature
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • 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 tpoxa requested a review from a team as a code owner December 18, 2023 08:58
@tpoxa tpoxa force-pushed the add-client-ip-to-audit-logs branch 6 times, most recently from b724948 to ab6a92c Compare December 19, 2023 22:55
Copy link

codecov bot commented Dec 19, 2023

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.

❗ 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%) ⬇️

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%) ⬆️
src/lib/config/config.go 86.04% <100.00%> (ø)
src/lib/config/userconfig.go 67.51% <100.00%> (-0.46%) ⬇️
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%) ⬇️
... and 7 more

... and 22 files with indirect coverage changes

@NitroCao
Copy link

NitroCao commented Jan 5, 2024

Strongly hope that this PR will be merged into 2.11.0!! This PR will close #18675, #16423, #5561 and goharbor/community#10

@tpoxa tpoxa force-pushed the add-client-ip-to-audit-logs branch from cc0498e to 8bb1f82 Compare January 7, 2024 18:24
@Vad1mo Vad1mo changed the title add option to store ip addresses and/or user-agents in audit logs Add option to store IP-Addresses and/or user-agents details in audit logs Jan 8, 2024
@Vad1mo Vad1mo added the release-note/new-feature New Harbor Feature label Jan 8, 2024
@Vad1mo Vad1mo enabled auto-merge (squash) January 9, 2024 10:27
src/portal/src/i18n/lang/en-us-lang.json Show resolved Hide resolved
src/portal/src/i18n/lang/en-us-lang.json Show resolved Hide resolved
src/portal/src/i18n/lang/en-us-lang.json Outdated Show resolved Hide resolved
src/portal/src/i18n/lang/de-de-lang.json Outdated Show resolved Hide resolved
src/portal/src/i18n/lang/de-de-lang.json Outdated Show resolved Hide resolved
src/portal/src/i18n/lang/de-de-lang.json Outdated Show resolved Hide resolved
src/portal/src/i18n/lang/de-de-lang.json Outdated Show resolved Hide resolved
src/portal/src/i18n/lang/de-de-lang.json Outdated Show resolved Hide resolved
auto-merge was automatically disabled January 12, 2024 20:15

Head branch was pushed to by a user without write access

@tpoxa tpoxa force-pushed the add-client-ip-to-audit-logs branch from fc6d5bd to d849179 Compare January 27, 2024 18:47
@Vad1mo Vad1mo enabled auto-merge (squash) February 6, 2024 17:57
auto-merge was automatically disabled February 10, 2024 14:21

Head branch was pushed to by a user without write access

@tpoxa tpoxa force-pushed the add-client-ip-to-audit-logs branch from e48fd1c to 86e7be0 Compare February 10, 2024 14:21
@Vad1mo Vad1mo enabled auto-merge (squash) February 21, 2024 10:43
auto-merge was automatically disabled February 25, 2024 19:38

Head branch was pushed to by a user without write access

@tpoxa tpoxa force-pushed the add-client-ip-to-audit-logs branch from 86e7be0 to e8455c7 Compare February 25, 2024 19:38
@tpoxa tpoxa force-pushed the add-client-ip-to-audit-logs branch from e8455c7 to 3b4d564 Compare March 2, 2024 16:13
fix ui tests

Signed-off-by: Maksym Trofimenko <maksym@container-registry.com>
Maksym Trofimenko added 2 commits March 24, 2024 22:10
Signed-off-by: Maksym Trofimenko <maksym@container-registry.com>
update translations
Signed-off-by: Maksym Trofimenko <maksym@container-registry.com>
@tpoxa tpoxa force-pushed the add-client-ip-to-audit-logs branch from 3b4d564 to eb5fc28 Compare March 24, 2024 22:10
@Ankurk99
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add client IP for audit logs
9 participants