Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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.9k
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
3
2.4k
Java 21 Overview
line_developers
6
1.2k
Code Review Challenge: An example of a solution
line_developers
1
1.5k
KARTEのAPIサーバ化
line_developers
1
580
著作権とは何か?〜初歩的概念から権利利用法、侵害要件まで
line_developers
5
2.2k
生成AIと著作権 〜生成AIによって生じる著作権関連の課題と対処
line_developers
3
2.2k
マイクロサービスにおけるBFFアーキテクチャでのモジュラモノリスの導入
line_developers
9
3.7k
A/B Testing at LINE NEWS
line_developers
3
1k
LINEのサポートバージョンの考え方
line_developers
2
1.4k
Other Decks in Technology
See All in Technology
法人支出管理領域におけるソフトウェアアーキテクチャに基づいたテスト戦略の実践
ogugu9
1
140
技術以外の世界に『越境』しエンジニアとして進化を遂げる 〜Kotlinへの愛とDevHRとしての挑戦を添えて〜
subroh0508
1
160
HIG学習用スライド
yuukiw00w
0
110
形式手法特論:CEGAR を用いたモデル検査の状態空間削減 #kernelvm / Kernel VM Study Hokuriku Part 8
ytaka23
2
250
Security Diaries of an Open Source IAM
ahus1
0
120
日本Rubyの会の構造と実行とあと何か / hokurikurk01
takahashim
4
570
AI (LLM) を活用する上で必須級のMCPをAmazon Q Developerで学ぼう / 20251127 Ikuma Yamashita
shift_evolve
PRO
2
100
生成AI・AIエージェント時代、データサイエンティストは何をする人なのか?そして、今学生であるあなたは何を学ぶべきか?
kuri8ive
2
1.9k
AI時代の開発フローとともに気を付けたいこと
kkamegawa
0
390
手動から自動へ、そしてその先へ
moritamasami
0
200
履歴テーブル、今回はこう作りました 〜 Delegated Types編 〜 / How We Built Our History Table This Time — With Delegated Types
moznion
16
9.5k
Claude Code はじめてガイド -1時間で学べるAI駆動開発の基本と実践-
oikon48
43
26k
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Embracing the Ebb and Flow
colly
88
4.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
A Tale of Four Properties
chriscoyier
162
23k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
How to Ace a Technical Interview
jacobian
280
24k
Building an army of robots
kneath
306
46k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
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