-
Notifications
You must be signed in to change notification settings - Fork 166
LG-7306 Redacted logging of ThreatMetrix response #6857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6dfd29d
6c17eb1
e703a53
334e96a
f418d06
448c067
1e9f2d1
d3ce41c
f3ae6b5
ba70cf0
ba79fff
74f01bb
ad8f8fd
69addb8
42efb4d
b0848e2
f4266db
8c10b11
f7cdb21
6e4572a
ab1b64e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| module Proofing | ||
| module LexisNexis | ||
| module Ddp | ||
| class ResponseRedacter | ||
| ALLOWED_RESPONSE_FIELDS = %w[ | ||
| account_email_assert_history | ||
| account_email_first_seen | ||
| account_email_last_event | ||
| account_email_last_update | ||
| account_email_result | ||
| account_email_score | ||
| account_email_worst_score | ||
| account_address_state | ||
| account_lex_id | ||
| account_lex_id_first_seen | ||
| account_lex_id_last_event | ||
| account_lex_id_last_update | ||
| account_lex_id_region | ||
| account_lex_id_result | ||
| account_lex_id_score | ||
| account_lex_id_worst_score | ||
| account_name_assert_history | ||
| account_name_first_seen | ||
| account_name_last_event | ||
| account_name_last_update | ||
| account_name_result | ||
| account_name_score | ||
| account_name_worst_score | ||
| api_call_datetime | ||
| api_caller_ip | ||
| api_type | ||
| api_version | ||
| bb_assessment | ||
| bb_assessment_rating | ||
| bb_bot_rating | ||
| bb_bot_score | ||
| bb_fraud_rating | ||
| bb_fraud_score | ||
| champion_request_duration | ||
| digital_id | ||
| digital_id_confidence | ||
| digital_id_confidence_rating | ||
| digital_id_first_seen | ||
| digital_id_last_event | ||
| digital_id_last_update | ||
| digital_id_result | ||
| digital_id_trust_score | ||
| digital_id_trust_score_rating | ||
| digital_id_trust_score_reason_code | ||
| digital_id_trust_score_summary_reason_code | ||
| emailage.emailriskscore.billriskcountry | ||
| emailage.emailriskscore.correlationid | ||
| emailage.emailriskscore.domainexists | ||
| emailage.emailriskscore.domainrelevantinfo | ||
| emailage.emailriskscore.domainrelevantinfoid | ||
| emailage.emailriskscore.domainriskcountry | ||
| emailage.emailriskscore.domainrisklevel | ||
| emailage.emailriskscore.domainrisklevelid | ||
| emailage.emailriskscore.eaadvice | ||
| emailage.emailriskscore.eaadviceid | ||
| emailage.emailriskscore.eareason | ||
| emailage.emailriskscore.eareasonid | ||
| emailage.emailriskscore.eariskband | ||
| emailage.emailriskscore.eariskbandid | ||
| emailage.emailriskscore.eascore | ||
| emailage.emailriskscore.eastatusid | ||
| emailage.emailriskscore.emailexists | ||
| emailage.emailriskscore.first_seen_days | ||
| emailage.emailriskscore.firstverificationdate | ||
| emailage.emailriskscore.fraudrisk | ||
| emailage.emailriskscore.namematch | ||
| emailage.emailriskscore.phone_status | ||
| emailage.emailriskscore.responsestatus.errorcode | ||
| emailage.emailriskscore.responsestatus.status | ||
| emailage.emailriskscore.shipforward | ||
| emailage.emailriskscore.status | ||
| emailage.emailriskscore.totalhits | ||
| emailage.emailriskscore.uniquehits | ||
| enabled_services | ||
| event_datetime | ||
| event_type | ||
| fraudpoint.conversation_id | ||
| fraudpoint.friendly_fraud_index | ||
| fraudpoint.manipulated_identity_index | ||
| fraudpoint.product_status | ||
| fraudpoint.transaction_reason_code | ||
| fraudpoint.risk_indicators_codes | ||
| fraudpoint.risk_indicators_descriptions | ||
| fraudpoint.score | ||
|
stevegsa marked this conversation as resolved.
Outdated
|
||
| fraudpoint.stolen_identity_index | ||
| fraudpoint.suspicious_activity_index | ||
| fraudpoint.synthetic_identity_index | ||
| fraudpoint.transaction_status | ||
| fraudpoint.vulnerable_victim_index | ||
| integration_hub_results | ||
| org_id | ||
| policy | ||
| policy_details_api | ||
| policy_engine_version | ||
| policy_score | ||
| primary_industry | ||
| reason_code | ||
| request_duration | ||
| request_id | ||
| request_result | ||
| review_status | ||
| risk_rating | ||
| secondary_industry | ||
| service_type | ||
| session_id | ||
| session_id_query_count | ||
| summary_risk_score | ||
| tmx_reason_code | ||
| tmx_risk_rating | ||
| tmx_summary_reason_code | ||
| tmx_variables | ||
| tps_datetime | ||
| tps_duration | ||
| tps_error | ||
| tps_result | ||
| tps_type | ||
| tps_vendor | ||
| tps_was_timeout | ||
| unknown_session | ||
| ] | ||
|
|
||
| # @param [Hash] body | ||
| def self.redact(hash) | ||
| filtered_response_h = hash.slice(*ALLOWED_RESPONSE_FIELDS) | ||
| unfiltered_keys = hash.keys - filtered_response_h.keys | ||
| unfiltered_keys.each do |key| | ||
| filtered_response_h[key] = '[redacted]' | ||
| end | ||
| filtered_response_h | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| { | ||
| "error_detail": "service_type", | ||
| "request_id":"1234-abcd", | ||
| "request_result":"fail_invalid_parameter" | ||
| "request_result":"fail_invalid_parameter", | ||
| "review_status":"REVIEW_STATUS" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "request_id": "1234", | ||
| "request_result": "success", | ||
| "review_status": "pass", | ||
| "risk_rating": "trusted", | ||
| "summary_risk_score": "-6", | ||
| "tmx_risk_rating": "neutral", | ||
| "fraudpoint.score": "500", | ||
| "first_name": "[redacted]" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,5 +5,6 @@ | |
| "risk_rating": "trusted", | ||
| "summary_risk_score": "-6", | ||
| "tmx_risk_rating": "neutral", | ||
| "fraudpoint.score": "500" | ||
| "fraudpoint.score": "500", | ||
| "first_name": "WARNING! YOU SHOULD NEVER SEE THIS PII FIELD IN THE LOGS" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a nice way to test!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. if you have suggestions on how to make that message more clear they are welcome. essentially if we see that in our log files we know there is a bug and we'll simply assume that successful responses always contain PII fields |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do we pass back the alerts for AAMVA, InstantVerify? Is it in this structure?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
callback_log_data.result[:context][:stages][:resolution and :state_id...