2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
ネットワーク セキュリティのおすすめの方法
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このセクションでは、Android デバイスからのネットワーク通信のセキュリティを確保するためのおすすめの方法を説明します。
リスニング ソケットの保護
リスニング ソケットは慎重に使用してください。通常、デバイスにはオープンなリスニング ソケットがありません。これは、そのようなソケットが遠隔からの攻撃者にとってはデバイスへのアクセス経路となるためです。
- 特に起動時やデフォルトでは Android デバイスが公開しているインターネット リスニング ソケットの数は最小限とします。起動時にはデフォルトでインターネット上でリッスンしているソケットがないようにしてください。
- root プロセス、およびシステム固有識別子(UID)のプロセスでリスニング ソケットを公開するべきではありません。
- リスニング ソケットは OTA アップデートがなくても無効にできる必要があります。これを行うには、サーバーまたはユーザー デバイスの構成を変更します。
- ローカルの IPC を使ったソケットでは、アプリは特定のグループにアクセスを限定した UNIX ドメインのソケットを使用する必要があります。IPC 用のファイル記述子を作成し、特定の UNIX グループに対して +RW にします。すべてのクライアント アプリはその UNIX グループに属している必要があります。
- 無線通信やモデムがアプリのプロセッサとは別になっているような、複数のプロセッサを搭載したデバイスではプロセッサ間の通信にネットワーク ソケットを利用するものもあります。そのような場合、プロセッサ間の通信に利用されるネットワーク ソケットでは分離したネットワーク インターフェースを使い、デバイス上の権限のないアプリによるアクセスを防ぎます(iptables を使用して、デバイス上の他のアプリによるアクセスを防ぎます)。
- リスニング ポートを処理するデーモンは、不正な形式のデータに対して堅牢である必要があります。許可されていないクライアントと、可能であれば許可されたクライアントを使用して、ポートに対してファズテストを行います。クラッシュ時のフォローアップのバグを報告します。
Android 互換性テストスイート(CTS)には、オープンになっているリスニング ポートの存在を確認するテストが含まれます。
adb を無効にする
Android Debug Bridge(adb)は重要な開発およびデバッグ用ツールですが、管理された安全な環境で使用することが想定されていますので、通常の使用時には有効にしないでください。
- adb がデフォルトで無効になっていることを確認します。
- 接続を承認する前に、ユーザーが adb をオンにする必要があることを確認します。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 UTC。"],[],[],null,["# Network security best practices\n\nThis section contains recommendations to ensure the security of network\ncommunications from Android devices.\n\nSecure listening sockets\n------------------------\n\nUse listening sockets with caution. There should generally\nnot be any open listening sockets on devices as these provide a vector for a\nremote attacker to gain access to the device.\n\n- Android devices should minimize the number of internet listening sockets they expose, especially on boot or by default. No socket should be listening on the internet at boot by default.\n - Root processes and processes owned by the system unique identifier (UID) shouldn't expose any listening sockets.\n- Listening sockets must be able to be disabled without an OTA update. This can be performed using either a server or user-device configuration change.\n- For local IPC-using sockets, apps must use a UNIX domain socket with access limited to a group. Create a file descriptor for the IPC and make it +RW for a specific UNIX group. Any client apps must be within that UNIX group.\n- Some devices with multiple processors (for example, a radio/modem separate from the app processor) use network sockets to communicate between processors. In such instances, the network socket used for inter-processor communication must use an isolated network interface to prevent access by unauthorized apps on the device (i.e. use iptables to prevent access by other apps on the device).\n- Daemons that handle listening ports must be robust against malformed data. You should conduct fuzz-testing against the port using an unauthorized client, and, where possible, authorized client. File bugs to follow up on crashes.\n\nThe [Android Compatibility Test Suite](/docs/core/tests)\n(CTS) includes tests that check for the presence of open listening ports.\n\n### Disable adb\n\nAndroid Debug Bridge (adb) is a valuable development and debugging tool, but\nis designed for use in a controlled, secure environment and shouldn't be\nenabled for general use.\n\n- Ensure that adb is disabled by default.\n- Ensure that adb requires the user to turn it on before accepting connections."]]