Skip to content

Clean up / refactor ThreatMetrix configuration#7582

Merged
matthinz merged 8 commits intomainfrom
matthinz/8512-tm-ff
Jan 13, 2023
Merged

Clean up / refactor ThreatMetrix configuration#7582
matthinz merged 8 commits intomainfrom
matthinz/8512-tm-ff

Conversation

@matthinz
Copy link
Contributor

@matthinz matthinz commented Jan 5, 2023

🎫 Ticket

LG-8512

🛠 Summary of changes

TLDR: There will be 2 settings to control whether/how ThreatMetrix is enabled. The ThreatMetrix mock will now be enabled by default locally

This PR removes references to the following config flags:

  • lexisnexis_threatmetrix_enabled
  • lexisnexis_threatmetrix_required_to_verify
  • proofing_device_profiling_collecting_enabled

It then adds a new config flag, proofing_device_profiling to be used to control how "on" ThreatMetrix is. Valid values are:

Value Description
disabled No ThreatMetrix Javascript is included on the page during IdV, no API calls are made to ThreatMetrix, and profiles are never deactivated due to ThreatMetrix judgements.
collect_only ThreatMetrix Javascript is included on the page during IdV, and we make the session query API call and record the result on the user's ProofingComponent. Profiles are never deactivated due to ThreatMetrix status.
enabled ThreatMetrix Javascript is included on the page during IdV, we make API calls, store the result on the user's ProofingComponent, and will deactivate the profile if the review status is not "pass".

Additionally, this PR now enables the ThreatMetrix mock implementation (via the lexisnexis_threatmetrix_mock_enabled flag) in development and test environments.

To allow for migration, this PR allows the old config flags to continue existing, but be overridden by the new flag. #7639 fully removes the old config flags.

📜 Testing Plan

(This plan is provided as sets of config flags for your application.yml and what you should see after running through identity verification with them applied.)

Verify that old flags are still respected for now:

proofing_device_profiling_collecting_enabled: true
lexisnexis_threatmetrix_required_to_verify: true
lexisnexis_threatmetrix_mock_enabled: true

You should see:

  • Mock result field on SSN screen
  • Evidence of ThreatMetrix on proofing component after IdV
  • Decisioning applied (redirect to sad screen)

Verify that new flag overrides old flags:

proofing_device_profiling_collecting_enabled: true
lexisnexis_threatmetrix_required_to_verify: true
lexisnexis_threatmetrix_mock_enabled: true
proofing_device_profiling: disabled

You should see:

  • No mock result field on SSN screen
  • No evidence of Threatmetrix on proofing component after IdV
  • No decisioning applied

Verify that new flag works for collection and that ThreatMetrix mock enabled by default:

proofing_device_profiling: collect_only

You should see:

  • Mock result field on SSN screen
  • Evidence of ThreatMetrix on proofing component after IdV
  • No decisioning applied

Verify that new flag works for collection & decisioning and that mock enabled by default:

proofing_device_profiling: enabled

You should see:

  • Mock result field on SSN screen
  • Evidence of ThreatMetrix on proofing component after IdV
  • Decisioning applied (redirect to sad screen)

Verify that new flag works for collection & decisioning and that mock can be disabled:

proofing_device_profiling: enabled
lexisnexis_threatmetrix_mock_enabled: false

You should see (assuming you don't have additional variables set to configure ThreatMetrix API access):

  • No mock result field on SSN screen
  • Evidence of ThreatMetrix on proofing component after IdV
  • Decisioning applied (redirect to sad screen)
  • Exceptions related to ThreatMetrix in events.log (since it's not properly configured, but mock was disabled)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor update here: Check that the profile is deactivated due to threatmetrix rather than re-evaluating the threatmetrix_review_status

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding :collect_only is a great use of an enum!

@matthinz matthinz force-pushed the matthinz/8512-tm-ff branch 5 times, most recently from 373f8aa to f47ffb5 Compare January 6, 2023 22:30
@matthinz matthinz marked this pull request as ready for review January 7, 2023 00:55
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matthinz matthinz force-pushed the matthinz/8512-tm-ff branch from c20c94e to db803cb Compare January 11, 2023 18:42
- Move logic around "should this be enabled?" into FeatureManagement
- Add logic to automatically enable the ThreatMetrix mock in lower environments

changelog: Internal, ThreatMetrix, Simplify ThreatMetrix config flags.
Profile should've been deactivated by this point, so don't look at ProofingComponent.
Checking domain is kind of smelly. We can approximate this by setting good defaults.
The ThreatMetrix mock does not use org ID. It feels needlessly complex to check for it (it should _always_ be configured when TM is enabled for real)
Copy link
Contributor

@theabrad theabrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

kantara_2fa_phone_restricted: false
kantara_2fa_phone_existing_user_restriction: false
kantara_restriction_enforcement_date: '2022-07-19'
lexisnexis_threatmetrix_mock_enabled: false
Copy link
Contributor

@theabrad theabrad Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate. line 176 already has mock_enabled: true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the goal here is to enable it locally by default but disable it by default in production

@matthinz matthinz merged commit 678891c into main Jan 13, 2023
@matthinz matthinz deleted the matthinz/8512-tm-ff branch January 13, 2023 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants