2014年7月20日日曜日

Pattern-Oriented Software Architectures: Programming Mobile Services for Android Handheld Systems (Week 7)

==== Lecture ====
Section 2 Module 3 Part 6: Avoid Conditional Logic in Secure Pathways (5:51)
条件判定は間違いやすい。なるべく使わない様にする。分かり難いかもしれない。
APIのlevelの意味がuserに明らかとは限らない。
条件判定をやめて二つのmethodに分ける。testも簡単になる。
userが間違い難いようなAPIの名前を使う。レビューする時も分かりやすくなる。
更によくできる??

Section 2 Module 3 Part 7: Prevent Secure Pathways from Being Broken at Runtime (5:48)
セキュリティ関連を設定で変更できるようになっていると危ない。
handlerの参照がmutableな変数になっていてruntimeで書き換えられるなど。
べた書きにしてcompile-timeにhandlerを固定する。
modularityとの妥協も必要。

Section 2 Module 3 Part 8: Privilege Escalation Concepts (5:51)
Malwareからの他のAppのServiceにアクセスされて問題が起きる事が多い。
権限の無いAppから権限の持っているServiceを不当に使用されてしまう。
intent base service

Section 2 Module 3 Part 9: Privilege Escalation Scenarios (4:08)
Malware自体にはinternetアクセスのpermissionが無いので安全に見える。
他のAppのintent serciveを使ってinternetにアクセス出来てしまう場合がある。
他のAppと話すAppを作るときは注意が必要。
Androidのpermission modelをbreakしてしまう。

Section 2 Module 3 Part 10: Privilege Escalation Code Walkthrough (6:23)
他のActivityやAppと話すServiceは危ない。
何もチェックせずにintentを実行するのが危ない。privilege escalation問題。
?? privateのstorageに入れれば他のappからはアクセスできないのでは??

Section 2 Module 3 Part 11: Privilege Escalation Fixes (7:19)
callerのpermissionを確認する手段が用意されている。
manifestにcallerに必要なpermissionを記載できる。持っていなかったらexception。
callerに自分の持っているpermissionと同様のpermissionを要求すべき。

Section 2 Module 3 Part 12: User Interface Attacks (8:46)
Malwareはprocessが違うので直接state(memory)を書き換える事は出来ない。
MalwareはUserにtrickを使って不適切な操作をさせようとする。
fake message, fake UI。fishing似ている。
mobileは画面が小さいのでユーザは重要なインジケータを見落としやすい。
例えばurlも途中までしか見えないので、隠れたところまで見ると予想外のアドレスかもしれない。
さらにアドレスバーを非表示にしている場合は別なurlになっていても気が付かないかも。
ユーザのsecurity decisionに必要な情報は隠さないで表示すべき。
?? 画面が小さくても??

Section 2 Module 3 Part 13: Cross-platform User Interface Attacks (4:26)
PCとmobile端末両方にmalwareが入ってしまうと更に複雑な悪行が出来てしまう。
最初にPCが何らかの理由でmalwareに感染する。
ユーザがPCから銀行のWebにアクセスした際にmalwareがmobileにappのインストールを要求。
ユーザが騙されてmobileにappをインストール。
ユーザが送金をする際にmalwareが自分の口座に送金する様な動作をする。
本人認証のために銀行からmobileに確認messageが行くが、これがmoblie側のmalwareで改竄されてしまう。
PCとmobile端末両方を連携させることで本人認証も働くなってしまう。

==== Quiz ====
1回目:22/25
2回目:25/25

==== Assignment ====
[Week-7-Assignment-6]
It is no problem to use Android 4.3 emulator only. 4.0 is not required.
Whether the issues are fixed can be checked with the provided checker app.
There is 5 issues.
I should review the code to find the issues and answer the Quiz on the link.
Next, I fix the issues and check them by the checker app.
This assignment is different from the previous assignments.
The instructor is different and the topic of this is about not concurrency but security.
The only AndroidManifest.xml and LoginActivity.java are necessary to be fixed.
The pdf below is slides for this assignment.
https://d396qusza40orc.cloudfront.net/posa/2014-PDFs/android_security_code_v2.pdf

How to install the checker APP.
cd c:\Users\com\Develop\adt-bundle-windows-x86_64-20140321\sdk\platform-tools
adb install c:\Users\com\Documents\hiroshi\test\Coursera\posa-002\git\POSA-14\POSA-14\assignments\week-7-assignment-6\W7-A6-VulnCheck.apk

I can check the login and sound vulnerabilites on Andriod 4.3.
I can not check the vulnerability of location but it is not the requirement of this assignment.

How to check the result of the quiz
https://class.coursera.org/posa-002/quiz?quiz_type=homework

[Evaluation]
Everyone added the permission to the manifest and left intent-filter remained just like I did.
Everyone passed the vulnerability checker as always.

Self
The permission of Record Sound is added to fix AndroidManifest.xml
The parameter, MAX_SECURITY is changed to StorageUtilities.SECURITY_PRIVATE to fix LoginActivity.java.

S1
The value of MAX_SECURITY is changed to StorageUtilities.SECURITY_PRIVATE.

S2
The value of MAX_SECURITY is changed to StorageUtilities.SECURITY_PRIVATE.

S3
The way to fix is the same as mine.

S4
The value of MAX_SECURITY is changed to StorageUtilities.SECURITY_PRIVATE.

S5
The way to fix is the same as mine.

[Results]
I've got 6 points (100%).

==== Etc ====
今週のLectureは50分程度で少な目。
Quizも8問と少ない。
Securityの話のみ。

#cousera #posa-002 Secure Cordingの観点に開発者のミスを防ぐこと、ミスした場合に安全サイドに倒れる事があり、これはセキュリティ以外の開発にも応用できる。
抽象化や柔軟性によって安全性が低下する可能性がある。安全性の観点が必要。

[Eclipse]
It is better to use AVD 4.4.2 on Intel Atom because it can be use the hardware accelerator.

==== log ====
2014/06/22 00:10 準備
2014/06/23 00:10 Lecture
2014/06/24 00:50 Lecture
2014/06/24 00:20 Quiz
2014/07/05 02:30 Assignments
2014/07/06 02:00 Assignments
2014/07/12 01:30 Evaluation

0 件のコメント:

コメントを投稿