Skip to content

Add service to send Arkose truth data

Ian Anderson requested to merge add-arkose-truth-data-service into master

What does this MR do and why?

This MR adds a service to send Arkose truth data which will allow us to communicate to Arkose, when a user risk score was not accurate.

related to: https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/work_items/600

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable Identity Verification (use Arkose development API keys in 1Password)
::Gitlab::CurrentSettings.update(email_confirmation_setting: 'hard')
::Gitlab::CurrentSettings.update(require_admin_approval_after_user_signup: false)
::Gitlab::CurrentSettings.update(arkose_labs_public_api_key: '****', arkose_labs_private_api_key: '****', arkose_labs_namespace: 'client')
::Gitlab::CurrentSettings.update(arkose_labs_client_xid: '****') 
::Gitlab::CurrentSettings.update(arkose_labs_client_secret: '****') 

Feature.enable(:arkose_labs_signup_challenge)
Feature.enable(:identity_verification)
  1. Register a new user. The full registration flow does not need to be completed since Arkose is queried after the POST request is made to create the new account.
  2. After submitting the request for a new user Run the following in the rails console. For is_legit you should put false if the ARKOSE_RISK_BAND is low, otherwise set is_legit to true.
[11] pry(main)> u = User.last
=> #<User id:138 @new33>
[12] pry(main)> u.custom_attributes.by_key(UserCustomAttribute::ARKOSE_RISK_BAND).first&.value
=> "Low"
[13] pry(main)> Arkose::TruthDataService.new(user: u, is_legit: false).execute
=> #<ServiceResponse:0x00007f082ce473a8 @http_status=:ok, @message=nil, @payload={}, @reason=nil, @status=:success>
Edited by Ian Anderson

Merge request reports