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

[AppSec] Automated user ID collection modes #2782

Merged
merged 8 commits into from
Aug 8, 2024

Conversation

Anilm3
Copy link
Contributor

@Anilm3 Anilm3 commented Jul 31, 2024

Description

This PR introduces the new user ID collection modes (ident, anon, disabled) which replace the old ones (safe, extended, disabled). Some interesting facts:

  • ident mode is now the default one, meaning the user IDs are always collected.
  • Metadata is no longer included on ident or anon mode.
  • All relevant headers are now collected on ident or anon mode.
  • Some of the functionality has been moved to user_tracking.*, in preparation for further work on authenticated user tracking.

The system tests will fail due to the change on login events, however they have been updated here: https://github.com/DataDog/system-tests/compare/anilm3/php-user-events-v2?expand=1

The remote configuration changes have not been included in this PR given the ongoing work being done on the helper.

Related Jira: APPSEC-53749

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 69.69697% with 30 lines in your changes missing coverage. Please review.

Project coverage is 79.17%. Comparing base (471a64f) to head (8cdfe4f).

Files Patch % Lines
appsec/src/extension/tags.c 61.70% 9 Missing and 9 partials ⚠️
appsec/src/extension/user_tracking.c 76.92% 5 Missing and 7 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2782      +/-   ##
============================================
- Coverage     79.27%   79.17%   -0.10%     
  Complexity     2452     2452              
============================================
  Files           169      169              
  Lines         18018    18052      +34     
  Branches        904      913       +9     
============================================
+ Hits          14283    14293      +10     
- Misses         3245     3264      +19     
- Partials        490      495       +5     
Flag Coverage Δ
appsec-extension 69.27% <69.69%> (-0.37%) ⬇️
tracer-extension 79.21% <ø> (ø)
tracer-php 82.88% <ø> (ø)

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

Files Coverage Δ
appsec/src/extension/configuration.c 62.62% <ø> (ø)
appsec/src/extension/configuration.h 100.00% <ø> (ø)
appsec/src/extension/user_tracking.c 71.69% <76.92%> (+6.88%) ⬆️
appsec/src/extension/tags.c 79.86% <61.70%> (-2.71%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 471a64f...8cdfe4f. Read the comment docs.

@Anilm3 Anilm3 marked this pull request as ready for review August 1, 2024 10:42
@Anilm3 Anilm3 requested a review from a team as a code owner August 1, 2024 10:42
appsec/src/extension/user_tracking.c Outdated Show resolved Hide resolved
appsec/src/extension/user_tracking.c Outdated Show resolved Hide resolved
appsec/src/extension/user_tracking.c Show resolved Hide resolved
appsec/src/extension/user_tracking.c Show resolved Hide resolved
appsec/tests/extension/headers_collection_10.phpt Outdated Show resolved Hide resolved
@Anilm3 Anilm3 force-pushed the anilm3/user-collection-modes branch from c0df523 to 8cdfe4f Compare August 7, 2024 21:04
@Anilm3 Anilm3 merged commit fc551c2 into master Aug 8, 2024
669 of 695 checks passed
@Anilm3 Anilm3 deleted the anilm3/user-collection-modes branch August 8, 2024 09:43
@github-actions github-actions bot added this to the 1.3.0 milestone Aug 8, 2024
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.

4 participants