Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Google IO 2019 recap Security
Search
LINE Developers
May 22, 2019
Technology
1
1.8k
Google IO 2019 recap Security
Google I/O 2019 Recap at LINE
コキチーズ
LINE Developers
May 22, 2019
Tweet
Share
More Decks by LINE Developers
See All by LINE Developers
LINEスタンプのSREing事例集:大きなスパイクアクセスを捌くためのSREing
line_developers
1
2.3k
Java 21 Overview
line_developers
6
1.2k
Code Review Challenge: An example of a solution
line_developers
1
1.3k
KARTEのAPIサーバ化
line_developers
1
530
著作権とは何か?〜初歩的概念から権利利用法、侵害要件まで
line_developers
5
2.2k
生成AIと著作権 〜生成AIによって生じる著作権関連の課題と対処
line_developers
3
2.1k
マイクロサービスにおけるBFFアーキテクチャでのモジュラモノリスの導入
line_developers
9
3.5k
A/B Testing at LINE NEWS
line_developers
3
970
LINEのサポートバージョンの考え方
line_developers
2
1.3k
Other Decks in Technology
See All in Technology
低レイヤを知りたいPHPerのためのCコンパイラ作成入門 完全版 / Building a C Compiler for PHPers Who Want to Dive into Low-Level Programming - Expanded
tomzoh
4
3.3k
OpenHands🤲にContributeしてみた
kotauchisunsun
1
480
Fabric + Databricks 2025.6 の最新情報ピックアップ
ryomaru0825
1
150
Witchcraft for Memory
pocke
1
600
あなたの声を届けよう! 女性エンジニア登壇の意義とアウトプット実践ガイド #wttjp / Call for Your Voice
kondoyuko
4
480
Liquid Glass革新とSwiftUI/UIKit進化
fumiyasac0921
0
270
Node-REDのFunctionノードでMCPサーバーの実装を試してみた / Node-RED × MCP 勉強会 vol.1
you
PRO
0
120
2025-06-26_Lightning_Talk_for_Lightning_Talks
_hashimo2
2
100
使いたいMCPサーバーはWeb APIをラップして自分で作る #QiitaBash
bengo4com
0
990
AIの最新技術&テーマをつまんで紹介&フリートークするシリーズ #1 量子機械学習の入門
tkhresk
0
140
mrubyと micro-ROSが繋ぐロボットの世界
kishima
2
360
生成AI時代の開発組織・技術・プロセス 〜 ログラスの挑戦と考察 〜
itohiro73
1
330
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
524
40k
Six Lessons from altMBA
skipperchong
28
3.9k
Building Applications with DynamoDB
mza
95
6.5k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Automating Front-end Workflow
addyosmani
1370
200k
Scaling GitHub
holman
459
140k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
710
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
The World Runs on Bad Software
bkeepers
PRO
69
11k
A better future with KSS
kneath
239
17k
4 Signs Your Business is Dying
shpigford
184
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Transcript
Google I/O 2019 recap Security コキチーズ@k2wanko Google I/O 2019 Recap
at LINE Slideは DarkTheme セキュリティエンジニア
コキチーズ@k2wanko セキュリティエンジニア 会社のサービスの脆弱性探したり Bug Bountyを運営したりしてる WebとAndroidとGoとGCPとFirebaseとかが好き Splatoon 2のウデマエはX2300~2500くらい PUBGも好きです。
今年は セキュリティとプライバシーを 強調していた (とコキチーズは思った)
Incognito mode
Incognito mode
Android
Platform - Encryption - Qからはハードウェアアクセラレーションがサポートされないデバイスでも ストレージを暗号化する - Adiantumで遅くならないようにしてる - TLS1.3がデフォルトで有効
- Project Mainline - OSのコンポーネントのいくつかを Play Storeから配信するプロジェクト - WebViewとは違って、もっと低レイヤーのコンポーネントのアップデートが可能になる - Hardening - ソフトウェアコーデックの Sandbox - アドレス空間のランダム化 (ASLR) - https://security.googleblog.com/2019/05/queue-hardening-enhancements.html - App Signing by Google Play - 弱い暗号鍵はGoogleが強い暗号鍵にして署名してくれるようになる
Privacy Checklist https://developer.android.com/preview/privacy/checklist - Scoped storage - More user control
over location permissions - Background activity starts - Non-resettable hardware identifiers - Permission for wireless scanning
Scoped storage - /sdcard へのアクセスを制限 - getExternalFilesDir() で読み書きは変わらない ただし、他のアプリが作成したファイルにはアクセスできなくなる -
他のアプリが作ったファイルへのアクセスはDocumentProviderを使う - 写真、音声、動画は MediaStoreからアクセスする - EXIFへのアクセスにはACCESS_MEDIA_LOCATIONが必要
More user control over location permissions - バックグラウンドで位置情報を取得する場合の権限が分離 - ユーザーが選べるようになった
<manifest> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> </manifest>
None
Jetpack Security - セキュリティのベストプラクティスに従って 暗号化の処理ができるライブラリ - SharedPreferenceの暗号化などに使える - Android 6.0以上をサポート
使えるAPI - EncryptedFile - EncryptedSharedPreferences
EncryptedFile String masterKeyAlias = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC ); File file = new
File(context.getFilesDir(), "secret_data"); // write to the encrypted file EncryptedFile encryptedFile = EncryptedFile.Builder(file, context, masterKeyAlias, EncryptedFile.FileEncryptionScheme .AES256_GCM_HKDF_4KB ).build(); // read the encrypted file FileOutputStream encryptedOutputStream = encryptedFile.openFileOutput (); FileInputStream encryptedInputStream = encryptedFile.openFileInput();
EncryptedSharedPreferences String masterKeyAlias = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC ); // use the shared
preferences and editor as you normally would SharedPreferences sharedPreferences = EncryptedSharedPreferences .create("secret_shared_prefs" , masterKeyAlias, context, EncryptedSharedPreferences .PrefKeyEncryptionScheme .AES256_SIV, EncryptedSharedPreferences .PrefValueEncryptionScheme .AES256_GCM); SharedPreferences .Editor editor = sharedPreferences .edit();
Web
Google Vulnerability Reward Program payputs in 2018 - Googleに報告される脆弱性の半分はWebの脆弱性
Content Security Policy (CSP) - サイトが読み込めるリソースをホワイトリストできめ細やかに設定できる - Response Headerに「Content-Security-Policy: <policy>」と書くと有効にできる。
- 「Content-Security-Policy-Report-Only」でリソースを実際にブロックせず エラーだけ確認することもできる。
nonce & strict-dynamic based CSP - Googleは nonceとstrict-dynamicを使ったCSPを推奨している - nonceはランダムな値
Content-Security-Policy: script-src ‘nonce-random123’ - nonce属性が一致しない場合は実行されない <script>alert(‘xss’)</script> // block! <script nonce=”random123”>alert(‘this is fine!’)</script> // run
nonce & strict-dynamic based CSP - strict-dynamicがある場合は nonceで許可されたscriptが動的にリソースを読み込むことを許可する Content-Security-Policy: script-src
‘nonce-random123’ ‘strict-dynamic’; <script nonce=”random123”> var s = document.createElement('script') s.src = '/path/to/script.js' ✔ document.head.appendChild(s) </script>
CSP hashes - 静的ファイルの場合はハッシュを埋め込んで許可することもできる Content-Security-Policy: script-src ‘sha256-...’ ‘strict-dynamic’;
Detailed guide https://csp.withgoogle.com/docs/index.html
CSPが安全か確認するツール https://csp-evaluator.withgoogle.com/
Trusted Type - CSPでは防げないDOM Based XSSを防ぐためのAPI - innerHTMLやlocation.hrefなど危険なAPIに値を入れるときは stringではなく信頼できる型に変換して入力するようにする
TrustedTypeの作成 const templatePolicy = TrustedTypes.createPolicy('template', { createHTML: (templateId) => {
const tpl = templateId if (/^[0-9a-z-]$/.test(tpl)) { return `<link rel="stylesheet" href="./templates/${tpl}/style.css">` } throw new TypeError(); } }); const html = templatePolicy.createHTML(location.hash.match(/tplid=([^;&]*)/)[1]) // html instanceof TrustedHTML document.head.innerHTML += html
CSPでポリシーを制御 Content-Security-Policy: trusted-types template
Trusted Typeのpolyfilled https://github.com/WICG/trusted-types
Fetch Metadata - ブラウザがリソースを取得する際にrequestに Metadataを付与する仕様 Sec-Fetch-Mode: no-cors Sec-Fetch-Site: same-origin
Cross-Origin-Opener-Policy - window.openの挙動についての仕様 - Cross-Origin-Opener-Policyヘッダーをつけて same originやsame siteに制限できる Cross-Origin-Opener-Policy: same-origin
No Security No Life @k2wanko