dd-trace-php icon indicating copy to clipboard operation
dd-trace-php copied to clipboard

[Feature] Wordpress integration should identify the active user

Open NickStallman opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. I am evaluating Application Security Management on a few Wordpress websites. ASM keeps mentioning:

Know when authenticated users target your application
Instrument your services with the standardized user tags: see documentation.

Describe the solution you'd like Wordpress has a standard user authentication mechanism, so the Integration should be able to automatically provide the user details as part of the root span.

This would probably be done by hooking the action set_current_user or tracing the function wp_set_current_user.

Describe alternatives you've considered It's not hard to add the current user's details, but I'd expect Integrations that have standardised authentication to work automatically out of the box. There may be extra app specific metadata added as well, but the basics can "just work".

This may also be applicable in varying degrees for Laravel and other frameworks with built in auth as well. The more custom ones may just have the user id and nothing more by default.

NickStallman avatar Feb 07 '23 02:02 NickStallman

We just recently added a first class \DDTrace\set_user() function in #1910. Our integrations shall make use of it :-)

Just attempted #1920 for Laravel now.

bwoebi avatar Feb 10 '23 11:02 bwoebi

Brilliant. I'll keep my eyes peeled for this in future releases.

NickStallman avatar Feb 10 '23 18:02 NickStallman