Skip to content

user_id cannot be nil when manually triggering login failure appsec events  #3840

Description

@jwoodrow

Current behaviour

When a user tries to sign in using alternative sign in flows then login success/failures are tracked manually. But when this alternative login attempt fails because the user does not exist then there can be no user_id for the Datadog::Kit::AppSec::Events.track_login_failure

This results in an ArgumentError user_id cannot be nil even if user_exists: false is provided

Expected behaviour

if user_exists: false is provided, a nil value should be allowed.

Steps to reproduce

Call Datadog::Kit::AppSec::Events.track_login_failure with user_id: nil, user_exists: false

How does datadog help you?

We use datadog for log management, APM and security protection

Environment

  • datadog version: 7
  • Configuration block (Datadog.configure ...):
  • Ruby version: 3.3.4
  • Operating system: Heroku ubuntu
  • Relevant library versions:

Metadata

Metadata

Assignees

Labels

appsecApplication Security monitoring productbugInvolves a bugcommunityWas opened by a community member

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions