Skip to content
New issue

transmission_risk_levelの値について #14

Open
zaruudon opened this issue on Nov 24, 2020 · 3 comments

Comments

@zaruudon

現在通知サーバーから配信されているファイルではtransmission_risk_levelに0が設定されていますが、
AndroidではtransmissionRiskScoreがExposureConfigurationに従って設定されるのはtransmission_risk_levelが1~8の場合であり、
0だった場合はtransmissionRiskScoreには1が入るようになっているようです。
https://github.com/google/exposure-notifications-internals/blob/7dadb83aa5c4b02ed4ae98cd8cf13f89b96962d2/exposurenotification/src/main/java/com/google/samples/exposurenotification/matching/RiskScoreCalculator.java#L69-L72

transmissionRiskScoreが1のときにriskScoreがminimumRiskScore以上になることはないので、
transmission_risk_levelが0だと、現在のAndroid版では接触が検知されることはないと思われます。

@zaruudon
Author

zaruudon commented on Dec 8, 2020

以下の方法でOSにキーの一致を検出させることができましたが、アプリでは検知されませんでした。
https://gist.github.com/zaruudon/5d01b848e50d5a63df50479e27b0df9d

動作情報には以下のような出力がありました。

2020/12/09 06:28:21,Info,Start,ExposureDetectedAsync
2020/12/09 06:28:21,Info,ExposureSummary.MatchedKeyCount: 1,ExposureDetectedAsync
2020/12/09 06:28:21,Info,ExposureSummary.DaysSinceLastExposure: 7,ExposureDetectedAsync
2020/12/09 06:28:21,Info,ExposureSummary.HighestRiskScore: 0,ExposureDetectedAsync
2020/12/09 06:28:21,Info,"ExposureSummary.AttenuationDurations: 00:27:00,00:00:00,00:00:00",ExposureDetectedAsync
2020/12/09 06:28:21,Info,ExposureSummary.SummationRiskScore: 0,ExposureDetectedAsync
2020/12/09 06:28:21,Info,Start,GetConfigurationAsync
2020/12/09 06:28:21,Info,Get configuration from config,GetConfigurationAsync
2020/12/09 06:28:21,Info,"configuration: { ""MinimumRiskScore"": 21, ""AttenuationWeight"": 50, ""TransmissionWeight"": 50, ""DurationWeight"": 50, ""DaysSinceLastExposureWeight"": 50, ""TransmissionRiskScores"": [ 7, 7, 7, 7, 7, 7, 7, 7 ], ""AttenuationScores"": [ 1, 2, 3, 4, 5, 6, 7, 8 ], ""DurationScores"": [ 0, 0, 0, 0, 1, 1, 1, 1 ], ""DaysSinceLastExposureScores"": [ 1, 1, 1, 1, 1, 1, 1, 1 ], ""DurationAtAttenuationThresholds"": [ 50, 70 ]}",GetConfigurationAsync
2020/12/09 06:28:21,Info,End,GetConfigurationAsync
2020/12/09 06:28:21,Info,Save ExposureSummary. MatchedKeyCount: 1,ExposureDetectedAsync
2020/12/09 06:28:21,Info,Save ExposureInformation. Count: 0,ExposureDetectedAsync

AttenuationDurationsによればAttenuationが50dB以下で27分接触したということなので正しく判定されていないことがわかりますが、
HighestRiskScoreはMinimumRiskScore未満であるため0で上書きされており、元の値はわかりません。
そこでmitmproxyを使ってConfigration.jsonをMinimumRiskScoreを1にしたものに差し替えたところ、アプリで検知されました。HighestRiskScoreは4でした。

2020/12/09 06:39:03,Info,Start,ExposureDetectedAsync
2020/12/09 06:39:03,Info,ExposureSummary.MatchedKeyCount: 1,ExposureDetectedAsync
2020/12/09 06:39:03,Info,ExposureSummary.DaysSinceLastExposure: 7,ExposureDetectedAsync
2020/12/09 06:39:03,Info,ExposureSummary.HighestRiskScore: 4,ExposureDetectedAsync
2020/12/09 06:39:03,Info,"ExposureSummary.AttenuationDurations: 00:27:00,00:00:00,00:00:00",ExposureDetectedAsync
2020/12/09 06:39:03,Info,ExposureSummary.SummationRiskScore: 4,ExposureDetectedAsync
2020/12/09 06:39:03,Info,Start,GetConfigurationAsync
2020/12/09 06:39:03,Info,Get configuration from config,GetConfigurationAsync
2020/12/09 06:39:03,Info,"configuration: { ""MinimumRiskScore"": 1, ""AttenuationWeight"": 50, ""TransmissionWeight"": 50, ""DurationWeight"": 50, ""DaysSinceLastExposureWeight"": 50, ""TransmissionRiskScores"": [ 7, 7, 7, 7, 7, 7, 7, 7 ], ""AttenuationScores"": [ 1, 2, 3, 4, 5, 6, 7, 8 ], ""DurationScores"": [ 0, 0, 0, 0, 1, 1, 1, 1 ], ""DaysSinceLastExposureScores"": [ 1, 1, 1, 1, 1, 1, 1, 1 ], ""DurationAtAttenuationThresholds"": [ 50, 70 ]}",GetConfigurationAsync
2020/12/09 06:39:03,Info,End,GetConfigurationAsync
2020/12/09 06:39:03,Info,ExposureInfo: 1,ExposureDetectedAsync
2020/12/09 06:39:03,Info,Exposure.Timestamp: 2020/12/01 0:00:00,ExposureDetectedAsync
2020/12/09 06:39:03,Info,Exposure.Duration: 00:30:00,ExposureDetectedAsync
2020/12/09 06:39:03,Info,Exposure.AttenuationValue: 44,ExposureDetectedAsync
2020/12/09 06:39:03,Info,Exposure.TotalRiskScore: 4,ExposureDetectedAsync
2020/12/09 06:39:03,Info,Exposure.TransmissionRiskLevel: Invalid,ExposureDetectedAsync
2020/12/09 06:39:03,Info,Save ExposureSummary. MatchedKeyCount: 1,ExposureDetectedAsync
2020/12/09 06:39:03,Info,Save ExposureInformation. Count: 1,ExposureDetectedAsync

@kvaluation

@zaruudon さん 分析とデータをありがとうございます。通知サーバーに登録される診断キーTEKのtransmission_risk_levelno
設定値が0だと、ExposureConfigurationのTransmissionRiskScoresの初期値7が1に上書きされてしまう、ということをやっと理解できました。

解決策として

案1 診断キーのtransmission_risk_level を1にする。

案2 ExposureNotificationHandler.csについて

 MinimumRiskScore = 3, //必須
 TransmissionRiskScores = new int[] { 1, 1, 1, 1, 1, 1, 1, 1 }, //可読性のため

とする

の2案、思いついたのですが、どのような解決策が良いか、ご知見を賜れましたら幸いです。

(参考)リスク評価部分は正しいと確認しようとして、zaruudon さんのこの分析でその方針の誤りを発見する過程
https://twitter.com/info_kvaluation/status/1356957108873252864

@zaruudon
Author

zaruudon commented 16 hours ago

transmission_risk_levelは使っていなければ無視するという意図だと思うので、そうであればtransmission_risk_levelは変えずにConfigration.jsonを変更するのがよさそうです。
しかし、APIの仕様にはそのようなことは全く書かれていないので、Googleに確認をとる必要があるということになるのではないかと思います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants