Skip to content

Store Telesign risk score as an abuse trust score

Juliet Wanjohi requested to merge log-telesign-score-trust-scores-table into master

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR saves the Telesign risk score received for a user's phone number in the abuse trust scores table that was created in this MR as part of an effort to store abuse scores from various systems and track these over time.

Related issue - https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/285

Screenshots or screen recordings

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

How to set up and validate locally

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

  1. In the Rails console, configure Telesign by setting the CUSTOMER_ID and API_KEY variables to the values in 1Password:

    ::Gitlab::CurrentSettings.update(telesign_customer_xid: CUSTOMER_ID, telesign_api_key: API_KEY)
  2. Set variable INTERNATIONAL_PHONE_NUMBER - should be your country code and phone number e.g. 447585886933 for UK.

  3. Check the telesign score for a user, it should be 0.0:

    u = User.find(1)
    u.telesign_score
    => 0.0
  4. Send the verification code for the user and their phone number:

    params = { country: 'UK', international_dial_code: 44, phone_number: '7585886933' }
    result = PhoneVerification::Users::SendVerificationCodeService.new(u, params).execute
  5. Check the telesign_score for the user, it should be equal to the risk_score value returned from Telesign:

    u.telesign_score
    => 12.0

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Juliet Wanjohi

Merge request reports