目次

NIST SP 800-204 日本語訳

英語タイトル : Security Strategies for Microservices-based Application Systems
日本語タイトル : マイクロサービスベースのアプリケーションシステムにおけるセキュリティ戦略
公開日 : 2019-08-07
原文URL : https://csrc.nist.gov/pubs/sp/800/204/final
翻訳編集 : 自動生成(有志による非公式の日本語訳), 原文取得日 : 2026-09-27, 訳文 : 448 / 448 ブロック

[要約] SP 800-204 は、マイクロサービスベースのアプリケーションシステムについて、マイクロサービス特有の脅威に対抗するセキュリティ戦略を示します。認証とアクセス管理、サービスディスカバリ、セキュア通信、監視、可用性、完全性保証などのコア機能の実装オプションと、API ゲートウェイやサービスメッシュの構成を分析します。技術的背景や設計原則、モノリシックアーキテクチャとの比較も整理し、アプリケーション全体のセキュリティプロファイルを強化することを目的とします。

NIST Special Publication 800-204

NIST 特別刊行物 800-204

Security Strategies for

〜のためのセキュリティ戦略

Microservices-based Application

マイクロサービスベースのアプリケーション

Systems

システム

Ramaswamy Chandramouli

Ramaswamy Chandramouli

This publication is available free of charge from: https://doi.org/10.6028/NIST.SP.800-204

本刊行物は以下より無料で入手可能です: https://doi.org/10.6028/NIST.SP.800-204

C O M P U T E R S E C U R I T Y

コンピュータセキュリティ

図表
[NIST logo — not reproduced on this unofficial site]

[NIST のロゴ。公的な標章のため、この非公式サイトには掲載していません。原本 PDF を参照してください。]

NIST Special Publication 800-204

NIST 特別刊行物 800-204

Security Strategies for

〜のためのセキュリティ戦略

Microservices-based Application

マイクロサービスベースのアプリケーション

Systems

システム

Ramaswamy Chandramouli Computer Security Division Information Technology Laboratory

Ramaswamy Chandramouli コンピュータセキュリティ部門 情報技術研究所

This publication is available free of charge from: https://doi.org/10.6028/NIST.SP.800-204

本出版物は以下より無料で入手可能です:https://doi.org/10.6028/NIST.SP.800-204

August 2019

2019年8月

図表
[U.S. Department of Commerce seal — not reproduced on this unofficial site]

[米国商務省の紋章。公的な標章のため、この非公式サイトには掲載していません。原本 PDF を参照してください。]

図表
[U.S. Department of Commerce seal — not reproduced on this unofficial site]

[米国商務省の紋章。公的な標章のため、この非公式サイトには掲載していません。原本 PDF を参照してください。]

U.S. Department of Commerce Wilbur L. Ross, Jr., Secretary

米国商務省 Wilbur L. Ross, Jr. 長官

National Institute of Standards and Technology

米国国立標準技術研究所

Walter Copan, NIST Director and Under Secretary of Commerce for Standards and Technology

Walter Copan、NIST所長兼標準・技術担当商務次官

Authority

法的根拠

This publication has been developed by NIST in accordance with its statutory responsibilities under the Federal Information Security Modernization Act (FISMA) of 2014, 44 U.S.C. § 3551 et seq., Public Law (P.L.) 113-283. NIST is responsible for developing information security standards and guidelines, including minimum requirements for federal information systems, but such standards and guidelines shall not apply to national security systems without the express approval of appropriate federal officials exercising policy authority over such systems. This guideline is consistent with the requirements of the Office of Management and Budget (OMB) Circular A-130.

本出版物は、2014年連邦情報セキュリティ近代化法(FISMA)、合衆国法典第44編第3551条以下、公法(P.L.)113-283に基づく法定責任に従ってNISTにより作成されました。NISTは、連邦情報システムに対する最低限の要件を含む情報セキュリティ基準およびガイドラインを策定する責任を負っていますが、そのような基準およびガイドラインは、当該システムに対して方針上の権限を行使する適切な連邦政府職員の明示的な承認がない限り、国家安全保障システムには適用されないものとします。本ガイドラインは、行政管理予算局(OMB)サーキュラーA-130の要件に準拠しています。

Nothing in this publication should be taken to contradict the standards and guidelines made mandatory and binding on federal agencies by the Secretary of Commerce under statutory authority. Nor should these guidelines be interpreted as altering or superseding the existing authorities of the Secretary of Commerce, Director of the OMB, or any other federal official. This publication may be used by nongovernmental organizations on a voluntary basis and is not subject to copyright in the United States. Attribution would, however, be appreciated by NIST.

本出版物のいかなる内容も、商務長官が法定権限に基づき連邦機関に対して義務付けかつ拘束力を持たせた基準およびガイドラインと矛盾するものと解釈されてはなりません。また、これらのガイドラインが、商務長官、OMB長官、またはその他の連邦政府職員の既存の権限を変更または差し替えるものと解釈されてもなりません。本出版物は、非政府組織によって自発的に使用される場合があり、米国内において著作権の対象とはなりません。ただし、NISTへの帰属表示がなされれば幸いです。

National Institute of Standards and Technology Special Publication 800-204 Natl. Inst. Stand. Technol. Spec. Publ. 800-204, 50 pages (August 2019) CODEN: NSPUE2

National Institute of Standards and Technology Special Publication 800-204 Natl. Inst. Stand. Technol. Spec. Publ. 800-204, 50 pages (August 2019) CODEN: NSPUE2

This publication is available free of charge from: https://doi.org/10.6028/NIST.SP.800-204

本出版物は、以下より無料で入手可能である:https://doi.org/10.6028/NIST.SP.800-204

Certain commercial entities, equipment, or materials may be identified in this document in order to describe an experimental procedure or concept adequately. Such identification is not intended to imply recommendation or endorsement by NIST, nor is it intended to imply that the entities, materials, or equipment are necessarily the best available for the purpose.

原本PDFの抜粋画像原本 PDF p.3 の画像抜粋

実験手順または概念を適切に説明するために、特定の営利企業、機器、または資材が本書に特定されている場合があります。このような特定は、NISTによる推奨または保証を意味するものではなく、またそれらの企業、資材、または機器がその目的に必ずしも最適であることを意味するものでもありません。

There may be references in this publication to other publications currently under development by NIST in accordance with its assigned statutory responsibilities. The information in this publication, including concepts and methodologies, may be used by federal agencies even before the completion of such companion publications. Thus, until each publication is completed, current requirements, guidelines, and procedures, where they exist, remain operative. For planning and transition purposes, federal agencies may wish to closely follow the development of these new publications by NIST.

本出版物には、割り当てられた法定責任に従ってNISTにより現在策定中である他の出版物への言及が含まれている場合があります。本出版物に含まれる情報(概念および方法論を含む)は、そうした関連出版物の完成前であっても連邦機関によって使用される場合があります。したがって、各出版物が完成するまでは、既存の要件、ガイドライン、および手順が存在する場合、それらは引き続き有効です。計画および移行の目的から、連邦機関はNISTによるこれらの新規出版物の策定状況を注視すべきです。

Organizations are encouraged to review all draft publications during public comment periods and provide feedback to NIST. Many NIST cybersecurity publications, other than the ones noted above, are available at https://csrc.nist.gov/publications.

組織は、パブリックコメント期間中にすべてのドラフト出版物をレビューし、NISTにフィードバックを提供するよう促されています。上記以外の多くのNISTサイバーセキュリティ関連出版物は、https://csrc.nist.gov/publications から入手可能です。

Comments on this publication may be submitted to:

本出版物へのコメントは、以下に提出することができる:

National Institute of Standards and Technology Attn: Computer Security Division, Information Technology Laboratory 100 Bureau Drive (Mail Stop 8930) Gaithersburg, MD 20899-8930 Email: sp800-204-comments@nist.gov

National Institute of Standards and Technology Attn: Computer Security Division, Information Technology Laboratory 100 Bureau Drive (Mail Stop 8930) Gaithersburg, MD 20899-8930 Email: sp800-204-comments@nist.gov

All comments are subject to release under the Freedom of Information Act (FOIA).

すべてのコメントは、情報自由法(FOIA)に基づき公開の対象となります。

Reports on Computer Systems Technology

コンピュータシステム技術に関する報告書

The Information Technology Laboratory (ITL) at the National Institute of Standards and Technology (NIST) promotes the U.S. economy and public welfare by providing technical leadership for the Nation’s measurement and standards infrastructure. ITL develops tests, test methods, reference data, proof of concept implementations, and technical analyses to advance the development and productive use of information technology. ITL’s responsibilities include the development of management, administrative, technical, and physical standards and guidelines for the cost-effective security and privacy of other than national security-related information in Federal information systems. The Special Publication 800-series reports on ITL’s research, guidelines, and outreach efforts in information system security, and its collaborative activities with industry, government, and academic organizations.

米国国立標準技術研究所(NIST)の情報技術研究所(ITL)は、国の測定および標準インフラストラクチャに対する技術的リーダーシップを提供することにより、米国経済と公共の福祉を促進しています。ITLは、情報技術の開発と生産的な利用を前進させるため、テスト、テスト方法、参照データ、概念実証の実装、および技術的分析を開発しています。ITLの責務には、連邦情報システムにおける国家安全保障関連以外の情報に対する費用対効果の高いセキュリティとプライバシーのための、管理的、行政的、技術的、および物理的な標準とガイドラインの開発が含まれます。Special Publication 800シリーズは、情報システムセキュリティにおけるITLの研究、ガイドライン、アウトリーチ活動、ならびに産業界、政府、学術機関との共同活動について報告しています。

Abstract

概要

Microservices architecture is increasingly being used to develop application systems since its smaller codebase facilitates faster code development, testing, and deployment as well as optimization of the platform based on the type of microservice, support for independent development teams, and the ability to scale each component independently. Microservices generally communicate with each other using Application Programming Interfaces (APIs), which requires several core features to support complex interactions between a substantial number of components. These core features include authentication and access management, service discovery, secure communication protocols, security monitoring, availability/resiliency improvement techniques (e.g., circuit breakers), load balancing and throttling, integrity assurance techniques during induction of new services, and handling of session persistence. Additionally, the core features could be bundled or packaged into architectural frameworks such as API gateways and service mesh. The purpose of this document is to analyze the multiple implementation options available for each individual core feature and configuration options in architectural frameworks, develop security strategies that counter threats specific to microservices, and enhance the overall security profile of the microservices-based application.

マイクロサービスアーキテクチャは、コードベースが小さいため、コードの開発、テスト、展開の迅速化に加えて、マイクロサービスのタイプに基づくプラットフォームの最適化、独立した開発チームのサポート、各コンポーネントを個別に拡張できる機能が促進されることから、アプリケーションシステムの開発にますます使用されるようになっています。マイクロサービスは通常、アプリケーションプログラミングインターフェース(API)を使用して相互に通信するため、多数のコンポーネント間の複雑な相互作用をサポートするためのいくつかのコア機能が必要となります。これらのコア機能には、認証およびアクセス管理、サービスディスカバリ、セキュア通信プロトコル、セキュリティ監視、可用性/耐障害性の向上技術(例:サーキットブレーカー)、ロードバランシングおよびスロットリング、新規サービスの導入時における完全性保証技術、ならびにセッション維持の処理が含まれます。さらに、これらのコア機能は、APIゲートウェイやサービスメッシュなどのアーキテクチャフレームワークにバンドルまたはパッケージ化することができます。本書の目的は、個々のコア機能に対して利用可能な複数の実装オプションおよびアーキテクチャフレームワークにおける構成オプションを分析し、マイクロサービス特有の脅威に対抗するセキュリティ戦略を策定し、マイクロサービスベースのアプリケーションの全体的なセキュリティプロファイルを強化することです。

Keywords

キーワード

microservices; load balancing; circuit breaker; Application Programming Interface (API); API gateway; service mesh; proxy.

マイクロサービス、ロードバランシング、サーキットブレーカー、アプリケーションプログラミングインターフェース(API)、APIゲートウェイ、サービスメッシュ、プロキシ。

Acknowledgements

謝辞

The author, Ramaswamy Chandramouli wishes to thank David Bohannon, Travis Biehn, John Tapp and Jamie Boote from Synopsys and Simon Moffatt of Forgerock for detailed comments on various topics. He also wishes to convey his thanks to Saa Edward Fillie of Wangoh Dynamics Technologies, Carlo de Guzman of DSD Laboratories, and Wei Lien Dang of StackRox. Special thanks to Doug McDorman of T-Mobile for valuable in-line comments and for providing additions to bibliography. Last but not the least, he expresses his thanks to Isabel Van Wyk of G2-Inc for her detailed editorial review.

著者のRamaswamy Chandramouliは、様々なトピックに関する詳細なコメントをいただいたSynopsysのDavid Bohannon氏、Travis Biehn氏、John Tapp氏、Jamie Boote氏、およびForgerockのSimon Moffatt氏に感謝の意を表します。また、Wangoh Dynamics TechnologiesのSaa Edward Fillie氏、DSD LaboratoriesのCarlo de Guzman氏、StackRoxのWei Lien Dang氏にも感謝の意を表します。貴重なインラインコメントをいただき、参考文献への追加情報をご提供いただいたT-MobileのDoug McDorman氏には特に感謝します。最後になりますが、詳細な編集レビューを行っていただいたG2-IncのIsabel Van Wyk氏に感謝の意を表します。

Patent Disclosure Notice

特許開示に関する通知

NOTICE: NIST’s Information Technology Laboratory (ITL) has requested that holders of patent claims whose use may be required for compliance with the guidance or requirements of this publication disclose such patent claims to ITL. However, holders of patents are not obligated to respond to ITL calls for patents and ITL has not undertaken a patent search in order to identify which, if any, patents may apply to this publication.

通知:NISTの情報技術研究所(ITL)は、本出版物のガイダンスまたは要件への準拠に使用が必要となる可能性のある特許クレームの保有者に対し、そのような特許クレームをITLに開示するよう要請しました。ただし、特許保有者には特許に関するITLの呼びかけに応じる義務はなく、ITLは本出版物に適用される可能性のある特許(もしあれば)を特定するための特許調査を実施していません。

As of the date of publication and following call(s) for the identification of patent claims whose use may be required for compliance with the guidance or requirements of this publication, no such patent claims have been identified to ITL.

発行日時点において、本出版物のガイダンスまたは要件への準拠に使用が必要となる可能性のある特許クレームの特定に関する呼びかけの後、そのような特許クレームはITLに対して特定されていません。

No representation is made or implied by ITL that licenses are not required to avoid patent infringement in the use of this publication.

本刊行物の使用にあたり、特許侵害を避けるためにライセンスが不要であることについて、ITLは一切の表明を行わず、また示唆もしません。

Executive Summary

エグゼクティブサマリー

The microservices paradigm is being increasingly used for designing and deploying large-scale application systems in both cloud-based and enterprise infrastructures. The resulting application system consists of relatively small, loosely coupled entities or components called microservices that communicate with each other using lightweight communication protocols.

マイクロサービスパラダイムは、クラウドベースおよびエンタープライズインフラストラクチャの両方において、大規模なアプリケーションシステムの設計および展開にますます使用されるようになっています。その結果として得られるアプリケーションシステムは、軽量な通信プロトコルを使用して相互に通信を行う、マイクロサービスと呼ばれる比較的小規模で疎結合なエンティティまたはコンポーネントで構成されます。

Incentives to design and deploy a microservices-based application system include: (a) agility in development due to relatively small and less complex codebases since each one typically implements a single business function; (b) independence among teams in the development process thanks to the loosely coupled nature of microservices; and (c) availability of deployment tools that provide infrastructure services such as authentication, access control, service discovery and communication, and load balancing.

マイクロサービスベースのアプリケーションシステムを設計および展開する動機としては、以下が挙げられます。(a) 各コードベースが通常は単一のビジネス機能を実装するため、比較的小規模かつ複雑さの少ないコードベースによる開発の俊敏性、(b) マイクロサービスの疎結合な性質による開発プロセスにおけるチーム間の独立性、および (c) 認証、アクセス制御、サービスディスカバリと通信、ロードバランシングなどのインフラストラクチャサービスを提供する展開ツールの利用可能性。

Despite several facilitating technologies (e.g., orchestration), there are many challenges to be addressed in the development and deployment of a microservices-based application. Network security, reliability, and latency are critical factors since every transaction implemented using this type of system will involve the transmission of messages across a network. Further, the presence of multiple microservices exposes a large attack surface.

いくつかの促進技術(オーケストレーションなど)があるにもかかわらず、マイクロサービスベースのアプリケーションの開発および展開においては対処すべき多くの課題が存在します。このタイプのシステムを使用して実装されたすべてのトランザクションにはネットワークを介したメッセージ送信が伴うため、ネットワークセキュリティ、信頼性、および遅延は極めて重要な要素です。さらに、複数のマイクロサービスの存在は広大な攻撃対象領域(アタックサーフェス)を露出させます。

The goal of this document is to outline strategies for the secure deployment of a microservices-based application by analyzing implementation options for state of practice core features, configuration options for architectural frameworks such as Application Programming Interface (API) gateway and service mesh, and countermeasures for microservices-specific threats.

本書の目的は、実践水準(state of practice)のコア機能の実装オプション、アプリケーションプログラミングインターフェース(API)ゲートウェイやサービスメッシュなどのアーキテクチャフレームワークの構成オプション、およびマイクロサービス固有の脅威に対する対策を分析することにより、マイクロサービスベースのアプリケーションを安全に展開するための戦略の概要を示すことです。

Table of Contents

目次

1 Introduction

1 はじめに

Application systems are increasingly developed and deployed using the microservices paradigm due to advantages such as agility, flexibility, scalability, and availability of tools for automating the underlying processes. However, the tremendous increase in the number of components in a microservices-based application system combined with complex network environments comprised of various interaction styles among components call for several core infrastructure features to be implemented either alone or bundled/packaged into architectural frameworks, such as Application Programming Interface (API) gateway and service mesh. The objective of this document is to perform an analysis of the implementation options for core features, configuration options for architectural frameworks, and countermeasures for microservice-specific threats and outline security strategies.

俊敏性、柔軟性、スケーラビリティ、そして基盤となるプロセスの自動化ツールの可用性といった利点により、マイクロサービスパラダイムを使用して開発および展開されるアプリケーションシステムが増加しています。しかし、マイクロサービスベースのアプリケーションシステムにおけるコンポーネント数の大幅な増加と、コンポーネント間の多様な相互作用スタイルで構成される複雑なネットワーク環境が組み合わさることで、いくつかのコアインフラ機能について、単体で実装するか、あるいはアプリケーションプログラミングインターフェース(API)ゲートウェイやサービスメッシュなどのアーキテクチャフレームワークにバンドル/パッケージ化して実装することが求められます。本書の目的は、コア機能の実装オプション、アーキテクチャフレームワークの構成オプション、およびマイクロサービス固有の脅威に対する対策の分析を実施し、セキュリティ戦略の概要を示すことです。

1.1 Scope

1.1 対象範囲

This document will not discuss the various tools used in the deployment of microservices-based application systems. Discussion of core features and architectural frameworks will be limited to highlighting issues relevant to secure implementation. The core focus is on the methodology to develop security strategies for microservices-based applications through the following three fundamental steps:

本書では、マイクロサービスベースのアプリケーションシステムの展開に使用される多様なツールについては論じない。コア機能およびアーキテクチャフレームワークの議論は、安全な実装に関連する問題の強調に限定します。主な焦点は、次の3つの基本ステップを通じてマイクロサービスベースのアプリケーションのセキュリティ戦略を策定する方法論にあります。

•Study of the technology behind microservices-based application systems focusing on design principles, basic building blocks, and associated infrastructure.

•設計原則、基本的なビルディングブロック、および関連するインフラに焦点を当てた、マイクロサービスベースのアプリケーションシステムの基盤となる技術の調査。

•Focused review of the threat background specific to the operating environment of microservices.

•マイクロサービスの運用環境に特有の脅威の背景に焦点を絞ったレビュー。

•Analysis of implementation options related to state of practice core features, configuration options related to architectural frameworks such as API gateway and service mesh and countermeasures for microservices-specific threats for developing security strategies.

•セキュリティ戦略を策定するための、実践水準(state of practice)のコア機能に関連する実装オプション、APIゲートウェイやサービスメッシュなどのアーキテクチャフレームワークに関連する構成オプション、およびマイクロサービス固有の脅威に対する対策の分析。

1.2 Audience

1.2 対象読者

The target audience for the security strategies discussed in this document includes:

本文書で論じるセキュリティ戦略の想定読者には、以下が含まれる:

•Chief Security Officer (CSO) or Chief Technology Officer (CTO) of an IT department in a private enterprise or government agency who wishes to develop enterprise infrastructures to host distributed systems based on microservices architecture; and

•マイクロサービスアーキテクチャに基づく分散システムをホストする企業インフラストラクチャの開発を望む、民間企業または政府機関のIT部門の最高セキュリティ責任者(CSO)または最高技術責任者(CTO)。

•Application architects who wish to design a microservices-based application system.

•マイクロサービスベースのアプリケーションシステムの設計を望むアプリケーションアーキテクト。

1.3 Relationship to other NIST Guidance Documents

1.3 他のNISTガイダンス文書との関係

This guidance document focuses on a class of application based on a specific architecture. However, since an essential architectural component—the microservice—can be implemented inside a container, the security guidance and recommendations related to application container technology may also serve as relevant security strategies for the application architecture discussed in this document. Such guidance includes:

本ガイダンス文書は、特定のアーキテクチャに基づくアプリケーションの一分類に焦点を当てています。ただし、アーキテクチャの不可欠な構成要素であるマイクロサービスは、コンテナ内に実装できるため、アプリケーションコンテナ技術に関するセキュリティガイダンスおよび推奨事項も、本書で論じるアプリケーションアーキテクチャのセキュリティ戦略として関連する場合があります。そのようなガイダンスには、次のものがあります。

•NIST Special Publication (SP) 800-190, Application Container Security Guide; and

•NIST Special Publication (SP) 800-190, Application Container Security Guide。

•NIST Interagency or Internal Report (NISTIR) 8176, Security Assurance Requirements for Linux Application Container Deployments.

•NIST Interagency or Internal Report (NISTIR) 8176, Security Assurance Requirements for Linux Application Container Deployments。

1.4 Methodology and Organization

1.4 方法論および構成

Since microservices-based application systems encompass diverse technologies (e.g., server virtualization, containers, cloud middleware), the focus here is on core features of this application class and the architectural frameworks that bundle or package them. The threat analysis approach involves taking a macro view of the entire deployment stack of microservices-based application systems and the layer at which these core features are located. The threats specific to those features are identified, and the overall approach for developing security strategies is to analyze the multiple implementations for core features and the architectural frameworks as well as ensure that those implementation options counter microservices-specific threats. The roadmap for the materials used in this methodology is as follows:

マイクロサービスベースのアプリケーションシステムは多様な技術(例: サーバー仮想化、コンテナ、クラウドミドルウェア)を包含するため、ここでは、このアプリケーション分類のコア機能と、それらを束ねるまたはパッケージ化するアーキテクチャフレームワークに焦点を当てます。脅威分析のアプローチでは、マイクロサービスベースのアプリケーションシステムの展開スタック全体と、これらのコア機能が位置するレイヤーを俯瞰的に捉えます。それらの機能に固有の脅威を特定し、セキュリティ戦略を策定する全体的なアプローチは、コア機能とアーキテクチャフレームワークの複数の実装を分析し、それらの実装オプションがマイクロサービス固有の脅威に対抗できることを確実にすることです。この方法論で用いる資料のロードマップは次のとおりです。

•Review of all state of practice core features that form the infrastructure for microservices (Sec. 2.6);

•マイクロサービスのインフラストラクチャを形成するすべての実践水準(state of practice)のコア機能のレビュー(Sec. 2.6);

•Review of the layers in the deployment stack, location of the core features in those layers, and identification of microservices-specific threats (Sec. 3);

•デプロイメントスタック内の層、それらの層におけるコア機能の配置、およびマイクロサービス特有の脅威の特定に関するレビュー(Sec. 3);

•Analysis of all different implementation options for these core features and outline security strategies based on these implementation options for core features (Sec. 4); and

•これらのコア機能に対するすべての異なる実装オプションの分析、およびコア機能のこれらの実装オプションに基づくセキュリティ戦略の概説(Sec. 4);および

•Review of all architectural frameworks that bundle several core features as a single product and outline security strategies based on configuration options for those frameworks (Sec. 5).

•複数のコア機能を単一の製品としてバンドルするすべてのアーキテクチャフレームワークのレビュー、およびそれらのフレームワークの構成オプションに基づくセキュリティ戦略の概説(Sec. 5)。

A slightly more detailed summarization of the contents of the various sections in this document is as follows:

本書の各セクションの内容に関するもう少し詳細な要約は以下のとおりです。

•Section 2 provides a high-level but expansive overview of microservices-based application systems, starting with a conceptual view followed by design principles, business drivers, building blocks, component interaction styles, state of practice core features, and architectural frameworks;

•Section 2では、概念的な視点から始まり、設計原則、ビジネス推進要因、ビルディングブロック、コンポーネント相互作用スタイル、実践水準(state of practice)のコア機能、およびアーキテクチャフレームワークへと続く、マイクロサービスベースのアプリケーションシステムの高レベルでありながら広範な概要を提供する;

•Section 3 provides a stack level view of the threat background and some threats that are specific to the microservices environment;

•Section 3では、脅威の背景に関するスタックレベルの視点と、マイクロサービス環境に特有のいくつかの脅威を提供する;

•Section 4 contains analysis information pertaining to various state of practice core features for supporting a microservices-based application and outlines the security strategies for implementing the core features based on analysis of implementation options; and

•Section 4には、マイクロサービスベースのアプリケーションをサポートするための様々な実践水準(state of practice)のコア機能に関する分析情報が含まれ、実装オプションの分析に基づいてコア機能を実装するためのセキュリティ戦略の概要が述べられる;および

•Section 5 contains analysis information pertaining to architectural frameworks that bundle core features needed in the infrastructure for microservices-based applications and outlines the security strategies for configuring the architectural frameworks.

•第5節には、マイクロサービスベースのアプリケーション用インフラストラクチャで必要とされるコア機能を束ねるアーキテクチャフレームワークに関する分析情報が含まれ、そのアーキテクチャフレームワークを構成するためのセキュリティ戦略の概要が述べられています。

2 Microservices-based Application Systems: Technology Background

2 マイクロサービスベースのアプリケーションシステム: 技術的背景

In this section, the technology behind the development and deployment of a microservices-based application system will be described using the underlying design drivers or principles, the artifacts that constitute the building blocks, and the different ways the building blocks can be configured to produce different deployment options. This is not meant to be a comprehensive description of the technology but provides sufficient information about components and concepts to facilitate the identification of security threats and the development of secure implementation strategies for a microservices-based application system.

本節では、マイクロサービスベースのアプリケーションシステムの開発および展開の背後にある技術について、基礎となる設計要因(ドライバ)や原則、構成要素となる成果物、および様々な展開オプションを生み出すために構成要素を構成する様々な方法を用いて説明します。これは技術の包括的な説明を意図したものではなく、マイクロサービスベースのアプリケーションシステムにおけるセキュリティ脅威の特定とセキュアな実装戦略の開発を促進するための、コンポーネントと概念に関する十分な情報を提供するものです。

2.1 Microservices: A Conceptual View

2.1 マイクロサービス:概念的視点

A microservices-based application system consists of multiple components (microservices) that communicate with each other through synchronous remote procedure calls or an asynchronous messaging system. Each microservice typically implements one (rarely more) distinct business process or functionality (e.g., storing customer details, storing and displaying a product catalog, customer order processing etc.). Each microservice is a mini-application that has its own business logic and various adapters for carrying out functions such as database access and messaging. Some microservices would expose a Representational State Transfer (REST)ful API [1] that is consumed by other microservices or by the application’s clients [2]. Other microservices might implement a web User Interface (UI). At runtime, a microservice instance may be configured to run as a process in an application server, in a virtual machine (VM), or in a container.

マイクロサービスベースのアプリケーションシステムは、同期リモートプロシージャコールまたは非同期メッセージングシステムを介して相互に通信する複数のコンポーネント(マイクロサービス)で構成されます。各マイクロサービスは通常、1つの(稀に複数の)異なるビジネスプロセスまたは機能(例:顧客詳細情報の保存、製品カタログの保存および表示、顧客注文処理など)を実装します。各マイクロサービスは、独自のビジネスロジックと、データベースアクセスやメッセージングなどの機能を実行するための様々なアダプターを備えたミニアプリケーションです。一部のマイクロサービスは、他のマイクロサービスやアプリケーションのクライアントによって利用されるRESTful(Representational State Transfer)API [1] を公開します [2]。その他のマイクロサービスは、Webユーザーインターフェース(UI)を実装する場合があります。実行時には、マイクロサービスインスタンスは、アプリケーションサーバー内のプロセス、仮想マシン(VM)、またはコンテナ内で実行されるように構成される場合があります。

Though a microservices-based application can be implemented purely as an enterprise application and not as a cloud service, it is often identified as a cloud-native application with a service-based architecture, application programming interface (API)-driven communications, container-based infrastructure, and a bias for DevOps (Combination of Development and Operations) processes such as continuous improvement, agile development, continuous delivery, and collaborative development among developers, quality assurance teams, security professionals, IT operations, and line-of-business stakeholders [3]. Part of the reason for this perspective is due to the fact that on-premises software development and deployment relies on a server-centric infrastructure with tightly integrated application modules rather than on loosely coupled, services-based architectures with API-based communications.

原本PDFの抜粋画像原本 PDF p.11 の画像抜粋

マイクロサービスベースのアプリケーションは、クラウドサービスとしてではなく純粋にエンタープライズアプリケーションとして実装することもできますが、多くの場合、サービスベースのアーキテクチャ、アプリケーションプログラミングインターフェース(API)主導の通信、コンテナベースのインフラストラクチャ、および開発者、品質保証チーム、セキュリティ専門家、IT運用、事業部門関係者の間での継続的改善、アジャイル開発、継続的デリバリー、協調開発といったDevOps(開発と運用の組み合わせ)プロセスへの志向を備えたクラウドネイティブアプリケーションとして認識されています [3]。このような見方がされる理由の一部は、オンプレミスのソフトウェア開発および展開が、APIベースの通信を伴う疎結合なサービスベースのアーキテクチャではなく、密に統合されたアプリケーションモジュールを備えたサーバー中心のインフラストラクチャに依存しているという事実に起因しています。

2.2 Microservices: Design Principles

2.2 マイクロサービス:設計原則

The design of a microservice is based on the following drivers [4]:

マイクロサービスの設計は、以下の推進要因に基づいている [4]:

•Each microservice must be managed, replicated, scaled, upgraded, and deployed independently of other microservices.

•各マイクロサービスは、他のマイクロサービスから独立して管理、複製、スケーリング、アップグレード、および展開されなければなりません。

•Each microservice must have a single function and operate in a bounded context (i.e., have limited responsibility and dependence on other services).

•各マイクロサービスは単一の機能を持ち、境界づけられたコンテキスト内で動作しなければなりません(すなわち、限定された責任と他のサービスへの依存性を持ちます)。

•All microservices should be designed for constant failure and recovery and must therefore be as stateless as possible.

•すべてのマイクロサービスは絶え間ない障害と回復を想定して設計されるべきであり、したがって可能な限りステートレスでなければなりません。

•One should reuse existing trusted services (e.g., databases, caches, directories) for state management.

•状態管理には、既存の信頼できるサービス(例: データベース、キャッシュ、ディレクトリ)を再利用すべきです。

These drivers, in turn, result in the following design principles for a microservice:

これらの推進要因は、結果としてマイクロサービスの以下の設計原則につながる:

•Autonomy,

•自律性、

•Loose coupling,

•疎結合、

•Re-use,

•再利用性、

•Composability,

•構成可能性(Composability)、

•Fault tolerance,

•フォールトトレランス(耐障害性)、

•Discoverability, and

•発見可能性、および

•APIs alignment with business processes.

•ビジネスプロセスとAPIの整合性。

2.3 Business Drivers

2.3 ビジネス要因

Though the business drivers for deployment of microservices-based application systems are only marginally related to the theme of this document, it is useful to identify and state those that are relevant from the point of view of user and organizational behavior [5]:

マイクロサービスベースのアプリケーションシステムを配備するビジネス上の推進要因は、本文書のテーマとはわずかに関連しているに過ぎないものの、ユーザーおよび組織の行動の観点から関連性のあるものを特定し述べることは有益である [5]:

•Ubiquitous access: users want access to applications from multiple client devices (e.g., browsers, mobile devices).

•ユビキタスアクセス:ユーザーは複数のクライアントデバイス(例:ブラウザ、モバイルデバイス)からアプリケーションへのアクセスを求めています。

•Scalability: applications must be highly scalable to maintain availability in the face of an increasing number of users and/or increased rate of usage from the existing user base.

•スケーラビリティ:ユーザー数の増加や既存のユーザーベースからの利用頻度の増加に直面しても可用性を維持するために、アプリケーションは高度にスケーラブルでなければなりません。

•Agile development: organizations want frequent updates to quickly respond to organizational (process and structural) changes and market demands.

•アジャイル開発:組織(プロセスおよび構造)の変更や市場の需要に迅速に対応するために、組織は頻繁な更新を求めています。

2.4 Building Blocks

2.4 構成要素

Microservices-based applications (e.g., distributed enterprise or web applications [1]) are built using an architectural style or design pattern that is not restricted to any specific technology and is comprised of small independent entities (end points) that communicate with each other using lightweight mechanisms. These end points are implemented using well-defined APIs. There are several types of API endpoints, such as Simple Object Access Protocol (SOAP) or REST ( Hypertext Transfer Protocol (HTTP) protocol). Each of the small independent entities provides a distinct business capability called a “service” and may have its own data store or repository. Access to these services is provided by various platforms or client types, such as web browsers or mobile devices, using a component called the “client.” Together, the component services and the client form the complete microservices-based application system. The services in such a system may be classified as:

マイクロサービスベースのアプリケーション(例:分散エンタープライズまたはWebアプリケーション [1])は、特定の技術に制限されず、軽量なメカニズムを使用して相互に通信する小規模で独立したエンティティ(エンドポイント)から構成されるアーキテクチャスタイルまたは設計パターンを使用して構築されます。これらのエンドポイントは明確に定義されたAPIを使用して実装されます。APIエンドポイントには、Simple Object Access Protocol(SOAP)やREST(Hypertext Transfer Protocol(HTTP)プロトコル)など、いくつかのタイプが存在します。小規模で独立したエンティティのそれぞれは「サービス」と呼ばれる個別のビジネス機能を提供し、独自のデータストアやリポジトリを持つ場合があります。これらのサービスへのアクセスは、「クライアント」と呼ばれるコンポーネントを使用して、Webブラウザやモバイルデバイスなどの様々なプラットフォームやクライアントタイプによって提供されます。構成要素であるサービスとクライアントが一体となって、完全なマイクロサービスベースのアプリケーションシステムを形成します。このようなシステムのサービスは、以下のように分類できる:

•Application-functionality services.

•アプリケーション機能サービス。

•Infrastructure services (called “core features” in this document) implemented either as stand-alone features or bundled into architectural frameworks (e.g., API gateway, service mesh). These include, but are not limited to, authentication and authorization, service registration and discovery, and security monitoring.

•インフラストラクチャサービス(本書では「コア機能」と呼びます)。単独の機能として実装されるか、アーキテクチャフレームワーク(例: APIゲートウェイ、サービスメッシュ)にまとめて組み込まれます。これには、認証と認可、サービスの登録とディスカバリー、セキュリティ監視が含まれますが、これらに限定されません。

In a microservices-based application system, each of the multiple, collaborative services can be built using different technologies. This promotes the concept of technical heterogeneity, which means that each service in a microservices-based application system may be written in a different programming language, development platform, or using different data storage technologies. This concept enables developers to choose the right tool or language depending on the type of service. Thus, in a single microservices-based application system, the constituting services may be built using different languages (e.g., Ruby, Golang, Java) and may be hosting different stores (e.g., document datastore, graphical Database (DB), or multimedia DB). Each component service is developed by a team–a microservice or DevOps team—which provides all of the development and operational requirements for that service with a high degree of autonomy regarding development and deployment techniques so long as the service functionality or service contract is agreed upon [6].

マイクロサービスベースのアプリケーションシステムでは、協調する複数のサービスのそれぞれを、異なる技術で構築できます。これは技術的異種混在(technical heterogeneity)の概念を促進します。すなわち、マイクロサービスベースのアプリケーションシステム内の各サービスは、異なるプログラミング言語や開発プラットフォームで書かれていてもよく、異なるデータストレージ技術を用いてもよいです。この概念により、開発者はサービスの種類に応じて適切なツールや言語を選択できます。したがって、単一のマイクロサービスベースのアプリケーションシステムにおいて、構成要素となるサービスを異なる言語(例: Ruby、Golang、Java)で構築してもよく、異なるストア(例: ドキュメントデータストア、グラフデータベース(DB)、マルチメディアDB)をホストしていてもよいです。各構成サービスは、マイクロサービスチームまたはDevOpsチームという1つのチームによって開発されます。このチームは、サービスの機能またはサービスコントラクトについて合意されている限り、開発と展開の手法に関して高い自律性をもって、そのサービスの開発・運用上のあらゆる要件を担います [6]。

Services in microservices are separately deployed on different nodes. The communication between them is transformed from a local function call to a remote call, which could affect system performance due to inherent latency in network communication. Thus, a lightweight communication infrastructure is required.

マイクロサービスにおけるサービスは、異なるノード上に個別に展開されます。それらの間の通信はローカル関数呼び出しからリモート呼び出しへと変換され、ネットワーク通信に固有のレイテンシによってシステムパフォーマンスに影響を与える可能性があります。したがって、軽量な通信インフラストラクチャが必要とされます。

Scaling can be applied selectively on those services that have performance bottlenecks due to insufficient Central Processing Unit (CPU) or memory resources, while other services can continue to be run using smaller, less expensive hardware. The functionality associated with such a service may be consumed in different ways for different purposes, thereby promoting reusability and composability. One example includes a customer database service, the contents of which are used both by shipping departments for preparing bills of lading and by accounts receivable or the billing department to send invoices.

スケーリングは、中央処理装置(CPU)またはメモリリソースの不足によりパフォーマンスのボトルネックが生じているサービスに対して選択的に適用でき、他のサービスはより小型で安価なハードウェアを使用して実行し続けることができます。このようなサービスに関連付けられた機能は、さまざまな目的のためにさまざまな方法で利用される場合があり、それによって再利用性と構成可能性が促進されます。一例として顧客データベースサービスが挙げられます。その内容は、船荷証券を作成するために出荷部門によっても、請求書を送信するために売掛金管理部門または請求部門によっても使用されます。

2.5 Microservices: Interaction Styles

2.5 マイクロサービス:インタラクションスタイル

In monolithic applications, each component (i.e., a procedure or function) invokes another using a language-level call, such as a method or function. In microservices-based applications, each service is typically a process running in its own distinct network node that communicates with other services through an inter-process communication mechanism (IPC) [7]. Additionally, a service is defined using an interface definition language (IDL) (e.g., Swagger/OpenAPI), resulting in an artifact called the application programming interface (API). The first step in the development of a service involves writing the interface definition, which is reviewed with client developers and iterated multiple times before the implementation of the service begins. Thus, an API serves as a contract between clients and services.

モノリシックアプリケーションでは、各コンポーネント(すなわち、プロシージャまたは関数)は、メソッドや関数などの言語レベルの呼び出しを使用して別のコンポーネントを呼び出します。マイクロサービスベースのアプリケーションでは、各サービスは通常、独自の個別のネットワークノードで実行されるプロセスであり、プロセス間通信メカニズム(IPC)を通じて他のサービスと通信します [7]。さらに、サービスはインターフェース記述言語(IDL)(例:Swagger/OpenAPI)を使用して定義され、アプリケーションプログラミングインターフェース(API)と呼ばれる成果物が生成されます。サービス開発の最初のステップにはインターフェース定義の作成が含まれ、これはクライアント側の開発者とともにレビューされ、サービスの実装が始まる前に複数回反復されます。したがって、APIはクライアントとサービス間の契約として機能します。

The choice of the IPC mechanism dictates the nature of the API [7]. Table 1provides the nature of API definitions for each IPC mechanism.

IPCメカニズムの選択によってAPIの性質が規定されます [7]。表1は、各IPCメカニズムに対するAPI定義の性質を示しています。

Table 1: IPC Mechanisms and API Types

表1: IPCメカニズムとAPIの種類

IPC MechanismNature of API Definition
Asynchronous, message-based (e.g., Advanced Message Queuing Protocol (AMQP) or Simple (or Streaming) Text Oriented Messaging Protocol. (STOMP))Made up of message channels and message types
Synchronous request/response (e.g., HTTP-based REST or Thrift)Made up of Uniform Resource Locators (URLs) and request and response formats
IPC メカニズムAPI 定義の性質
非同期、メッセージベース(例:Advanced Message Queuing Protocol(AMQP)または Simple (or Streaming) Text Oriented Messaging Protocol(STOMP))メッセージチャネルとメッセージタイプで構成される
同期リクエスト/レスポンス(例:HTTP ベースの REST または Thrift)Uniform Resource Locator(URL)ならびにリクエストおよびレスポンスのフォーマットで構成される

There can be different types of message formats used in IPC communication: text-based and human-readable, such as JavaScript Object Notation (JSON) or Extensible Markup Language (XML), or of a purely machine-readable binary format, such as Apache Avro or Protocol buffers.

IPC通信で使用されるメッセージフォーマットにはさまざまなタイプが存在し得ます。JavaScript Object Notation(JSON)やExtensible Markup Language(XML)のようなテキストベースで人間が読めるものや、Apache AvroやProtocol buffersのような純粋に機械可読なバイナリ形式のものがあります。

The principle of autonomy described earlier may call for each microservice to be a self-contained entity that delivers all of the functions of an application stack. However, for a microservices-based application that provides multiple business process capabilities (e.g., an online shopping application that provides business processes such as ordering, shipping, and invoicing), a component microservice is always dependent, in some fashion, on another microservice (e.g., data). In the context of our example, the shipping microservice is dependent upon “unfulfilled orders” data in the ordering microservice to perform its function of generating a shipping or bill of lading record. Hence, there is always the need to couple microservices while still retaining autonomy. The various approaches to creating the coupling, which are often dictated by business process and IT infrastructure needs, include interaction patterns, messaging patterns, and consumption modes. In this document, the term “interaction pattern” is used, and the primary interaction patterns are as follows.

前述の自律性の原則は、各マイクロサービスがアプリケーションスタックのすべての機能を提供する自己完結型の存在であることを求める場合があります。しかし、複数の業務プロセス機能を提供するマイクロサービスベースのアプリケーション(例: 注文、出荷、請求といった業務プロセスを提供するオンラインショッピングアプリケーション)では、構成要素のマイクロサービスは、何らかの形で(たとえばデータについて)常に別のマイクロサービスに依存します。この例では、出荷マイクロサービスは、出荷記録または船荷証券記録を生成するという機能を果たすために、注文マイクロサービスの「未処理の注文」データに依存しています。したがって、自律性を保ちながらも、マイクロサービスを結合させる必要は常にあります。結合を作り出すさまざまなアプローチは、業務プロセスやITインフラストラクチャの必要性によって決まることが多く、インタラクションパターン、メッセージングパターン、消費モードが含まれます。本書では「インタラクションパターン」という用語を用います。主なインタラクションパターンは次のとおりです。

Request-reply: Two distinct types of requests include queries for the retrieval of information and commands for a state-changing business function [2]. In the first type, a microservice makes a specific request for information or to take some action and functionally waits for a response. The purpose of the request for information is retrieval for presentation purposes. In the second type, one microservice asks another to take some action involving a state-changing business function (e.g., a customer modifying their personal profile or submitting an order). In the request-reply pattern, there is a strong runtime dependency between the two microservices involved, which manifests in the following two ways:

リクエスト/リプライ:リクエストの2つの異なるタイプには、情報取得のためのクエリと、状態を変更するビジネス機能のためのコマンドが含まれます [2]。第1のタイプでは、マイクロサービスが情報または何らかのアクションの実行に対する特定のリクエストを行い、機能的にレスポンスを待ちます。情報リクエストの目的は、提示目的の取得です。第2のタイプでは、あるマイクロサービスが別のマイクロサービスに対し、状態変更を伴うビジネス機能(例:顧客による個人プロフィールの変更や注文の送信)に関する何らかのアクションを実行するよう要求します。リクエスト/リプライパターンでは、関係する2つのマイクロサービス間に強力なランタイム依存関係が存在し、それは次の2つの形で現れます。

•One microservice can execute its function only when the other microservice is available.

•一方のマイクロサービスは、もう一方のマイクロサービスが利用可能である場合にのみその機能を実行できます。

•The microservice making the request must ensure that the request has been successfully delivered to the target microservice.

•リクエストを行うマイクロサービスは、ターゲットのマイクロサービスにリクエストが正常に配信されたことを確認しなければなりません。

Because of the nature of communication in the request-reply protocol, a synchronous communication protocol, such as HTTP, is used. If the microservice is implemented with a REST API, the messages between the microservices become HTTP REST API calls. The REST APIs are often defined using a standardized language, such as RAML (RESTful API Modeling

リクエスト/リプライプロトコルにおける通信の性質上、HTTPなどの同期通信プロトコルが使用されます。マイクロサービスがREST APIで実装されている場合、マイクロサービス間のメッセージはHTTP REST API呼び出しになります。REST APIは多くの場合、RAML(RESTful API Modeling

Language), which was developed for microservice interface definition and publication. HTTP is a blocking type of communication wherein the client that initiates a request can continue its task only when it receives a response.

Language)であり、マイクロサービスのインターフェース定義および公開のために開発されました。HTTPはブロッキング型の通信であり、リクエストを開始したクライアントは、レスポンスを受信したときにのみタスクを継続できます。

Publish-Subscribe: This pattern is used when microservices need to collaborate for the realization of a complex business process or transaction. This is also called a business domain event-driven approach or domain event subscription approach. In this pattern, a microservice registers itself or subscribes to business domain events (e.g., interested in specific information or being able to handle certain requests), which are published to a message broker through an event-bus interface. These microservices are built using event-driven APIs and use asynchronous messaging protocols, such as Message Queuing Telemetry Transport (MQTT), Advanced Message Queuing Protocol (AMQP), and Kafka Messaging, which enable support for notifications and subscriptions. In asynchronous protocols, the message sender does not typically wait for a response but simply sends the message to a message agent (e.g., RabbitMQ queue). One of the use cases for this approach is the propagation of data updates to multiple microservices based on certain events [8].

パブリッシュ・サブスクライブ:このパターンは、マイクロサービスが複雑なビジネスプロセスまたはトランザクションの実現のために連携する必要がある場合に使用されます。これは、ビジネスドメインイベント駆動型アプローチまたはドメインイベントサブスクリプションアプローチとも呼ばれます。このパターンでは、マイクロサービスはビジネスドメインイベント(例:特定の情報への関心がある、または特定のリクエストを処理できること)に自身を登録またはサブスクライブし、それらのイベントはイベントバスインターフェースを通じてメッセージブローカーにパブリッシュされます。これらのマイクロサービスはイベント駆動型APIを使用して構築され、通知およびサブスクリプションのサポートを可能にするMessage Queuing Telemetry Transport(MQTT)、Advanced Message Queuing Protocol(AMQP)、Kafka Messagingなどの非同期メッセージングプロトコルを使用します。非同期プロトコルでは、メッセージ送信者は通常レスポンスを待たず、単にメッセージエージェント(例:RabbitMQキュー)にメッセージを送信します。このアプローチのユースケースの1つは、特定のイベントに基づいた複数のマイクロサービスへのデータ更新の伝播です [8]。

2.6 Microservices: State of the Practice Core Features

2.6 マイクロサービス:実践水準のコア機能

The criticality of the communication infrastructure in a microservices-based application environment calls for several sophisticated capabilities to be provided as core features in many deployments. As already stated, many of these features can be implemented either stand-alone or bundled together in architectural frameworks such as an API gateway or service mesh. Even within the API gateway, these features can be implemented through service composition or direct implementation within the code base. These features include but are not limited to authentication, access control, service discovery, load balancing, response caching, application-aware health checks, and monitoring [2]. A brief description of these features [5] includes:

マイクロサービスベースのアプリケーション環境における通信インフラストラクチャの重要性から、多くの導入環境では、いくつかの高度な機能をコア機能として提供する必要があります。前述のとおり、これらの機能の多くは、スタンドアロンで実装することも、APIゲートウェイやサービスメッシュなどのアーキテクチャフレームワーク内に一括して組み込むこともできます。APIゲートウェイ内であっても、これらの機能はサービスの合成やコードベース内での直接的な実装を通じて実装できます。これらの機能には、認証、アクセス制御、サービスディスカバリ、負荷分散、レスポンスキャッシング、アプリケーション対応のヘルスチェック、モニタリングなどが含まれますが、これらに限定されません [2]。これらの機能の概要 [5] は以下のとおりである:

•Authentication and access control: Authentication and access policy may vary depending on the type of APIs exposed by microservices—some may be public APIs; some may be private APIs; and some may be partner APIs, which are available only for business partners.

•認証とアクセス制御:認証およびアクセスポリシーは、マイクロサービスによって公開されるAPIのタイプによって異なる場合があります。一部はパブリックAPI、一部はプライベートAPI、そして一部はビジネスパートナーのみが利用可能なパートナーAPIである場合があります。

•Service Discovery: In legacy distributed systems, there are multiple services configured to operate at designated locations (IP address and port number). In the microservices-based application, the following scenario exists and calls for a robust service discovery mechanism: a) There are a substantial number of services and many instances associated with each service with dynamically changing locations. b) Each of the microservices may be implemented in VMs or as containers, which may be assigned dynamic IP addresses, especially when they are hosted in an Infrastructure as a Service (IAAS) or Software as a Service (SAAS) cloud service. c) The number of instances associated with a service can vary based on the load fluctuations using features such as autoscaling.

•サービスディスカバリ:従来の分散システムでは、指定された場所(IPアドレスおよびポート番号)で動作するように構成された複数のサービスが存在します。マイクロサービスベースのアプリケーションでは、以下のシナリオが存在し、堅牢なサービスディスカバリメカニズムが求められます。a) 相当数のサービスがあり、各サービスに関連付けられた多数のインスタンスの場所が動的に変化します。b) 各マイクロサービスはVM内またはコンテナとして実装されている場合があり、特にそれらがInfrastructure as a Service(IAAS)またはSoftware as a Service(SAAS)クラウドサービスでホストされている場合、動的なIPアドレスが割り当てられる可能性があります。c) オートスケーリングなどの機能を使用することで、サービスに関連付けられるインスタンスの数は負荷の変動に応じて変化し得ます。

•Security monitoring and analytics – To detect attacks and identify factors for degradation of services (which may impact availability), it is necessary to monitor network traffic into

•セキュリティのモニタリングとアナリティクス – 攻撃を検知し、(可用性に影響を与える可能性のある)サービスの低下の要因を特定するためには、以下へのネットワークトラフィックを監視する必要があります。

7 and out of microservices with analytics capabilities in addition to routine logging features.

7 および、日常的なロギング機能に加えてアナリティクス機能を備えたマイクロサービスから外へ

An API gateway or micro-gateway is generally used for implementing the following core features:

APIゲートウェイまたはマイクロゲートウェイは、一般に以下のコア機能の実装に使用されます。

•Optimized endpoint: This involves several capabilities. a) Request and response collapsing: Most business transactions will involve calls to multiple microservices, often in a pre-determined sequence. An API gateway can simplify the situation for clients by exposing an endpoint that will automatically make all the needed multiple requests (calls) and return a single, aggregated response to the client. b) API Transformation: The API gateway can provide a public interface to the client which is different from the individual APIs it has to call to cater to a given request. This feature is called API transformation and enables: i) Changing the implementation and even the API interface for individual microservices; and ii) Transitioning from an initial, monolithic application to a microservices-based application by enabling continued access to clients through the API gateway while progressively splitting the monolithic application, creating microservice APIs in the background, and changing the API transformation configuration accordingly. c) Protocol Translation: Calls from clients to microservices entry points may be in web protocols, such as Hypertext Transfer Protocol Secure (HTTPS), while microservices communicate among themselves using synchronous protocols, such as Remote Procedure Call (RPC)/Thrift, or asynchronous protocols, such as AMQP. The necessary protocol translation in client requests is typically carried out by the API gateway.

•最適化されたエンドポイント:これにはいくつかの機能が含まれます。a) リクエストとレスポンスの折りたたみ(Request and response collapsing):ほとんどのビジネストランザクションには、多くの場合あらかじめ決められた順序で複数のマイクロサービスへの呼び出しが関与します。APIゲートウェイは、必要なすべての複数のリクエスト(呼び出し)を自動的に行い、単一の集約されたレスポンスをクライアントに返すエンドポイントを公開することで、クライアント側の状況を簡素化できます。b) API変換(API Transformation):APIゲートウェイは、所定のリクエストに対応するために呼び出さなければならない個々のAPIとは異なるパブリックインターフェースをクライアントに提供できます。この機能はAPI変換と呼ばれ、以下を可能にします。i) 個々のマイクロサービスの実装、さらにはAPIインターフェースの変更。ii) モノリシックアプリケーションを段階的に分割し、バックグラウンドでマイクロサービスAPIを作成し、それに応じてAPI変換設定を変更しながら、APIゲートウェイを通じてクライアントへの継続的なアクセスを可能にすることで、初期のモノリシックアプリケーションからマイクロサービスベースのアプリケーションへの移行。c) プロトコル変換(Protocol Translation):クライアントからマイクロサービスのエントリポイントへの呼び出しはHypertext Transfer Protocol Secure(HTTPS)などのWebプロトコルで行われる場合がありますが、マイクロサービス間はRemote Procedure Call(RPC)/Thriftなどの同期プロトコルやAMQPなどの非同期プロトコルを使用して通信します。クライアントリクエストにおける必要なプロトコル変換は、通常APIゲートウェイによって実行されます。

•Circuit breaker: This is a feature to set a threshold for the failed responses to an instance of a microservice and cut off proxying requests to that instance when the failure is above the threshold. This avoids the possibility of a cascaded failure, allows time to analyze logs, implement the necessary fix, and push an update for the failing instance.

•サーキットブレーカー:これは、マイクロサービスのインスタンスに対する失敗レスポンスのしきい値を設定し、失敗がしきい値を超えた場合にそのインスタンスへのリクエストのプロキシ処理を遮断する機能です。これにより、連鎖障害の可能性を回避し、ログの分析、必要な修正の実装、および障害が発生しているインスタンスへのアップデートのプッシュのための時間を確保できます。

•Load balancing: There is a need to have multiple instances of the same service, and the load on these instances must be evenly distributed to avoid delayed responses or service crashes due to overload.

•負荷分散(Load balancing):同一サービスの複数インスタンスを用意する必要があり、過負荷によるレスポンスの遅延やサービスのクラッシュを回避するために、これらのインスタンスにかかる負荷を均等に分散させる必要があります。

•Rate limiting (throttling): The rate of requests coming into a microservice must be limited to ensured continued availability of service for all clients.

•レート制限(スロットリング):すべてのクライアントに対するサービスの継続的な可用性を確保するために、マイクロサービスに入ってくるリクエストのレートを制限する必要があります。

•Blue/green deployments: When a new version of a microservice is deployed, requests from customers using the old version can be redirected to the new version since the API gateway can be programmed to be aware of the locations of both versions.

•ブルー/グリーンデプロイメント:APIゲートウェイは両バージョンの場所を認識できるようにプログラムできるため、マイクロサービスの新しいバージョンがデプロイされた際、古いバージョンを使用している顧客からのリクエストを新しいバージョンにリダイレクトできます。

•Canary releases: Only a limited amount of traffic is initially sent to a new version of a microservice since the correctness of its response or performance metric under all

•カナリアリリース:当初は限られた量のトラフィックのみがマイクロサービスの新しいバージョンに送信されます。なぜなら、そのレスポンスの正確性やパフォーマンス指標がすべての

8 operating scenarios is not fully known. Once sufficient data is gathered about its operating characteristics, then all of the requests can be proxied to the new version of the microservice.

8 動作シナリオが十分には分かっていません。そのマイクロサービスの動作特性に関する十分なデータが収集されると、すべてのリクエストをマイクロサービスの新しいバージョンにプロキシできるようになります。

2.7 Microservices: Architectural Frameworks

2.7 マイクロサービス:アーキテクチャフレームワーク

The two main architectural frameworks for bundling or packaging core features that primarily ensure reliable, resilient, and secure communication in a microservices-based application are:

原本PDFの抜粋画像原本 PDF p.17 の画像抜粋

マイクロサービスベースのアプリケーションにおいて、主に信頼性が高く、回復力があり、安全な通信を確保するコア機能をバンドルまたはパッケージ化するための2つの主要なアーキテクチャフレームワークは、次のとおりである:

•API gateway, augmented with or without micro gateways; and

原本PDFの抜粋画像原本 PDF p.17 の画像抜粋

•マイクロゲートウェイによる拡張の有無を問わない API ゲートウェイ、および

•Service mesh.

•サービスメッシュ。

The role of these frameworks in the operating environment of a microservices-based application system are given in Table 2 [4]:

原本PDFの抜粋画像原本 PDF p.17 の画像抜粋

マイクロサービスベースのアプリケーションシステムの運用環境におけるこれらのフレームワークの役割を表2 [4]に示す:

Table 2: Role of Architectural Frameworks in Microservices Operations

表2:マイクロサービス運用におけるアーキテクチャフレームワークの役割

Architectural FrameworkRole in the Overall Architecture
API gateway, augmented with or without micro gatewaysUsed for controlling north-south and east-west traffic
Service meshDeployed for purely east-west traffic when microservices are implemented using containers but can also be used in situations where microservices are housed in VMs or application servers.
アーキテクチャフレームワークアーキテクチャ全体における役割
マイクロゲートウェイによる拡張の有無を問わない API ゲートウェイ南北トラフィックおよび東西トラフィックを制御するために使用される
サービスメッシュマイクロサービスをコンテナを使用して実装する場合に、東西トラフィックのみを対象として導入されますが、マイクロサービスが VM やアプリケーションサーバーに収容されている状況でも使用できます。

Typical functions in both architectural frameworks include: service discovery, load balancing, failure detection, failure response, and attack monitoring.

原本PDFの抜粋画像原本 PDF p.17 の画像抜粋

両方のアーキテクチャフレームワークにおける典型的な機能には、サービスディスカバリ、負荷分散、障害検知、障害対応、および攻撃監視が含まれます。

2.7.1 API Gateway

2.7.1 APIゲートウェイ

The API gateway is a popular architectural framework for microservices-based application systems. Unlike a monolithic application where the endpoint may be a single server, a microservices-based application consists of multiple fine-grained endpoints. Hence, it makes sense to provide a single entry point for all clients to multiple component microservices of the application. Another situation where an API gateway is deployed is to act as a front-end (that matches the legacy enterprise software) to back-end services when an organization is migrating from a monolithic enterprise application by gradually replacing its components with independent microservices over time. Direct communication of clients to multiple endpoints results in too many point-to-point connections.

APIゲートウェイは、マイクロサービスベースのアプリケーションシステムで広く使われているアーキテクチャフレームワークです。エンドポイントが単一のサーバーである可能性があるモノリシックアプリケーションとは異なり、マイクロサービスベースのアプリケーションは複数のきめ細かなエンドポイントで構成されます。そのため、すべてのクライアントに対して、アプリケーションの複数のコンポーネントマイクロサービスへの単一のエントリポイントを提供することは理にかなっています。APIゲートウェイが配備されるもう1つの状況は、組織がモノリシックなエンタープライズアプリケーションのコンポーネントを長期にわたって独立したマイクロサービスに徐々に置き換えることによって移行を進めている際に、バックエンドサービスに対するフロントエンド(レガシーなエンタープライズソフトウェアと適合するもの)として機能させる場合です。クライアントが複数のエンドポイントと直接通信を行うと、ポイントツーポイント接続が過剰に増加してしまいます。

The primary function of the API gateway is to always route inbound requests to the correct down-stream services, optionally perform protocol translation (i.e., translation between web protocols, such as HTTP and WebSocket, and web-unfriendly protocols that are used internally, such as AMQP and Thrift binary RPC) and sometimes compose requests. In some rare instances, they are used as part of a Backend for Frontend (BFF), thus enabling support for clients with different form factors (e.g., browser, mobile device). All requests from clients first go through

APIゲートウェイの主要な機能は、インバウンドリクエストを常に正しいダウンストリームサービスにルーティングし、オプションでプロトコル変換(すなわち、HTTPやWebSocketなどのWebプロトコルと、AMQPやThriftバイナリRPCなど内部で使用されるWeb非対応プロトコルとの間の変換)を実行し、場合によってはリクエストの合成を行うことです。まれなケースでは、Backend for Frontend(BFF)の一部として使用され、これにより異なるフォームファクタを持つクライアント(例:ブラウザ、モバイルデバイス)のサポートが可能になります。クライアントからのすべてのリクエストは、まず

9 the API gateway, which then routes requests to the appropriate microservice. The API gateway will often handle a request by invoking multiple microservices and aggregating the results.

9 APIゲートウェイ。ゲートウェイはその後、リクエストを適切なマイクロサービスにルーティングします。APIゲートウェイは多くの場合、複数のマイクロサービスを呼び出して結果を集約することによってリクエストを処理します。

The multiple APIs or microservices accessible through the API gateway can be specified as part of the input port definition of the gateway (e.g., mobileAPI or MobileService) or be specified dynamically through a deploy operation of the API gateway service with a request parameter that contains the name of the service that should be embedded with the requested service [9]. Thus, the API gateway, located between clients and microservices, represents a pattern wherein a proxy aggregates multiple services. Many API gateway implementations can support APIs written in different languages, such as Jolie, JavaScript, or Java.

APIゲートウェイを介してアクセス可能な複数のAPIまたはマイクロサービスは、ゲートウェイの入力ポート定義の一部として指定されるか(例:mobileAPIまたはMobileService)、あるいは要求されたサービスに組み込まれるべきサービスの名前を含むリクエストパラメータを伴う、APIゲートウェイサービスのデプロイ操作を通じて動的に指定できます [9]。このように、クライアントとマイクロサービスの間に位置するAPIゲートウェイは、プロキシが複数のサービスを集約するパターンを表しています。多くのAPIゲートウェイ実装は、Jolie、JavaScript、Javaなどのさまざまな言語で記述されたAPIをサポートできます。

Since the API gateway is the entry point for microservices, it should be equipped with the necessary infrastructure services (in addition to its main service of request shaping), such as service discovery, authentication and access control, load balancing, caching, providing custom APIs for each type of client, application-aware health checks, service monitoring, attack detection, attack response, security logging and monitoring and circuit breakers. These additional features may be implemented in the API gateway in two ways:

APIゲートウェイはマイクロサービスへのエントリポイントであるため、(リクエストシェーピングという主要サービスに加えて)サービス検出、認証およびアクセス制御、負荷分散、キャッシング、クライアントタイプごとのカスタムAPIの提供、アプリケーション対応のヘルスチェック、サービス監視、攻撃検出、攻撃対応、セキュリティロギングおよび監視、サーキットブレーカーなどの必要なインフラストラクチャサービスを備えるべきです。これらの追加機能は、次の2つの方法でAPIゲートウェイに実装されることがある:

•By composing the specific services developed for respective functionality (e.g., service registry for service discovery); and

•各機能向けに開発された特定のサービス(例:サービス検出のためのサービスレジストリ)を構成することによる方法、および

•Implementing these functionalities directly inside the codebase that utilizes the API gateway.

•APIゲートウェイを利用するコードベース内部にこれらの機能を直接実装する方法。

Gateway implementations

ゲートウェイの実装

To prevent the gateway from having too much logic to handle request shaping for different client types, it is divided into multiple gateways [8]. This multiple gateway pattern is called BFF. In BFF, each client type is given its own gateway (e.g., web app BFF, mobile app BFF) as a collection point for service requests. The respective backend is closely aligned with the corresponding front end (client) and is typically developed by the same team. The functionality provided by BEF can also be provided by GraphQL which allows the client to shape responses in their requests by specifying what parts of a data-type are required in a response.

異なるクライアントタイプに対するリクエスト整形を処理するためのロジックをゲートウェイが過剰に抱え込むのを防ぐため、ゲートウェイは複数のゲートウェイに分割されます[8]。この複数ゲートウェイパターンはBFFと呼ばれます。BFFでは、サービスリクエストの集約ポイントとして各クライアントタイプに専用のゲートウェイ(例:ウェブアプリBFF、モバイルアプリBFF)が割り当てられます。それぞれのバックエンドは対応するフロントエンド(クライアント)と密接に連携しており、通常は同一のチームによって開発されます。BEFによって提供される機能は、クライアントがレスポンスに必要なデータ型の部分を指定することでリクエスト内でレスポンスを整形できるようにするGraphQLによっても提供できます。

API management for a microservices-based application can be implemented through either a monolithic API gateway architecture or a distributed API gateway architecture. In the monolithic API gateway architecture, there is only one API gateway that is typically deployed at the edge of the enterprise network (e.g., Demilitarized Zone (DMZ)) and provides all services to the API at the enterprise level. In the distributed API gateway architecture, there are multiple instances of microgateways, which are deployed closer to microservice APIs [10]. A microgateway is typically a low footprint, scriptable API gateway that can be used to define and enforce customized policies and is therefore suitable for microservices-based applications, which must be protected through service-specific security policies.

マイクロサービスベースのアプリケーションに対するAPI管理は、モノリシックAPIゲートウェイアーキテクチャまたは分散APIゲートウェイアーキテクチャのいずれかを通じて実装できます。モノリシックAPIゲートウェイアーキテクチャでは、通常エンタープライズネットワークのエッジ(例:非武装地帯(DMZ))にデプロイされ、エンタープライズレベルでAPIにすべてのサービスを提供する1つのAPIゲートウェイのみが存在します。分散APIゲートウェイアーキテクチャでは、マイクロサービスAPIのより近くにデプロイされるマイクロゲートウェイの複数のインスタンスが存在します[10]。マイクロゲートウェイは通常、カスタマイズされたポリシーを定義および適用するために使用できる低フットプリントでスクリプト対応のAPIゲートウェイであり、したがってサービス固有のセキュリティポリシーによって保護されなければならないマイクロサービスベースのアプリケーションに適しています。

The microgateway is typically implemented as a stand-alone container using development platforms such as Node.js. It is different from a sidecar proxy of the service mesh architecture (refer to Section 2.7.2), which is implemented at the API endpoint itself. There are a number of

マイクロゲートウェイは通常、Node.jsなどの開発プラットフォームを使用してスタンドアロンのコンテナとして実装されます。これは、APIエンドポイント自体に実装されるサービスメッシュアーキテクチャ(セクション2.7.2を参照)のサイドカープロキシとは異なります。ゲートウェイにおいてセキュリティポリシーをエンコードおよび入力する方法には多数の

10 ways the security policies can be encoded and input in a gateway. One approach is to encode policies using JSON format and input them through a graphical policy management interface. The microgateway should contain policies for both application requests and responses. When policies and their enforcement are implemented as a container, they are immutable and thus provide a degree of protection against accidental and unintended modifications which may result in security breaches or conflicts. In other words, these types of modifications are prevented when the microgateway is implemented as a container since any security policy update will require redeployment of the microgateway. It is essential that the microgateway deployed for any microservice instance communicate with service registry and monitoring modules to keep track of the operational status of the microservice it is designed to protect.

10 セキュリティポリシーをゲートウェイにエンコードして入力できる方法。1つのアプローチは、JSON形式を使用してポリシーをエンコードし、グラフィカルなポリシー管理インターフェースを介してそれらを入力することです。マイクロゲートウェイは、アプリケーションのリクエストとレスポンスの両方に対するポリシーを含むべきです。ポリシーとその適用がコンテナとして実装されている場合、それらは不変であり、したがってセキュリティ侵害や競合をもたらす可能性がある偶発的および意図しない変更に対する一定の保護を提供します。言い換えれば、セキュリティポリシーの更新にはマイクロゲートウェイの再デプロイが必要になるため、マイクロゲートウェイがコンテナとして実装されている場合、これらのタイプの変更は防止されます。任意のマイクロサービスインスタンスに対してデプロイされたマイクロゲートウェイは、保護するように設計されているマイクロサービスの運用状況を追跡するために、サービスレジストリおよび監視モジュールと通信することが不可欠です。

2.7.2 Service Mesh

2.7.2 サービスメッシュ

A service mesh is a dedicated infrastructure layer that facilitates service-to-service communication through service discovery, routing and internal load balancing, traffic configuration, encryption, authentication and authorization, metrics, and monitoring. It provides the capability to declaratively define network behavior, node identity, and traffic flow through policy in an environment of changing network topology due to service instances coming and going offline and continuously being relocated. It can be looked upon as a networking model that sits at a layer of abstraction above the transport layer of the Open System Interconnection (OSI) model (e.g., Transport Control Protocol/Internet Protocol (TCP/IP)) and addresses the service’s session layer (Layer 5 of the OSI model) concerns [11]. However, fine-grained authorization may still need to be performed at the microservice since that is the only entity that has the full knowledge of the business logic. A service mesh conceptually has two modules—the data plane and the control plane. The data plane carries the application request traffic between service instances through service-specific proxies. The control plane configures the data plane, provides a point of aggregation for telemetry, and provides APIs for modifying the behavior of the network through various features, such as load balancing, circuit breaking, or rate limiting.

サービスメッシュとは、サービスディスカバリー、ルーティングと内部ロードバランシング、トラフィック設定、暗号化、認証と認可、メトリクス、監視を通じて、サービス間通信を促進する専用のインフラストラクチャレイヤーです。サービスインスタンスがオフラインになったり再びオンラインになったりし、絶えず移転されることでネットワークトポロジが変化する環境において、ネットワークの挙動、ノードのID、トラフィックの流れを、ポリシーによって宣言的に定義する能力を提供します。サービスメッシュは、Open System Interconnection(OSI)モデルのトランスポート層(例: Transport Control Protocol/Internet Protocol(TCP/IP))の上位の抽象レイヤーに位置し、サービスのセッション層(OSIモデルの第5層)の関心事に対処するネットワーキングモデルとみなすことができます [11]。ただし、きめ細かな認可は、業務ロジックを完全に把握している唯一の存在であるマイクロサービスで行う必要がある場合もあります。サービスメッシュは概念的に、データプレーンとコントロールプレーンの2つのモジュールを持ちます。データプレーンは、サービス固有のプロキシを通じて、サービスインスタンス間のアプリケーションのリクエストトラフィックを運びます。コントロールプレーンは、データプレーンを構成し、テレメトリの集約点を提供し、ロードバランシング、サーキットブレーキング、レート制限などのさまざまな機能を通じてネットワークの挙動を変更するためのAPIを提供します。

Service meshes create a small proxy server instance for each service within a microservices application. This specialized proxy car is sometimes called a “sidecar proxy” in service mesh parlance [12]. The sidecar proxy forms the data plane, while the runtime operations needed for enforcing security (access control, communication-related) are enabled by injecting policies (e.g., access control policies) into the sidecar proxy from the control plane. This also provides the flexibility to dynamically change policies without modifying the microservices code.

サービスメッシュは、マイクロサービスアプリケーション内の各サービスに対して、小さなプロキシサーバーのインスタンスを作成します。この特殊なプロキシは、サービスメッシュの用語では「サイドカープロキシ」と呼ばれることがあります [12]。サイドカープロキシがデータプレーンを形成し、セキュリティを強制するために必要な実行時の動作(アクセス制御、通信関連)は、コントロールプレーンからサイドカープロキシにポリシー(例: アクセス制御ポリシー)を注入することで実現されます。これにより、マイクロサービスのコードを変更せずに、ポリシーを動的に変更できる柔軟性も得られます。

2.8 Comparison with Monolithic Architecture

2.8 モノリシックアーキテクチャとの比較

To fully compare the microservice architecture with the monolithic architecture used for all legacy applications, it is necessary to compare the features of applications developed using these architectural styles as well as provide an example of an application under both architectures for a specific business process. A detailed discussion involving these aspects is provided in Appendix A.

マイクロサービスアーキテクチャを、すべてのレガシーアプリケーションで用いられているモノリシックアーキテクチャと十分に比較するには、これらのアーキテクチャスタイルで開発されたアプリケーションの特徴を比較するとともに、特定の業務プロセスについて両方のアーキテクチャでのアプリケーションの例を示す必要があります。これらの側面に関する詳細な議論は付録Aに示します。

2.9 Comparison with Service-Oriented Architecture (SOA)

2.9 サービス指向アーキテクチャ(SOA)との比較

The architectural style of microservices shares many similarities with service-oriented architecture (SOA) due to the following common technical concepts [13]:

マイクロサービスのアーキテクチャスタイルは、以下の共通の技術的概念により、サービス指向アーキテクチャ(SOA)と多くの類似点を共有している[13]:

•Services: The application system provides its various functionalities through self-contained entities or artifacts called services that may have other attributes such as being visible or discoverable, stateless, reusable, composable, or have technological-diversity.

•サービス: アプリケーションシステムは、サービスと呼ばれる自己完結型の存在またはアーティファクトを通じて、さまざまな機能を提供します。サービスは、可視である、または発見可能である、ステートレスである、再利用可能である、合成可能である、技術的多様性を持つなど、他の属性を持つ場合があります。

•Interoperability: A service can call any other service using artifacts such as an enterprise service bus (ESB) in the case of SOA or through a remote procedural call (RPC) across a network as in the case of a microservices environment.

•相互運用性(Interoperability):サービスは、SOAの場合におけるエンタープライズサービスバス(ESB)などの成果物を使用するか、あるいはマイクロサービス環境の場合のようにネットワークを介したリモートプロシージャコール(RPC)を通じて、他のあらゆるサービスを呼び出すことができます。

•Loose coupling: There is minimal dependency between services such that the change in one service does not require a change in another service.

•疎結合(Loose coupling):サービス間の依存関係は最小限に抑えられており、あるサービスの変更が別のサービスの変更を必要としません。

In spite of the three common technical concepts described above, technical opinion on the relationship between an SOA and microservices environment falls along the following three lines [13]:

上述した3つの共通の技術的概念があるにもかかわらず、SOAとマイクロサービス環境の関係に関する技術的見解は、以下の3つの系統に分かれる [13]:

•Microservices are a separate architectural style,

•マイクロサービスは別個のアーキテクチャスタイルである、

•Microservices represent one SOA pattern, and

•マイクロサービスは1つのSOAパターンを表している、そして

•A microservice is a refined SOA.

•マイクロサービスは洗練されたSOAです。

The most prevalent opinion is that the differences between SOA and microservices do not concern the architectural style except in its concrete realization, such as development or deployment paradigms and technologies [2].

最も有力な見解は、SOAとマイクロサービスの違いは、開発やデプロイのパラダイムおよび技術など、具体的な実現手法を除いて、アーキテクチャスタイルに関わるものではないというものです [2]。

2.10 Advantages of Microservices

2.10 マイクロサービスの利点

•For large applications, splitting the application into loosely coupled components enables independence between the developer teams assigned to each component. Each team can then optimize by choosing its own development platform, tools, language, middleware, and hardware based on their appropriateness for the component being developed.

•大規模なアプリケーションの場合、アプリケーションを疎結合なコンポーネントに分割することで、各コンポーネントに割り当てられた開発チーム間の独立性を確保できます。これにより、各チームは開発対象のコンポーネントへの適合性に基づいて、独自の開発プラットフォーム、ツール、言語、ミドルウェア、ハードウェアを選択して最適化できます。

•Each of the components can be scaled independently. The targeted allocation of resources results in maximum utilization of resources.

•各コンポーネントは個別にスケーリングできます。リソースの的を絞った割り当てにより、リソースの利用効率が最大化されます。

•If components have HTTP RESTful interfaces, implementation can be changed without disruption to the overall function of the application as long as the interface remains the same.

•コンポーネントがHTTP RESTfulインターフェースを持つ場合、インターフェースが変わらない限り、アプリケーション全体の機能を妨げることなく実装を変更できます。

•The relatively smaller codebase involved in each component enables the development team to produce updates more quickly and provide the application with the agility to respond to changes in business processes or market conditions.

•各コンポーネントに含まれるコードベースが比較的小さいため、開発チームはアップデートをより迅速に作成でき、ビジネスプロセスや市場状況の変化に対応する俊敏性をアプリケーションに提供できます。

•The loose coupling between the components enables containment of the outage of a microservice such that the impact is restricted to that service without a domino effect on other components or other parts of the application.

•コンポーネント間の疎結合により、マイクロサービスの停止(アウテージ)の封じ込めが可能になり、影響が他のコンポーネントやアプリケーションの他の部分へ連鎖(ドミノ効果)することなく、そのサービスのみに限定されます。

•When components are linked together using an asynchronous event-handling mechanism, the impact of a component’s outage is temporary since the required functions will automatically execute when the component begins running again, thus maintaining the overall integrity of the business process.

•コンポーネントが非同期イベント処理メカニズムを使用して相互に連携している場合、コンポーネントが再稼働したときに必要な機能が自動的に実行されるため、コンポーネントのアウトテージによる影響は一時的なものとなり、ビジネスプロセス全体の整合性が維持されます。

•By aligning the service definition to business capabilities (or by basing the decomposition logic for the overall application functionality based on business processes or capabilities), the overall architecture of the microservices-based system is aligned with the organizational structure. This promotes an agile response when business processes associated with an organizational unit change and consequently require that associated service to be modified and deployed.

•サービス定義をビジネス機能に整合させること(または、アプリケーション全体の機能の分解ロジックをビジネスプロセスや能力に基づかせること)によって、マイクロサービスベースのシステムの全体的なアーキテクチャは組織構造と整合します。これにより、組織単位に関連付けられたビジネスプロセスが変更され、結果として関連するサービスの変更およびデプロイが必要になった場合に、俊敏な対応が促進されます。

•The independent functional nature of a microservice promotes better reusability of the code across applications.

•マイクロサービスの独立した機能的性質により、アプリケーション間でのコードの再利用性が向上します。

2.11 Disadvantages of Microservices

2.11 マイクロサービスの短所

•Multiple components (microservices) must be monitored instead of one single application. A central console is needed to obtain the status of each component and the overall state of the application. Therefore, an infrastructure must be created with distributed monitoring and centralized viewing capabilities.

•単一のアプリケーションの代わりに、複数のコンポーネント(マイクロサービス)を監視する必要があります。各コンポーネントのステータスとアプリケーションの全体的な状態を取得するには、中央コンソールが必要です。したがって、分散監視機能と集中表示機能を備えたインフラストラクチャを構築する必要があります。

•The presence of multiple components creates an availability problem since any component may cease functioning at any time.

•いずれかのコンポーネントがいつでも機能停止する可能性があるため、複数のコンポーネントの存在は可用性の問題を引き起こします。

•A component may have to call the latest version of another component for some clients and call the previous version of the same component for another set of clients (i.e., version management).

•あるコンポーネントは、一部のクライアントに対して別のコンポーネントの最新バージョンを呼び出し、別のクライアント群に対しては同じコンポーネントの以前のバージョンを呼び出さなければならない場合があります(すなわち、バージョン管理)。

•Running an integration test is more difficult since a test environment is needed wherein all components must be working and communicating with each other.

•すべてのコンポーネントが動作し、互いに通信しているテスト環境が必要となるため、結合テストの実行はより困難になります。

•When interactions within a microservices-based application are designed as API calls, all the necessary processes required for secure API management must be implemented.

•マイクロサービスベースのアプリケーション内のインタラクションがAPI呼び出しとして設計されている場合、セキュアなAPI管理に必要なすべてのプロセスを実装する必要があります。

•The microservices architecture can break down the practice of defense in depth. Many architectures have a web server running in a DMZ that is expected to be compromised, then a backend service which the web server talks to, and then finally a database that the backend service talks to. The backend service can act as a more hardened layer between the exposed web server and the sensitive data in the database. The microservice architecture tends to collapse this and now the web server and back end service are broken down into microservices potentially more exposed than in the previous model. This can result in fewer layers of protection between the caller and sensitive data. Hence it is critical to securely design and implement the microservices themselves as well as the service mesh or API gateway deployment model.

•マイクロサービスアーキテクチャは、多層防御(defense in depth)のプラクティスを崩壊させる可能性があります。多くのアーキテクチャでは、侵害されることが想定されているDMZ内で稼働するWebサーバーがあり、次にそのWebサーバーが通信するバックエンドサービスがあり、最終的にそのバックエンドサービスが通信するデータベースが存在します。バックエンドサービスは、公開されたWebサーバーとデータベース内の機密データとの間において、より堅牢化された層として機能することができます。マイクロサービスアーキテクチャはこれを崩す傾向があり、現在ではWebサーバーとバックエンドサービスがマイクロサービスへと分解され、以前のモデルよりも潜在的に多く公開されることになります。これにより、呼び出し元と機密データとの間の保護層が減少する結果となり得ます。したがって、サービスメッシュやAPIゲートウェイのデプロイメントモデルだけでなく、マイクロサービス自体を安全に設計および実装することが極めて重要です。

13

3 Microservices: Threat Background

3 マイクロサービス: 脅威の背景

The threat background for a microservices-based application system should be treated as a continuation of the technology background provided in Section 2. The following approach has been adopted to review the threat background:

マイクロサービスベースのアプリケーションシステムの脅威の背景は、セクション2で提供された技術的背景の続きとして扱われるべきです。脅威の背景をレビューするために、以下のアプローチが採用されています。

•Consider all layers in the deployment stack of a typical microservices-based application and identify typical potential threats at each layer.

•典型的なマイクロサービスベースのアプリケーションのデプロイメントスタックにおけるすべての層を検討し、各層における典型的な潜在的脅威を特定します。

•Identify the distinct set of threats exclusive to microservices-based application systems.

•マイクロサービスベースのアプリケーションシステムに特有の明確な脅威のセットを特定します。

3.1 Review of Threat Sources Landscape

3.1 脅威源ランドスケープのレビュー

Six layers are present in the deployment stack of a typical microservices-based application as suggested in [13]: hardware, virtualization, cloud, communication, service/application, and orchestration. This document considers these layers to be threat sources, and several of the security concerns affiliated with them are described below to provide an overview of the threat background in a microservices-based application. It is important to remember that many of the possible threats are common to other application environments and not specific to a microservices-based application environment.

[13] で示唆されているように、典型的なマイクロサービスベースのアプリケーションのデプロイメントスタックには、ハードウェア、仮想化、クラウド、通信、サービス/アプリケーション、およびオーケストレーションの6つの層が存在します。本書ではこれらの層を脅威源とみなし、マイクロサービスベースのアプリケーションにおける脅威の背景の概要を提供するため、それらに関連するいくつかのセキュリティ上の懸念事項を以下で説明します。起こり得る脅威の多くは他のアプリケーション環境にも共通しており、マイクロサービスベースのアプリケーション環境に固有のものではないことを覚えておくことが重要です。

•Hardware layer: Though hardware flaws, such as Meltdown and Spectre [8], have been reported, such threats are rare. In the context of this document, hardware is assumed to be trusted, and threats from this layer are not considered.

•ハードウェア層:MeltdownやSpectre [8]などのハードウェアの欠陥が報告されていますが、そのような脅威は稀です。本文書の文脈において、ハードウェアは信頼されていると仮定されており、この層からの脅威は考慮されていません。

•Virtualization layer: In this layer, threats to microservices or hosting containers originate from compromised hypervisors and the use of malicious or vulnerable container images and VM images. These threats are addressed in other NIST documents and are therefore not discussed here.

•仮想化層:この層では、マイクロサービスやホスティングコンテナに対する脅威は、侵害されたハイパーバイザーや、悪意のあるまたは脆弱なコンテナイメージおよびVMイメージの使用に起因します。これらの脅威は他のNIST文書で扱われているため、ここでは取り上げません。

•Cloud environment: Since virtualization is the predominant technology used by cloud providers, the same set of threats to the virtualization layer applies. Further, there are potential threats within the networking infrastructure of the cloud provider. For example, hosting all microservices within a single cloud provider may result in fewer network-level security controls for inter-process communication as opposed to controls for communication between external clients and the microservices hosted within the cloud. Security threats within a cloud infrastructure are considered in several other NIST documents and are therefore not addressed here.

•クラウド環境: 仮想化はクラウドプロバイダーが用いる主要な技術であるため、仮想化レイヤーに対する脅威と同じものが当てはまります。さらに、クラウドプロバイダーのネットワークインフラストラクチャ内にも潜在的な脅威があります。たとえば、すべてのマイクロサービスを単一のクラウドプロバイダー内でホストすると、外部クライアントとクラウド内でホストされるマイクロサービスとの間の通信に対する管理策と比べて、プロセス間通信に対するネットワークレベルのセキュリティ管理策が少なくなる場合があります。クラウドインフラストラクチャ内のセキュリティ脅威は、他の複数のNIST文書で検討されているため、ここでは扱いません。

•Communication layer: This layer is unique to microservices-based applications due to the sheer number of microservices, adopted design paradigms (loose coupling and API composition), and different interaction styles (synchronous or asynchronous) among them. Many of the core features of microservices pertain to this layer, and the threats to these core features are identified under microservices-specific threats in Sec. 3.2.

•通信層:この層は、マイクロサービスの膨大な数、採用された設計パラダイム(疎結合とAPI構成)、およびそれらの間の異なる相互作用スタイル(同期または非同期)により、マイクロサービスベースのアプリケーションに特有のものです。マイクロサービスのコア機能の多くはこの層に関連しており、これらのコア機能に対する脅威はSec. 3.2のマイクロサービス特有の脅威の下で特定されています。

•Service/application layer: In this layer, threats are the results of malicious or faulty code. As this falls under secure application development methodologies, it is outside of the scope of this document.

•サービス/アプリケーション層:この層では、脅威は悪意のあるコードまたは欠陥のあるコードの結果です。これはセキュアなアプリケーション開発方法論に分類されるため、本文書の範囲外です。

•Orchestration layer: An orchestration layer may come into play if the microservices implementation involves technologies such as containers. The threats in this layer pertain to the subversion of automation or configuration features, especially related to scheduling and clustering of servers, containers, or VMs hosting the services, and are therefore beyond the scope of this document.

•オーケストレーション層:マイクロサービスの実装にコンテナなどのテクノロジーが含まれる場合、オーケストレーション層が関係してくる可能性があります。この層における脅威は、自動化機能または構成機能の不正操作、特にサービスをホストするサーバー、コンテナ、またはVMのスケジューリングおよびクラスタリングに関連する機能の不正操作に関係するため、本文書の範囲外となります。

3.2 Microservices-specific Threats

3.2 マイクロサービス特有の脅威

Most state-of-practice core features refer to the communication layer in the deployment stack of microservices-based applications. Hence, the overall security strategies for microservices-based applications should involve choosing the right implementation options, identifying the architectural frameworks packaging those core features, identifying microservice-specific threats, and providing coverage for countering those threats in the implementation options.

実践水準(state of practice)のコア機能の大半は、マイクロサービスベースのアプリケーションのデプロイメントスタックにおける通信層に関連しています。したがって、マイクロサービスベースのアプリケーションに対する全体的なセキュリティ戦略には、適切な実装オプションの選択、これらのコア機能をパッケージ化するアーキテクチャフレームワークの特定、マイクロサービス特有の脅威の特定、および実装オプションにおいてそれらの脅威に対抗するための対策の提供が含まれるべきです。

However, it should be pointed out that microservices-based applications are still susceptible to most attacks that web applications are susceptible to, including injection, encoding and serialization attacks, cross site scripting (XSS), Cross-Site Request Forgery (CSRF), and HTTP verb tempering [20]. And many of the controls to prevent these attacks still need to be implemented in the microservice code so you need to ensure that developers are not under the impression that an API gateway or service mesh will provide all security for their microservice.

しかしながら、マイクロサービスベースのアプリケーションは、インジェクション、エンコーディングおよびシリアライゼーション攻撃、クロスサイトスクリプティング(XSS)、クロスサイトリクエストフォージェリ(CSRF)、HTTP動詞の改ざん(HTTP verb tempering)[20]など、Webアプリケーションが影響を受けやすい攻撃の多くに対して依然として脆弱である点は指摘しておく必要があります。また、これらの攻撃を防ぐための制御の多くは依然としてマイクロサービスのコード内で実装する必要があるため、開発者がAPIゲートウェイやサービスメッシュがマイクロサービスのすべてのセキュリティを提供してくれるという誤った認識を持たないようにする必要があります。

3.2.1 Service Discovery Mechanism Threats

3.2.1 サービスディスカバリメカニズムの脅威

The basic functions in a service discovery mechanism are:

サービスディスカバリメカニズムにおける基本機能は以下のとおりである:

•Service registration and de-registration.

•サービスの登録および登録解除。

•Service discovery.

•サービスディスカバリ。

The potential security threats to the service discovery mechanism include:

サービスディスカバリメカニズムに対する潜在的なセキュリティ脅威には以下が含まれる:

•Registering malicious nodes within the system, redirecting communication to them, and subsequently compromising service discovery.

•システム内に悪意のあるノードを登録し、それらへの通信をリダイレクトして、その結果としてサービスディスカバリを侵害すること。

•Corruption of the service registry database leading to redirection of service requests to wrong services and resulting in denial of services; also, redirection to malicious services resulting in compromise of the entire application system.

•サービスレジストリデータベースの破損により、サービスリクエストが誤ったサービスへリダイレクトされてサービス拒否(DoS)が発生すること。また、悪意のあるサービスへリダイレクトされてアプリケーションシステム全体が侵害されること。

3.2.2 Internet-based Attacks

3.2.2 インターネット経由の攻撃

Though all networked or distributed applications are vulnerable to internet-based attacks, microservices-based applications are more vulnerable to this type of attacks due to the following:

ネットワーク化されたアプリケーションや分散アプリケーションはすべてインターネット経由の攻撃に対して脆弱であるが、マイクロサービスベースのアプリケーションは以下の理由により、この種の攻撃に対してより脆弱である:

•Unlike a monolithic application that exposes a smaller set of IP-addressable remote procedure call interfaces, a microservices architecture will almost always expose a larger set of IP-addressable remote procedure call interfaces. This is due to the fact that monolithic applications favor single-component implementation of a range of business functions and typically expose a consolidated interface to them all. Applications

•IPアドレス指定可能なリモートプロシージャコール(RPC)インターフェースの公開数がより少ないモノリシックアプリケーションとは異なり、マイクロサービスアーキテクチャではほぼ常に、IPアドレス指定可能なリモートプロシージャコールインターフェースの公開数がより多くなります。これは、モノリシックアプリケーションが一連のビジネス機能を単一コンポーネントで実装することを重視し、通常それらすべてに対して集約されたインターフェースを公開するという事実によるものです。アプリケーション

15 employing a microservices architecture feature many smaller components that coordinate or connect over many interfaces.

15 マイクロサービスアーキテクチャを採用しているものは、多数のインターフェースを介して連携または接続する多数のより小さなコンポーネントを特徴とします。

•Microservices-based applications have increased risks due to inadvertent exposure of internal functionality, when security controls implemented for upstream components are skipped by directly accessing downstream components. The overall increased complexity of the system increases the chances a developer may omit a check because they can't reason about what conditions the caller has been subjected to.

•マイクロサービスベースのアプリケーションでは、ダウンストリームコンポーネントに直接アクセスすることでアップストリームコンポーネント向けに実装されたセキュリティ制御がスキップされた場合、内部機能が意図せず露出することによるリスクが増加します。システム全体の複雑さが増すことで、呼び出し元がどのような条件にさらされてきたかを開発者が推論できないため、チェックを省略してしまう可能性が高くなります。

This class of attacks includes botnet attacks. Though not the only means or being the only class of systems subject to botnet attacks, damage to microservices-based applications could include credential stuffing/abuse, accounts takeover, page scraping and harvesting data, and distributed denial of service.

この種の攻撃にはボットネット攻撃が含まれます。ボットネット攻撃を受ける手段もシステムの種類もこれに限られるわけではありませんが、マイクロサービスベースのアプリケーションへの被害には、クレデンシャルスタッフィング/不正使用、アカウントの乗っ取り、ページスクレイピングおよびデータのハーベスティング、ならびに分散サービス拒否(DDoS)が含まれる可能性があります。

3.2.3 Cascading Failure

3.2.3 連鎖障害

The presence of multiple components in a microservices-based application enhances the probability of a failure of a service. Though the components are designed to be loosely coupled from the point of view of deployment, there is a logical or functional dependency since many business transactions require the execution of multiple services in sequence to deliver the required outputs. Therefore, if a service that is upstream in the processing logic of a business transaction fails, other services that depend upon it may become unresponsive as well. This phenomenon is known as cascading failure.

マイクロサービスベースのアプリケーションに複数のコンポーネントが存在することは、サービスの障害が発生する確率を高めます。コンポーネントはデプロイの観点からは疎結合になるよう設計されているものの、多くのビジネストランザクションでは必要な出力を提供するために複数のサービスを順次実行する必要があるため、論理的または機能的な依存関係が存在します。したがって、ビジネストランザクションの処理ロジックにおいて上流にあるサービスに障害が発生した場合、それに依存する他のサービスも応答しなくなる可能性があります。この現象は連鎖障害(cascading failure)として知られています。

16

4 Security Strategies for Implementing Core Features and Countering Threats

4 コア機能の実装および脅威に対抗するためのセキュリティ戦略

Security strategies for the design and deployment of microservices-based application systems will span the following:

マイクロサービスベースのアプリケーションシステムの設計およびデプロイに関するセキュリティ戦略は、以下にわたるものとなる:

Analysis of implementation options for core features: (Some significant core state of practice features are shown in Appendix B).

コア機能の実装選択肢の分析:(実践状況における重要なコア機能のいくつかを付録Bに示します)。

a) Identity and access management, b) Service discovery, c) Secure communication protocols, d) Security monitoring, e) Resiliency or availability improvement techniques, and f) Integrity assurance improvement techniques.

a) アイデンティティおよびアクセス管理、b) サービスディスカバリ、c) セキュア通信プロトコル、d) セキュリティ監視、e) 耐障害性または可用性向上の技術、および f) 完全性保証向上の技術。

Countering microservices-specific threats:

マイクロサービス特有の脅威への対策:

a) Threats to service discovery mechanism, b) Internet-based attacks, and c) Cascading failures.

a) サービスディスカバリメカニズムに対する脅威、b) インターネットベースの攻撃、および c) 連鎖障害。

Note that service discovery is a core feature in microservices, and analysis of the implementation options will also take into consideration threats to service discovery mechanisms. Similarly, implementation options for resiliency or availability improvement will also address the counter measures for cascading failures. As such, there will not be separate security strategies for these items.

サービスディスカバリはマイクロサービスにおけるコア機能であり、実装オプションの分析ではサービスディスカバリメカニズムに対する脅威も考慮されることに留意すること。同様に、耐障害性や可用性の向上に向けた実装オプションでも、連鎖障害に対する対策が扱われます。そのため、これらの項目に対して個別のセキュリティ戦略は設けません。

4.1 Strategies for Identity and Access Management

4.1 アイデンティティおよびアクセス管理の戦略

Since microservices are packaged as APIs, the initial form of authentication to microservices involves the use of API keys (cryptographic). Authentication tokens encoded in Security Assertion Markup Language (SAML) or through OpenID connect under the OAuth 2.0 framework provide an option for enhancing security [14]. For authorization, a centralized architecture for provisioning and enforcement of access policies governing access to all microservices is required due to the sheer number of services, the implementation of services using APIs, and the need for service composition to support real-world business transactions (e.g., customer order processing and shipping). A standardized, platform-neutral method for conveying authorization decisions through a standardized token (e.g., JSON web tokens (JWT), some of which can be OAuth 2.0 access tokens encoded in JSON format [15]) is also required since each of the microservices may be implemented in a different language or platform framework. Policy provisioning and computation of access decisions require the use of an authorization server.

マイクロサービスはAPIとしてパッケージ化されているため、マイクロサービスに対する初期の認証形式には(暗号論的な)APIキーの使用が含まれます。Security Assertion Markup Language(SAML)でエンコードされた認証トークン、またはOAuth 2.0フレームワーク下でのOpenID Connectによる認証トークンは、セキュリティを強化するための選択肢を提供します [14]。認可に関しては、サービスの膨大な数、APIを使用したサービスの実装、そして現実世界のビジネストランザクション(例:顧客の注文処理や配送)をサポートするためのサービス構成の必要性から、すべてのマイクロサービスへのアクセスを管理するアクセスポリシーのプロビジョニングと適用を行う中央集約型アーキテクチャが必要とされます。また、各マイクロサービスが異なる言語やプラットフォームフレームワークで実装されている可能性があるため、標準化されたトークン(例:JSON Web Token(JWT)、その一部はJSON形式でエンコードされたOAuth 2.0アクセストークンになり得る [15])を介して認可決定を伝達するための標準化されたプラットフォーム中立の方法も必要です。ポリシーのプロビジョニングとアクセス決定の計算には、認可サーバーの使用が必要となります。

The disadvantage to implementing access control policies at the access point of each microservice is that additional effort is required to ensure that cross-cutting (common) policies applicable to all microservice APIs are implemented uniformly. Any discrepancy in security policy implementation among APIs will have security implications for the entire microservices-based application, although this applies only to coarse grained policies since fine grained policies can only be specified closer to the microservice or in the microservice itself. Further, the footprint for implementing access control in each microservices node can result in performance issues in some nodes. Since multiple microservices nodes collaborate to perform a transaction, performance problems associated with any node can quickly cascade across multiple services. Taking into consideration these requirements, the strategies for secure identity and access management to microservices are outlined below.

各マイクロサービスのアクセスポイントでアクセス制御ポリシーを実装することのデメリットは、すべてのマイクロサービスAPIに適用される横断的(共通)ポリシーが一律に実装されることを保証するために追加の労力が必要となる点です。セキュリティポリシーの実装にAPI間で不一致があれば、マイクロサービスベースのアプリケーション全体のセキュリティに影響が及びます。ただし、これが当てはまるのは粗粒度のポリシーのみです。きめ細かい粒度のポリシーは、マイクロサービスに近い位置、またはマイクロサービス自体の中でしか指定できないためです。さらに、各マイクロサービスノードにアクセス制御を実装するためのフットプリントが、一部のノードで性能上の問題を引き起こす可能性があります。複数のマイクロサービスノードが連携して1つのトランザクションを実行するため、いずれかのノードに関連する性能上の問題は、複数のサービスにまたがって急速に波及することがあります。これらの要件を考慮して、マイクロサービスに対するセキュアなアイデンティティ・アクセス管理の戦略を以下に概説します。

Security strategies for authentication (MS-SS-1):

認証のためのセキュリティ戦略(MS-SS-1):

•Authentication to microservices APIs that have access to sensitive data should not be done simply by using API keys. Access to such APIs should require authentication tokens that have either been digitally signed (e.g., client credentials grant) or is verified with an authoritative source. Additionally, some services may require either single-use tokens or short-lived tokens (tokens that expire after a short time period) to limit the damage a compromised token can cause.

原本PDFの抜粋画像原本 PDF p.26 の画像抜粋

•機密データにアクセスできるマイクロサービス API への認証は、単に API キーを使用するだけで行うべきではありません。そのような API へのアクセスには、デジタル署名されている(例:クライアントクレデンシャルグラント)か、信頼できる情報源によって検証される認証トークンを要求すべきです。さらに、危殆化したトークンが引き起こす被害を抑えるために、使い捨てトークンまたは有効期間の短いトークン(短時間で失効するトークン)のいずれかを要求すべきサービスもあります。

•Authentication tokens should be handle-based (where initially a token reference is sent to Relying party (RP)), cryptographically signed, or protected by an Hash-based Method Authentication Code (HMAC) scheme.

•認証トークンは、ハンドルベース(最初にトークン参照がリライングパーティ(RP)に送信される方式)、暗号学的に署名されたもの、またはハッシュベースメッセージ認証コード(HMAC)方式で保護されたものであるべきです。

•Every API Key that is used in the application should have restrictions specified both for the applications (e.g., mobile app, IP address) and the set of APIs where they can be used.

•アプリケーションで使用するすべての API キーには、アプリケーション(例:モバイルアプリ、IP アドレス)と、それらを使用できる API の集合の両方について制限を指定すべきです。

•The restriction scope for functionality of every API Key should be commensurate with the level of assurance provided during identity proofing, whether it be machine or human driven identity proofing.

•すべての API キーの機能に対する制限の範囲は、機械主導か人間主導かを問わず、身元確認(identity proofing)の際に提供される保証レベルに見合ったものであるべきです。

•When stateless authentication tokens (e.g., JSON Web Tokens (JWT)) are used by implementing shared libraries associated with a microservice, the following security precautions must be observed: (a) the token expiry times should be as short as possible since they determine the duration of the session and an active session cannot be revoked, and (b) the token secret key must not be a part of the library code; it must be a dynamic variable represented by an environmental variable or specified in an environment data file. The key value should be stored in a data vault solution.

•マイクロサービスに関連付けられた共有ライブラリを実装してステートレス認証トークン(例:JSON Web Token(JWT))を使用する場合、次のセキュリティ上の予防措置を遵守しなければなりません。(a) トークンの有効期限はセッションの継続期間を決定し、アクティブなセッションを失効させることはできないため、できる限り短くすべきです。(b) トークンの共通鍵をライブラリコードに含めてはなりません。それは環境変数で表されるか、環境データファイルで指定される動的変数でなければなりません。鍵の値はデータボールトソリューションに格納すべきです。

•If standards-based techniques such as OAuth or OpenID connect are implemented, they must be deployed securely [19].

•OAuthやOpenID Connectなどの標準ベースの技術を実装する場合、それらはセキュアに導入されなければなりません [19]。

Security strategies for access management (MS-SS-2):

アクセス管理のためのセキュリティ戦略(MS-SS-2):

•• Access policies to all APIs and their resources should be defined and provisioned to an access server. Access policies at a coarse level of granularity say “Permit to Call for a given set of addressable functionalities” should be defined and enforced at the initial API gateway while authorizations at the finer level of granularity (e.g., related to domain of the particular microservices’ business logic) should be defined and enforced closer to the location of the microservices (e.g., at the micro gateway) or sometimes at the microservice itself.

•• すべてのAPIおよびそのリソースに対するアクセスポリシーを定義し、アクセスサーバーにプロビジョニングすべきです。粗い粒度レベルのアクセスポリシー(たとえば「アドレス指定可能な機能の所定のセットに対する呼び出し許可」)は初期APIゲートウェイで定義および適用すべきであり、より細かい粒度レベルの認可(たとえば、特定のマイクロサービスのビジネスロジックのドメインに関連するもの)は、マイクロサービスの場所により近いところ(たとえば、マイクロゲートウェイ)で、または場合によってはマイクロサービス自体で定義および適用すべきです。

•Caching Mechanism: It may be appropriate to allow microservices to cache policy data; this cache should be only relied upon when an access server is unavailable and should expire after a duration appropriate for the environment/infrastructure.

•キャッシングメカニズム: マイクロサービスがポリシーデータをキャッシュできるようにすることが適切な場合があります。このキャッシュは、アクセスサーバーが利用できない場合にのみ依存すべきであり、環境/インフラストラクチャに適した期間の経過後に期限切れとなるべきです。

•The access server should be capable of supporting fine-grained policies.

•アクセスサーバーは、きめ細かなポリシーをサポートできるようにすべきです。

•Access decisions from the access server should be conveyed to individual and sets of microservices through standardized tokens encoded in a platform-neutral format (e.g., OAuth 2.0 token encoded in JSON format). The token can be either a handle-based token or an assertion bearing token.

•アクセスサーバーからのアクセス決定は、プラットフォーム中立な形式でエンコードされた標準化トークン(たとえば、JSON形式でエンコードされたOAuth 2.0トークン)を通じて、個々のマイクロサービスおよびマイクロサービスのセットに伝達されるべきです。トークンは、ハンドルベースのトークンまたはアサーション保持トークンのいずれかにすることができます。

•The scope of internal authorization tokens appended by the micro gateway or decision point to each request should be carefully controlled; for example, in a request for transaction, the internal authorization token should be limited in scope to only involve the API endpoints that must be accessed for that transaction.

•マイクロゲートウェイまたは判断ポイントが各リクエストに付加する内部認可トークンのスコープは、慎重に管理すべきです。たとえば、トランザクションのリクエストでは、内部認可トークンのスコープを、そのトランザクションでアクセスする必要のあるAPIエンドポイントのみに限定すべきです。

•The API gateway can be leveraged to centralize enforcement of authentication and access control for all downstream microservices, eliminating the need to provide authentication and access control for each of the individual services. If this design is chosen, any component suitably positioned on the network can make anonymous connections to the services bypassing the API gateway and its protections. Mitigating controls such as mutual authentication should be leveraged to prevent direct, anonymous connections to the services.

•APIゲートウェイを活用して、すべてのダウンストリームマイクロサービスに対する認証およびアクセス制御の適用を一元化し、個々のサービスごとに認証およびアクセス制御を提供するニーズを排除できます。この設計が選択された場合、ネットワーク上に適切に配置されたコンポーネントは、APIゲートウェイとその保護をバイパスして、サービスへの匿名接続を行うことができます。サービスへの直接的かつ匿名の接続を防止するために、相互認証などの緩和策を活用すべきです。

4.2 Strategies for Service Discovery Mechanism

4.2 サービスディスカバリメカニズムの戦略

Microservices may have to be replicated and located anywhere in the enterprise or cloud infrastructure for optimal performance and load balancing reasons. In other words, services could be frequently added or removed and dynamically assigned to any network location. Hence, it is inevitable in a microservices-based application architecture to have a service discovery mechanism, which is typically implemented using the service registry. The service registry service is used by microservices that are coming online to publish their locations in a process called service registration and is also used by microservices seeking to discover registered services. The service registry must therefore be configured with confidentiality, integrity, and availability considerations.

マイクロサービスは、最適な性能と負荷分散のために、複製して企業またはクラウドインフラストラクチャ内の任意の場所に配置する必要が生じる場合があります。言い換えれば、サービスは頻繁に追加または削除され、任意のネットワーク位置に動的に割り当てられる可能性があります。したがって、マイクロサービスベースのアプリケーションアーキテクチャでは、通常サービスレジストリを用いて実装されるサービスディスカバリの仕組みが不可欠となります。サービスレジストリサービスは、オンラインになるマイクロサービスがサービス登録と呼ばれるプロセスで自らの位置を公開するために使用され、登録済みサービスの探索にも使用されます。したがって、サービスレジストリは機密性、完全性、可用性を考慮して構成しなければなりません。

In service-oriented architectures (SOA), service discovery is implemented as part of the centralized enterprise service bus (ESB). However, in microservices architecture—where the business functions are packaged and deployed as services within containers and communicate with each other using API calls—it is necessary to implement a lightweight message bus that can implement all three interaction styles mentioned in Section 2.5. Additionally, alternatives to the ways in which service registry service can be implemented span two dimensions: (a) the way clients access the service registry service and (b) centralized versus distributed service registry. Clients can access the service registry service using two primary methods: client-side discovery pattern and server-side discovery pattern [9].

サービス指向アーキテクチャ(SOA)では、サービスディスカバリーは、集中型のエンタープライズサービスバス(ESB)の一部として実装されます。しかし、業務機能がコンテナ内のサービスとしてパッケージ化・展開され、API呼び出しによって相互に通信するマイクロサービスアーキテクチャでは、2.5節で述べた3つのインタラクションスタイルすべてを実装できる軽量なメッセージバスを実装する必要があります。さらに、サービスレジストリのサービスの実装方法には、(a) クライアントがサービスレジストリのサービスにアクセスする方法、(b) 集中型か分散型かのサービスレジストリ、という2つの観点での選択肢があります。クライアントがサービスレジストリのサービスにアクセスする主な方法は、クライアントサイドディスカバリーパターンとサーバーサイドディスカバリーパターンの2つです [9]。

Analysis of the client-side service discovery pattern

クライアントサイドのサービスディスカバリーパターンの分析

The client-side option consists of building registry-aware clients. The client queries the service registry for the location of all services needed to make requests. It then contacts the target service directly. Though simple, this implementation option for service discovery requires the discovery logic (querying the service registry) to be implemented for each programming language and/or framework that is used for client implementations.

クライアント側の選択肢は、レジストリを認識するクライアントを構築することから構成されます。クライアントは、リクエストを行うために必要なすべてのサービスの場所についてサービスレジストリに問い合わせを行います。その後、ターゲットサービスに直接接続します。単純ではあるものの、サービス検出のためのこの実装オプションでは、クライアントの実装に使用されるプログラミング言語やフレームワークごとに、検出ロジック(サービスレジストリへの問い合わせ)を実装する必要があります。

Analysis of the service-side service discovery pattern

サービスサイドのサービスディスカバリーパターンの分析

The service-side discovery has two implementations: one pattern delegates the discovery logic to a dedicated router service set at a fixed location, while the other utilizes a server in front of each microservice with the functionality of a dynamic Domain Name System (DNS)-resolver (which works with a Domain Name System Security Extensions (DNSSSEC) authoritative server)). In the dedicated router option, the client makes all service requests to this dedicated router service, which in turn queries the service registry for the location of the client-requested service and forwards that request to the discovered location. This removes the tight coupling between an application service and an infrastructure service such as the service registry service. In the DNS resolver pattern, each microservice completes its own service discovery using its built-in DNS resolver to query the service registry. The DNS resolver maintains a table of available service instances and their endpoint locations (i.e., IP addresses). To keep the table up to date, the asynchronous, nonblocking DNS resolver queries the service registry regularly—perhaps every few seconds—using DNS Service records (e.g., Service Resource Records (SRV RRs)) for service discovery. Since the service discovery function through the DNS resolver runs as a background task, the endpoints (URLs) for all peer microservices are instantly available when a service instance needs to make a request [2].

サービス側の検出には2つの実装があります。1つのパターンは固定された場所に配置された専用ルーターサービスに検出ロジックを委任し、もう1つのパターンは動的なDomain Name System (DNS) リゾルバー(Domain Name System Security Extensions (DNSSSEC) 権威サーバーと連携する)の機能を備えたサーバーを各マイクロサービスの前面で利用します。専用ルーターの選択肢では、クライアントはすべてのサービスリクエストをこの専用ルーターサービスに対して行い、専用ルーターサービスはクライアントが要求したサービスの場所についてサービスレジストリに問い合わせを行い、検出された場所にそのリクエストを転送します。これにより、アプリケーションサービスと、サービスレジストリサービスなどのインフラストラクチャサービスとの間の密結合が排除されます。DNSリゾルバーパターンでは、各マイクロサービスがサービスレジストリに問い合わせるために内蔵のDNSリゾルバーを使用して、自身のサービス検出を完了します。DNSリゾルバーは、利用可能なサービスインスタンスおよびそれらのエンドポイントの場所(すなわちIPアドレス)のテーブルを維持します。テーブルを最新の状態に維持するために、非同期・ノンブロッキングDNSリゾルバーは、サービス検出のためにDNSサービスレコード(例えば、Service Resource Records (SRV RRs))を使用して、定期的(おそらく数秒ごと)にサービスレジストリに問い合わせを行います。DNSリゾルバーによるサービス検出機能はバックグラウンドタスクとして実行されるため、サービスインスタンスがリクエストを行う必要がある場合に、すべてのピアマイクロサービスのエンドポイント(URL)を即座に利用できます [2]。

A good strategy would be to use a combination of the service-side service discovery pattern and the client-side service discovery pattern [9]. The former can be used for providing access to all public APIs, while the latter can allow clients to access all cluster-internal interactions.

原本PDFの抜粋画像原本 PDF p.28 の画像抜粋

優れた戦略としては、サービス側サービス検出パターンとクライアント側サービス検出パターンの組み合わせを使用することでしょう [9]。前者はすべてのパブリックAPIへのアクセスを提供するために使用でき、後者はクライアントがクラスター内部のすべての相互作用にアクセスできるようにすることができます。

Centralized versus distributed service registry

集中型サービスレジストリと分散型サービスレジストリ

In a centralized service registry implementation, all services wishing to publish their service register at a single point, and all services seeking these services use the single registry to discover them. The security disadvantage of this pattern is the single point of failure [13]. However, data consistency will not be an issue. In the decentralized service registry, there may be multiple service registry instances, and services can register with any of the instances. In the short term, the disadvantage is that there will be data inconsistency between the various service registries. Eventually, consistency among these various instances of service registry is achieved either through broadcasting from one instance to all others or by propagation from one node to all others via attached data in a process called piggybacking.

原本PDFの抜粋画像原本 PDF p.28 の画像抜粋

集中型サービスレジストリの実装では、自らのサービスを公開したいすべてのサービスが単一のポイントに登録し、これらのサービスを探しているすべてのサービスが単一のレジストリを使用してそれらを検出します。このパターンのセキュリティ上の短所は、単一障害点です [13]。ただし、データ整合性は問題になりません。分散型サービスレジストリでは、複数のサービスレジストリインスタンスが存在する可能性があり、サービスはいずれのインスタンスにも登録できます。短期的には、さまざまなサービスレジストリ間でデータの不整合が生じるという短所があります。最終的には、これらさまざまなサービスレジストリインスタンス間の整合性は、1つのインスタンスから他のすべてのインスタンスへのブロードキャスト、またはピギーバッキングと呼ばれるプロセスにおいて付加されたデータを介した1つのノードから他のすべてのノードへの伝播のいずれかによって達成されます。

Regardless of the pattern used for service discovery, secure deployment of service discovery functions should meet the following service registry configuration requirements.

サービスディスカバリに使用されるパターンにかかわらず、サービスディスカバリ機能の安全なデプロイは、以下のサービスレジストリ構成要件を満たすべきです。

Security strategies for service registry configuration (MS-SS-3)

サービスレジストリ構成のためのセキュリティ戦略(MS-SS-3)

•Service registry capabilities should be provided through servers that are either dedicated or part of a service mesh architecture.

•サービスレジストリ機能は、専用サーバー、またはサービスメッシュアーキテクチャの一部であるサーバーを介して提供されるべきです。

•Service registry services should be in a network that has been configured with certain Quality of Service (QoS) parameters to ensure its availability and resilience.

•サービスレジストリのサービスは、その可用性と耐障害性を確保するために、特定のQuality of Service(QoS)パラメータで構成されたネットワーク内に存在すべきです。

•Communication between an application service and a service registry should occur through a secure communication protocol such as HTTPS or Transport Layer Security (TLS).

•アプリケーションサービスとサービスレジストリ間の通信は、HTTPSやTransport Layer Security(TLS)などのセキュアな通信プロトコルを介して行われるべきです。

•Service registry should have validation checks to ensure that only legitimate services are performing the registration, refresh operations, and database queries to discover services.

•サービスレジストリには、正当なサービスのみが登録、更新操作、およびサービス検出のためのデータベースクエリを実行していることを確認するための検証チェックが備わっているべきです。

•The bounded context and loose coupling principle for microservices should be observed for the service registration/deregistration functions. In other words, the application service should not have tight coupling with an infrastructure service, such as a service registry service, and service self-registration/deregistration patterns should be avoided. When an application service crashes or is running but unable to handle requests, its inability to perform deregistration affects the integrity of the whole process. Therefore, registration/deregistration of an application service should be enabled using a third-party registration pattern, and the application service should be restricted to querying the service registry for service location information as described under the client-side discovery pattern.

•サービスの登録/登録解除機能については、マイクロサービスにおける境界づけられたコンテキスト(bounded context)および疎結合の原則を遵守すべきです。言い換えれば、アプリケーションサービスはサービスレジストリサービスなどのインフラストラクチャサービスと密結合すべきではなく、サービスの自己登録/自己登録解除パターンは回避すべきです。アプリケーションサービスがクラッシュした場合、または稼働中であってもリクエストを処理できない場合、登録解除を実行できないことがプロセス全体の整合性に影響を与えます。したがって、アプリケーションサービスの登録/登録解除はサードパーティ登録パターンを使用して有効化すべきであり、アプリケーションサービスは、クライアントサイドディスカバリパターンで説明されているように、サービス位置情報をサービスレジストリに問い合わせることのみに制限されるべきです。

•If a third-party registration pattern is implemented, registration/deregistration should only take place after a health check on the application service is performed.

•サードパーティ登録パターンが実装されている場合、登録/登録解除は、アプリケーションサービスのヘルスチェックが実行された後にのみ行われるべきです。

•Distributed service registry should be deployed for large microservices applications, and care should be taken to maintain data consistency among multiple service registry instances.

•大規模なマイクロサービスアプリケーションでは分散型サービスレジストリをデプロイすべきであり、複数のサービスレジストリインスタンス間でデータの一貫性を維持するよう配慮すべきです。

4.3 Strategies for Secure Communication Protocols

4.3 安全な通信プロトコルのための戦略

Secure communication between clients and services (north-south traffic) and between services (east-west traffic) is critical for the operation of a microservices-based application.

原本PDFの抜粋画像原本 PDF p.29 の画像抜粋

クライアントとサービス間(南北トラフィック)およびサービス間(東西トラフィック)の安全な通信は、マイクロサービスベースのアプリケーションの運用にとって極めて重要です。

However, certain strategies for security services—such as authentication or the establishment of secure connections—can be handled at the individual microservices nodes. For example, in the fabric model, each microservice instance has the capability to function as an Secure Sockets Layer (SSL) client and SSL server (i.e., each microservice is an SSL/TLS endpoint). Thus, a secure SSL/TLS connection is possible for interservice or inter-process communication from an overall application perspective. These connections can be created dynamically (i.e., before each interservice request) or be created as a keep-alive connection. In the keep-alive connection scheme, a “service A” creates a connection after a full SSL/TLS handshake—the first time an instance of that service makes a request to an instance of a “service B.” However, neither service instances terminate the connection after a response returns for that request from service B. Rather, the same connection is reused in future requests. The advantage of this scheme is that the costly overhead involved in performing the initial SSL/TLS handshake can be avoided during each request, and an existing connection can be reused for thousands of following interservice requests. Thus, a permanent secure interservice network connection is available for all instances of requests.

ただし、認証やセキュアな接続の確立など、セキュリティサービスのための一部の戦略は、個々のマイクロサービスノードで処理できます。たとえば、ファブリックモデルでは、各マイクロサービスインスタンスがSecure Sockets Layer(SSL)クライアントおよびSSLサーバーとして機能する能力を持ちます(すなわち、各マイクロサービスがSSL/TLSエンドポイントです)。したがって、アプリケーション全体の観点から、サービス間通信またはプロセス間通信にセキュアなSSL/TLS接続を用いることができます。これらの接続は、動的に(すなわち、各サービス間リクエストの前に)作成することも、キープアライブ接続として作成することもできます。キープアライブ接続方式では、「サービスA」のインスタンスが「サービスB」のインスタンスに初めてリクエストを送る際に、完全なSSL/TLSハンドシェイクを経て接続を作成します。しかし、サービスBからそのリクエストへの応答が返された後も、どちらのサービスインスタンスも接続を終了しません。代わりに、同じ接続が以降のリクエストで再利用されます。この方式の利点は、最初のSSL/TLSハンドシェイクに伴う高コストのオーバーヘッドを各リクエストで避けられること、および既存の接続を後続の数千件のサービス間リクエストに再利用できることです。したがって、すべてのリクエストに対して、恒久的なセキュアなサービス間ネットワーク接続を利用できます。

Security strategies for secure communication (MS-SS-4)

安全な通信のためのセキュリティ戦略(MS-SS-4)

•Clients should not be configured to call target services directly but rather to point to the single gateway URL.

•クライアントはターゲットサービスを直接呼び出すように構成するのではなく、単一のゲートウェイURLを指すように構成すべきです。

•Client to API gateway as well as Service to Service communication should take place after mutual authentication and be encrypted (e.g., using mutual TLS (mTLS) protocol).

•クライアントからAPIゲートウェイへの通信、およびサービス間の通信は、相互認証の後に行われ、暗号化されるべきである(例:相互TLS(mTLS)プロトコルを使用)。

•Frequently interacting services should create keep-alive TLS connections.

•頻繁に対話するサービスは、キープアライブTLS接続を作成すべきです。

4.4 Strategies for Security Monitoring

4.4 セキュリティ監視の戦略

Compared to monitoring a monolithic application which runs in a server (or some replicas for load balancing), a microservices-based system must monitor a large number of services, each running in different servers possibly hosted on heterogeneous application platforms. Further, any meaningful transaction in the system will involve at least two or more services.

1台のサーバー(または負荷分散用のいくつかのレプリカ)で動作するモノリシックなアプリケーションの監視と比較して、マイクロサービスベースのシステムでは、異種アプリケーションプラットフォームでホストされている可能性がある異なるサーバーでそれぞれ動作する多数のサービスを監視しなければなりません。さらに、システム内の意味のあるトランザクションには、少なくとも2つ以上のサービスが関与することになります。

Security strategies for security monitoring (MS-SS-5)

セキュリティ監視のセキュリティ戦略(MS-SS-5)

•Security monitoring should be performed at both the gateway and service level to detect, alert and respond to inappropriate behavior, for example a bearer token reuse attack and injection attacks. Further, input validation errors and extra parameters errors, crashes and core dumps must be logged. A class of software that can accomplish this is the Open Webapplication Service Project ((OWASP). AppSensor which could be potentially implemented in the gateway, service mesh and microservice itself.

•ベアラートークンの再利用攻撃やインジェクション攻撃などの不適切な動作を検知、警告、および対応するために、セキュリティ監視はゲートウェイとサービスの両方のレベルで実行されるべきです。さらに、入力検証エラーや余分なパラメータのエラー、クラッシュ、コアダンプはログに記録されなければなりません。これを達成できるソフトウェアのクラスとしては、ゲートウェイ、サービスメッシュ、およびマイクロサービス自体に実装できる可能性があるOpen Webapplication Service Project((OWASP). AppSensorがあります。

•A central dashboard displays the status of various services and the network segments that link them. At a minimum, the dashboard should show security parameters such as input validation failures and unexpected parameters that are obvious signs of injection attack attempts.

•中央ダッシュボードには、さまざまなサービスおよびそれらをリンクするネットワークセグメントのステータスが表示されます。最低限、ダッシュボードには、インジェクション攻撃の試みの明白な兆候である入力検証の失敗や予期しないパラメータなどのセキュリティパラメータが表示されるべきです。

•A baseline for normal, uncompromised behavior in terms of the outcome of business logic decisions, contact attempts, and other behavior should be created. The placement and capabilities of Intrusion Detection System (IDS) nodes should be such that deviations from this baseline can be detected.

•ビジネスロジックの決定結果、接触の試み、およびその他の挙動の観点から、侵害されていない正常な挙動のベースラインを作成すべきです。侵入検知システム(IDS)ノードの配置と機能は、このベースラインからの逸脱を検知できるようなものであるべきです。

4.5 Availability/Resiliency Improvement Strategies

4.5 可用性/耐障害性(レジリエンス)向上の戦略

In microservices-based applications, targeted efforts that improve the availability or resiliency of certain critical services are needed to enhance the overall security profile of the application. Some technologies that are commonly deployed include:

マイクロサービスベースのアプリケーションでは、アプリケーション全体のセキュリティプロファイルを強化するために、特定の重要なサービスの可用性または耐障害性を向上させる的を絞った取り組みが必要です。一般的に導入されているテクノロジーには、以下のものがある:

•Circuit breaker function,

•サーキットブレーカー機能、

•Load balancing, and

•ロードバランシング、および

•Rate limiting (throttling).

•レート制限(スロットリング)。

22

4.5.1 Analysis of Circuit Breaker implementation options

4.5.1 サーキットブレーカーの実装オプションの分析

A common strategy for preventing or minimizing cascading failures involves the use of circuit breakers, which prohibits the delivery of data to the component (microservice) that is failing beyond a specified threshold. This is also known as the fail fast principle. Since the errant service is quickly taken offline, incidences of cascading failures are minimized while the errant component’s logs are analyzed, required fixes are performed, and microservices are updated. There are three options for deploying circuit breakers [9]: directly inside the client, on the side of services, or in proxies that operate between clients and services.

連鎖的な障害を防止または最小限に抑えるための一般的な戦略には、サーキットブレーカーの使用が含まれます。これにより、指定されたしきい値を超えて障害が発生しているコンポーネント(マイクロサービス)へのデータの配信が禁止されます。これはフェイルファスト原則としても知られています。異常なサービスは迅速にオフラインにされるため、異常なコンポーネントのログが分析され、必要な修正が実行され、マイクロサービスが更新されている間、連鎖的な障害の発生は最小限に抑えられます。サーキットブレーカーを配備するには、クライアント内部に直接配備する、サービス側に配備する、あるいはクライアントとサービスの間で動作するプロキシに配備するという3つのオプションがあります [9]。

Client-side circuit breaker option: In this option, each client has a separate circuit breaker for each external service that the client calls. When the circuit breaker in a client has decided to cut off calls to a service (called “open state” with respect to that service), no message will be sent to the service, and communication traffic in the network is subsequently reduced. Moreover, the circuit breaker functionality need not be implemented in the microservice, which frees valuable resources for efficient implementation of that service. However, locating the circuit breaker in the client carries two disadvantages from a security point of view. First, a great deal of trust must be placed in the client that the circuit breaker code executes properly. Second, the overall integrity of the operation is at risk since knowledge of the unavailability of the service is very much local to the client, a status that is determined based on the frequency of calls from that client to the service rather than on the combined response status received by all clients against that service.

クライアント側サーキットブレーカーのオプション:このオプションでは、各クライアントが、自身が呼び出す外部サービスごとに個別のサーキットブレーカーを持ちます。クライアント内のサーキットブレーカーがサービスへの呼び出しを遮断することを決定した場合(そのサービスに関して「オープン状態」と呼ばれる)、そのサービスにはメッセージが送信されず、ネットワーク内の通信トラフィックはその後削減されます。さらに、サーキットブレーカー機能をマイクロサービス内に実装する必要がないため、そのサービスの効率的な実装のために貴重なリソースが解放されます。しかし、サーキットブレーカーをクライアントに配置することには、セキュリティの観点から2つの欠点があります。第1に、サーキットブレーカーのコードが適切に実行されるという大きな信頼をクライアントに置かなければなりません。第2に、サービスの利用不能に関する知識はほぼ完全にクライアント固有のものであり、そのサービスに対してすべてのクライアントが受信した統合された応答ステータスではなく、そのクライアントからサービスへの呼び出し頻度に基づいて判断されるステータスであるため、運用の全体的な整合性が危機に瀕します。

Server-side circuit breaker option: In this option, an internal circuit breaker in the microservice processes all client invocations and decides whether it should be allowed to invoke the service or not. The security advantages of this option are that clients need not be trusted to implement the circuit breaker function, and since the service has a global picture of the frequency of all invocations from all clients, it can throttle requests to a level which it can conveniently handle (e.g., temporarily lighten the load).

サーバー側サーキットブレーカーのオプション:このオプションでは、マイクロサービス内の内部サーキットブレーカーがすべてのクライアントからの呼び出しを処理し、サービスへの呼び出しを許可すべきかどうかを決定します。このオプションのセキュリティ上の利点は、サーキットブレーカー機能を実装するにあたってクライアントを信頼する必要がないこと、およびサービスはすべてのクライアントからの全呼び出し頻度の全体像を把握しているため、自身が都合よく処理できるレベルにリクエストをスロットル(制限)できる(例:一時的に負荷を軽減する)ことです。

Proxy circuit breaker option: In this option, circuit breakers are deployed in a proxy service, located between clients and microservices, which handles all incoming and outgoing messages. Within this, there may be two options: one proxy for each target microservice or a single proxy for multiple services (usually implemented in API gateway) that includes both client-side circuit breakers and service-side circuit breakers existing within that proxy. The security advantage of this option is that neither the client code nor the services code needs to be modified, which avoids trust and integrity assurance issues associated with both these categories of code as well as the circuit breaker function. This option also provides additional protections such as making clients more resilient to faulty services, and shielding services from cases in which a single client sends too many requests [9], resulting in some type of denial of service to other clients that use that service.

プロキシサーキットブレーカーオプション:このオプションでは、クライアントとマイクロサービス間に配置され、すべての送受信メッセージを処理するプロキシサービスにサーキットブレーカーが配備されます。この中には2つの選択肢が考えられます。各対象マイクロサービスに1つのプロキシを配置するか、複数のサービスに対して単一のプロキシ(通常はAPIゲートウェイに実装)を配置し、そのプロキシ内にクライアント側サーキットブレーカーとサービス側サーキットブレーカーの両方が存在するようにするかのいずれかです。このオプションのセキュリティ上の利点は、クライアントコードもサービスコードも変更する必要がないことであり、これにより、これら両方のカテゴリのコードに関連する信頼および完全性保証の課題、ならびにサーキットブレーカー機能に関連する課題が回避されます。また、このオプションは、クライアントに障害が発生したサービスに対する耐性を高めさせたり、単一のクライアントが過剰なリクエストを送信して[9]、そのサービスを使用する他のクライアントに対する何らかのサービス拒否を引き起こすようなケースからサービスを保護したりするなど、追加の保護も提供します。

Security strategies for implementing circuit breakers (MS-SS-6)

サーキットブレーカー実装のためのセキュリティ戦略(MS-SS-6)

•A proxy circuit breaker option should be deployed to limit the trusted component to the proxy. This avoids the need to place the trust on the clients and microservices (e.g., setting thresholds and cutting off requests based on the set threshold) since they are multiple components.

•信頼されるコンポーネントをプロキシに限定するために、プロキシサーキットブレーカーオプションを配備すべきです。クライアントやマイクロサービスは複数のコンポーネントであるため、これによってそれらに信頼を置く必要性(例えば、しきい値を設定し、設定されたしきい値に基づいてリクエストを遮断するなど)が回避されます。

4.5.2 Strategies for Load Balancing

4.5.2 負荷分散のための戦略

Load balancing is an integral functional module in all microservices-based applications, and its main purpose is to distribute loads to services. A service name is associated with a namespace that supports multiple instances of the same service. In other words, many instances of the same service would use the same namespace [13]. To balance the service load, the load balancer chooses one service instance in the request namespace using an algorithm such as the round-robin algorithm—a circular pattern to assign the request to a service instance.

原本PDFの抜粋画像原本 PDF p.32 の画像抜粋

負荷分散は、すべてのマイクロサービスベースのアプリケーションにおいて不可欠な機能モジュールであり、その主な目的はサービスに負荷を分散させることです。サービス名は、同一サービスの複数のインスタンスをサポートする名前空間に関連付けられています。言い換えれば、同一サービスの多数のインスタンスが同じ名前空間を使用することになります[13]。サービスの負荷を分散するために、ロードバランサーは、リクエストの名前空間内から1つのサービスインスタンスを、リクエストをサービスインスタンスに割り当てる循環方式であるラウンドロビンアルゴリズムなどを用いて選択します。

Security strategies for load balancing (MS-SS-7)

負荷分散のためのセキュリティ戦略(MS-SS-7)

•All programs supporting the load balancing function should be decoupled from individual service requests. For example, the program that performs health checks on services to determine the load balancing pool should run asynchronously in the background.

•負荷分散機能をサポートするすべてのプログラムは、個々のサービスリクエストから分離されるべきです。例えば、負荷分散プールを決定するためにサービス上でヘルスチェックを実行するプログラムは、バックグラウンドで非同期に実行されるべきです。

•Care must be taken to protect the network connection between the load balancer and the microservice platform.

•ロードバランサーとマイクロサービスプラットフォーム間のネットワーク接続を保護するために注意を払う必要があります。

•When a DNS resolver is deployed in front of a source microservice to provide a table of available target microservice instances, it should work in tandem with the health check program to present a single list to the calling microservice.

•利用可能なターゲットマイクロサービスインスタンスのテーブルを提供するために送信元マイクロサービスの前段にDNSリゾルバーが配置される場合、呼び出し元のマイクロサービスに単一のリストを提示するために、ヘルスチェックプログラムと連携して動作すべきです。

4.5.3 Rate Limiting (Throttling)

4.5.3 レート制限(スロットリング)

The primary goal of rate limiting is to ensure that a service is not oversubscribed impacting availability. That is, when one client increases the rate of requests, the service continues its response to other clients. This is achieved by setting a limit on how often a client can call a service within a defined window of time. When the limit is exceeded, the client—rather than receiving an application-related response—receives a notification that the allowed rate has been exceeded as well as additional data regarding the limit number and the time at which the limit counter will be reset for the requestor to resume receiving responses. A secondary goal of rate limiting is to mitigate the impact of Denial of Service attacks. Closely related to the concept of rate limiting is quota management or conditional rate limiting where limits are determined based on application requirements rather than infrastructure limitations or requirements.

レート制限の主な目的は、サービスが過剰に利用されて可用性に影響が及ばないようにすることです。すなわち、あるクライアントがリクエストのレートを上げた場合でも、サービスは他のクライアントへの応答を継続します。これは、定義された時間枠内でクライアントがサービスを呼び出せる頻度に制限を設けることで達成されます。制限を超過した場合、クライアントはアプリケーション関連の応答を受け取るのではなく、許可されたレートを超過したという通知と、制限数、およびリクエスト元が応答の受信を再開できるよう制限カウンターがリセットされる時刻に関する追加データを受け取ります。レート制限の副次的な目的は、DoS(Denial of Service)攻撃の影響を緩和することです。レート制限の概念と密接に関連しているのがクォータ管理または条件付きレート制限であり、ここではインフラストラクチャの制限や要件ではなく、アプリケーションの要件に基づいて制限が決定されます。

Security strategies for rate limiting (MS-SS-8)

レート制限のセキュリティ戦略 (MS-SS-8)

•Quotas or limits for application usage should be based on both infrastructure and application-related requirements.

•アプリケーション使用のクォータまたは制限は、インフラストラクチャとアプリケーション関連の両方の要件に基づくべきです。

•Limits should be determined based on well-defined API usage plans.

•制限は、明確に定義されたAPI使用計画に基づいて決定されるべきです。

•For high security microservices, replay detection must be implemented. Based on the risk, this feature can be configured to detect replays 100 % of the time or perform random detection.

•高セキュリティのマイクロサービスでは、リプレイ検出を実装しなければなりません。リスクに基づいて、この機能は100 %の確率でリプレイを検出するか、ランダムな検出を実行するように構成できます。

4.6 Integrity Assurance Strategies

4.6 完全性保証戦略

Integrity assurance requirements in the context of microservices-based applications arise under two contexts:

マイクロサービスベースのアプリケーションの文脈における完全性保証の要件は、以下の2つの状況で生じます。

•When new versions of microservices are inducted into the system.

•マイクロサービスの新しいバージョンがシステムに導入される場合。

•For supporting session persistence during a transaction.

•トランザクション中のセッション持続性をサポートする場合。

Monitored induction of new releases: Whenever a newer version of a microservice is released, its induction must be a gradual process since (a) all clients may not be ready to use the new version, and (b) the behavior of the new version for all scenarios and use cases may not meet the business process expectation despite extensive testing. To address this situation, a technique called canary release is often adopted [4]. Under this technique, only a limited number of requests are routed to the new version after it is brought online, and the rest are routed to the existing operational version. After a period of observation provides assurance that the new version meets performance and integrity metrics, all of the requests are routed to the new version.

新リリースの監視下での導入:マイクロサービスの新しいバージョンがリリースされる際は常に、(a) すべてのクライアントが新しいバージョンを使用する準備が整っていない可能性があり、(b) 広範なテストにもかかわらず、すべてのシナリオやユースケースに対する新しいバージョンの動作がビジネスプロセスの期待を満たさない可能性があるため、その導入は段階的なプロセスでなければなりません。この状況に対処するために、カナリアリリースと呼ばれる手法がしばしば採用されます [4]。この手法では、新しいバージョンがオンラインになった後、限定された数のリクエストのみが新しいバージョンにルーティングされ、残りは既存の運用バージョンにルーティングされます。観察期間によって新しいバージョンがパフォーマンスおよび完全性の指標を満たしているという確証が得られた後、すべてのリクエストが新しいバージョンにルーティングされます。

Security (integrity assurance) strategies for the induction of new versions of microservices (MS-SS-9):

マイクロサービスの新しいバージョンの導入に関するセキュリティ(完全性保証)戦略(MS-SS-9):

•The traffic to both the existing version and the new version of the service should be routed through a central node, such as an API gateway, to monitor that the blue/green transition occurs in a controlled manner and to monitor the risk associated with a canary release. Security monitoring should cover nodes hosting both the existing and newer versions.

•ブルー/グリーン移行が制御された方法で行われることを監視し、カナリアリリースに関連するリスクを監視するために、サービスの既存バージョンと新バージョンの両方へのトラフィックは、APIゲートウェイなどの中心ノードを経由してルーティングされるべきです。セキュリティ監視は、既存バージョンと新バージョンの両方をホストするノードを対象とすべきです。

•Usage monitoring of the existing version should steadily increase traffic to the new version.

•既存バージョンの利用状況の監視により、新バージョンへのトラフィックを着実に増加させるべきです。

•The performance and functional correctness of the new version should be factors in increasing traffic to the new version.

•新バージョンのパフォーマンスおよび機能的な正確性は、新バージョンへのトラフィックを増加させる要因となるべきです。

•Client preference for the version (existing or new) should be taken into consideration while designing a canary release technique.

•カナリアリリース手法を設計する際には、バージョン(既存または新規)に対するクライアントの選好を考慮に入れるべきです。

Session persistence: It is critical to send all requests in a client session to the same upstream microservice instance since clients execute a complete transaction through multiple requests to a specific service, and the target of all requests should be to the same upstream service instance in that session. This requirement is called session persistence. A situation that could potentially break this requirement is one wherein the microservice stores its state locally, and the load balancer handling individual requests forwards a request from an in-progress user session to a different microservice server or instance. One of the methods for implementing session persistence is sticky cookie. In this method, there is a mechanism to add a session cookie to the first response from the upstream microservice group to a given client, identifying (in an encoded fashion) the server that generated the response. Subsequent requests from the client include the cookie value, and the same mechanism uses it to route the request to the same upstream server [16].

セッション維持(Session persistence):クライアントは特定のサービスに対する複数のリクエストを通じて完全なトランザクションを実行し、そのセッション内のすべてのリクエストのターゲットは同一の上流サービスインスタンスとすべきであるため、クライアントセッション内のすべてのリクエストを同一の上流マイクロサービスインスタンスに送信することが極めて重要です。この要件はセッション維持と呼ばれます。この要件を破る可能性がある状況としては、マイクロサービスが自身の状態をローカルに保存しており、個々のリクエストを処理するロードバランサーが進行中のユーザーセッションからのリクエストを別のマイクロサービスサーバーまたはインスタンスに転送してしまうケースが挙げられます。セッション維持を実装するための手法の1つにスティッキーCookie(sticky cookie)があります。この手法では、上流のマイクロサービスグループから特定のクライアントへの最初のレスポンスにセッションCookieを追加し、レスポンスを生成したサーバーを(エンコードされた形式で)識別するメカニズムが存在します。クライアントからの後続のリクエストにはそのCookie値が含まれ、同一のメカニズムがそれを使用してリクエストを同一の上流サーバーにルーティングします [16]。

Security (integrity assurance) strategies for handling session persistence (MS-SS-10):

セッション維持を処理するためのセキュリティ(完全性保証)戦略(MS-SS-10):

•The session information for a client must be stored securely.

•クライアントのセッション情報は安全に保存されなければなりません。

•The artifact used for conveying the binding server information must be protected.

•バインディングサーバー情報を伝達するために使用されるアーティファクトは保護されなければなりません。

•Internal authorization tokens must not be provided back to the user, and the user's session tokens must not be passed beyond the gateway for use in policy decisions.

•内部認可トークンをユーザーに返却してはならず、ポリシー決定で使用するためにユーザーのセッショントークンをゲートウェイを越えて渡してはなりません。

4.7 Countering Internet-based Attacks

4.7 インターネットベースの攻撃への対抗

Though it is impossible to protect against all types of Internet-based attacks including botnets, microservice APIs must be provided with detection and prevention capabilities against credential-stuffing and credential abuse attacks as well as the capability to detect malicious botnets. This is especially critical for those applications where each of the microservices are independently callable and carry their own sets of credentials. Credential abuse attacks can be detected using offline threat analysis or run-time solutions [17]. Detection of botnet attacks is provided by a dedicated bot manager product or as an add-on feature in web application firewalls (WAF).

ボットネットを含むあらゆる種類のインターネットベースの攻撃から保護することは不可能であるものの、マイクロサービスAPIには、悪意のあるボットネットを検出する機能に加えて、クレデンシャルスタッフィングおよびクレデンシャル不正使用攻撃に対する検出および防止機能を備える必要があります。これは、各マイクロサービスが独立して呼び出し可能であり、独自のクレデンシャルセットを保持しているアプリケーションにおいて特に極めて重要です。クレデンシャル不正使用攻撃は、オフラインの脅威分析またはランタイムソリューションを使用して検出できます [17]。ボットネット攻撃の検出は、専用のボットマネージャー製品によって、またはWebアプリケーションファイアウォール(WAF)のアドオン機能として提供されます。

Security strategies for preventing credential abuse and stuffing attacks (MS-SS-11):

クレデンシャル不正使用およびスタッフィング攻撃を防止するためのセキュリティ戦略(MS-SS-11):

•A run-time prevention strategy for credential abuse is preferable to an offline strategy. A threshold for a designated time interval from a given location (e.g., IP address) for the number of login attempts should be established; if the threshold is exceeded, preventive measures must be triggered by the authentication/authorization server. This feature must be present when a bearer token is used, to detect its reuse and enforce prevention.

•クレデンシャル不正使用に対するランタイム防止戦略は、オフライン戦略よりも望まれます。特定の場所(例:IPアドレス)からの指定された時間間隔におけるログイン試行回数のしきい値を設定すべきです。しきい値を超えた場合、認証/認可サーバーによって防止策がトリガーされなければなりません。ベアラートークンを使用する場合、その再利用を検出して防止を徹底するために、この機能を備えていなければなりません。

•A credential-stuffing detection solution has the capability to check user logins against the stolen credential database and warn legitimate users that their credentials have been stolen.

原本PDFの抜粋画像原本 PDF p.34 の画像抜粋

•クレデンシャルスタッフィング検出ソリューションには、盗まれたクレデンシャルのデータベースとユーザーログインを照合し、正規のユーザーに対してクレデンシャルが盗まれたことを警告する機能があります。

•Configure IDS and boundary devices to detect the following: (a) a denial of service attack and raise an alert before the service is no longer accessible, and (b) a distributed network probe.

•次を検出するように IDS と境界デバイスを設定します。(a) サービス拒否攻撃を検出し、サービスにアクセスできなくなる前にアラートを発します。(b) 分散型ネットワークプローブを検出します。

•Configure service hosts to scan file uploads and the contents of each container's memory and file system for resident malware threats.

•ファイルのアップロードや各コンテナのメモリおよびファイルシステムの内容をスキャンして、常駐するマルウェアの脅威を検出するようにサービスホストを設定します。

26

5 Security Strategies for Architectural Frameworks in Microservices

5 マイクロサービスにおけるアーキテクチャフレームワークのためのセキュリティ戦略

Security strategy for API gateway implementation (MS-SS-12):

APIゲートウェイ実装のためのセキュリティ戦略(MS-SS-12):

•Integrate the API gateway with an identity management application to provision credentials before activating the API.

•APIをアクティブ化する前に認証情報をプロビジョニングするため、APIゲートウェイをアイデンティティ管理アプリケーションと統合します。

•When identity management is invoked through the API gateway, connectors should be provided for integrating with identity providers (IdPs).

•APIゲートウェイを通じてアイデンティティ管理が呼び出される場合、アイデンティティプロバイダー(IdP)と統合するためのコネクタが提供されるべきです。

•The API gateway should have a connector to an artifact that can generate an access token for the client request (e.g., OAuth 2.0 Authorization Server).

•APIゲートウェイは、クライアント要求に対するアクセストークンを生成できるアーティファクト(例:OAuth 2.0認可サーバー)へのコネクタを持つべきです。

•Securely channel all traffic information to a monitoring and/or analytics application for detecting attacks (e.g., denial of service, malicious actions) and unearthing explanations for degrading performance.

•攻撃(例:サービス拒否、悪意ある行動)の検知やパフォーマンス低下の理由の解明のために、すべてのトラフィック情報を監視および/または分析アプリケーションへセキュアに転送します。

•Distributed gateway deployments (or a combination of initial gateway (that intercepts all client accesses) and microgateways (closer to microservices)) should have a token translation (exchange) service [18] between gateways. The token presented to the initial gateway should have permissions with a broad scope whereas the token presented to inside gateways (or microgateways) should be more narrowly scoped with specific permissions or an entirely different token type that is appropriate for the target microservice platform. This helps to implement the least privilege paradigm.

•分散ゲートウェイ展開(または(すべてのクライアントアクセスをインターセプトする)初期ゲートウェイと(マイクロサービスにより近い)マイクロゲートウェイの組み合わせ)では、ゲートウェイ間にトークン変換(交換)サービス[18]を設けるべきです。初期ゲートウェイに提示されるトークンは広範囲のスコープを持つ権限を持つべきであるのに対し、内部ゲートウェイ(またはマイクロゲートウェイ)に提示されるトークンは、特定の権限を持つより狭いスコープに限定されるか、あるいはターゲットとなるマイクロサービスプラットフォームに適したまったく異なるトークンタイプであるべきです。これは最小権限のパラダイムを実装するのに役立ちます。

Implementing a service mesh can help ensure that proper configuration parameters associated with various security policies are defined correctly in the control plane so that the intent of the security policies are met, and the service mesh alone does not introduce new vulnerabilities.

サービスメッシュの実装は、セキュリティポリシーの意図が確実に満たされ、サービスメッシュ単体で新たな脆弱性が生じないように、さまざまなセキュリティポリシーに関連付けられた適切な構成パラメータがコントロールプレーンで正しく定義されることを確実にするのに役立ちます。

Security strategy for service mesh implementation (MS-SS-13):

サービスメッシュ実装のためのセキュリティ戦略(MS-SS-13):

•Provide policy support for designating a specific communication protocol between pairs of services and specifying the traffic load between pairs of services based on application requirements.

•アプリケーションの要件に基づいて、サービスのペア間における特定の通信プロトコルの指定、およびサービスのペア間のトラフィック負荷の指定を行うポリシーサポートを提供すること。

•The default configuration should always enable access control policies for all services.

•デフォルト設定では、常にすべてのサービスに対してアクセス制御ポリシーを有効にすべきです。

•Avoid configurations that may lead to privilege escalation (e.g., the service role permissions and binding of the service role to service user accounts).

•特権昇格につながる可能性のある設定(サービスロールのアクセス許可や、サービスユーザーアカウントへのサービスロールのバインドなど)は避けること。

•Service mesh deployments should have configuration capabilities to specify resource usage limits for its components. The absence of this feature creates the potential for these components to impact the resiliency and availability of the overall microservices application.

•サービスメッシュの展開環境には、そのコンポーネントのリソース使用制限を指定する設定機能を備えるべきです。この機能がない場合、これらのコンポーネントがマイクロサービスアプリケーション全体の耐障害性や可用性に影響を与える可能性があります。

The two main architectural frameworks considered in this document for microservices-based application systems are the API gateway and service mesh. The primary security considerations in the implementation of the API gateway involve choosing the right platform for hosting it, proper integration and configuration with enterprise-wide authentication and authorization frameworks, and securely leveraging the traffic flowing through it for security monitoring and analysis.

本書がマイクロサービスベースのアプリケーションシステムについて検討する2つの主要なアーキテクチャフレームワークは、APIゲートウェイとサービスメッシュです。APIゲートウェイの実装における主なセキュリティ上の考慮事項は、それをホストする適切なプラットフォームの選択、企業全体の認証・認可フレームワークとの適切な統合と構成、およびAPIゲートウェイを通過するトラフィックをセキュリティ監視と分析のためにセキュアに活用することです。

•Service mesh deployments should have configuration capabilities to collect and send environment metrics, including request metrics, to a centralized service for monitoring. Policies should allow for specifying either a single service mesh or multiple service meshes (each with their own control plane) for multi-cluster microservices environments to ensure high availability and resiliency in those scenarios.

•サービスメッシュの展開環境は、リクエストメトリクスを含む環境メトリクスを収集し、監視のための中央サービスに送信する設定機能を備えるべきです。マルチクラスターのマイクロサービス環境において高い可用性と耐障害性を確保するために、ポリシーでは、単一のサービスメッシュまたは(それぞれが独自のコントロールプレーンを持つ)複数のサービスメッシュのいずれかを指定できるようにすべきです。

•For highly sensitive microservices-based applications, Layer 3 network segmentation must be configured within the orchestrator platform to complement the Layer 5 network segmentation achieved throughout the service mesh layer. This is a countermeasure to the threat by malicious actors circumventing or bypassing the sidecar proxy that the service mesh uses for firewalling and blocking network traffic.

•機密性の高いマイクロサービスベースのアプリケーションでは、サービスメッシュレイヤー全体で達成されるレイヤー5ネットワークセグメンテーションを補完するために、オーケストレータープラットフォーム内でレイヤー3ネットワークセグメンテーションを設定しなければなりません。これは、サービスメッシュがネットワークトラフィックのファイアウォール処理やブロックに使用するサイドカープロキシを、悪意のある攻撃者が回避または迂回する脅威に対する対抗策です。

28

Appendix A—Differences between Monolithic Application and Microservices-based Application

原本PDFの抜粋画像原本 PDF p.37 の画像抜粋

付録A—モノリシックアプリケーションとマイクロサービスベースのアプリケーションの違い

A.1 Design and Deployment Differences

A.1 設計と展開の違い

Conceptually, a monolithic architecture of an application involves generating one huge artifact that must be deployed in its entirety, while a microservices-based application contains multiple self-contained, loosely-coupled executables called services or microservices. The individual services can be deployed independently. In monolithic applications, any change to a certain functionality of the overall application will involve recompilation and, in some instances, re-testing of the whole application before being deployed again. However, in the case of microservices, only the relevant service is modified and redeployed since the independent nature of the services ensures that a change in one does not logically affect the functionality of another. In monolithic applications, any increase in workload due to an increase in the number of users or the frequency of application usage will involve allocating resources to the whole application, whereas in microservices, the increase in resources can be selectively applied to those services whose performance is less than desirable, thus providing flexibility in scalability efforts.

概念的に、アプリケーションのモノリシックアーキテクチャは、全体を展開しなければならない1つの巨大なアーティファクトを生成することを伴います。一方、マイクロサービスベースのアプリケーションは、サービスまたはマイクロサービスと呼ばれる、自己完結型で疎結合の複数の実行可能ファイルを含みます。個々のサービスは独立して展開できます。モノリシックなアプリケーションでは、アプリケーション全体の特定の機能を変更するたびに、再展開の前に、アプリケーション全体の再コンパイルと、場合によっては再テストが必要となります。これに対しマイクロサービスでは、サービスの独立性により、1つのサービスの変更が別のサービスの機能に論理的な影響を及ぼさないため、該当するサービスのみを変更して再展開すれば足ります。モノリシックなアプリケーションでは、ユーザー数やアプリケーションの使用頻度の増加によるワークロードの増加には、アプリケーション全体へのリソース割り当てが必要となります。一方、マイクロサービスでは、性能が望ましい水準に満たないサービスに対して選択的にリソースを増やすことができ、スケーラビリティ確保の取り組みに柔軟性をもたらします。

Some monolithic applications may be constructed modularly but may not have semantic or logical modularity. Modular construction refers to how an application may be built from a large number of components and libraries that may have been supplied by different vendors, and some components (e.g., database) may be distributed across the network [13]. In such monolithic applications, the design and specification of APIs may be similar to that in a microservices architecture. However, the difference between such modularly designed monolithic applications (sometimes called a classic modular design) and a microservices-based application is that in the latter, the individual API is network-exposed and therefore independently callable and re-usable.

モノリシックアプリケーションの中には、モジュール式に構築されていても、意味論的または論理的なモジュール性を持たない場合があります。モジュール式の構築とは、異なるベンダーによって提供された可能性のある多数のコンポーネントやライブラリからアプリケーションが構築され、一部のコンポーネント(データベースなど)がネットワーク全体に分散配置されている場合があること [13] を指します。このようなモノリシックアプリケーションでは、APIの設計および仕様がマイクロサービスアーキテクチャのものと類似している場合があります。しかし、このようなモジュール設計されたモノリシックアプリケーション(クラシックモジュラー設計と呼ばれることもある)とマイクロサービスベースのアプリケーションの違いは、後者では個々のAPIがネットワークに公開されており、したがって個別に呼び出し可能で再利用可能である点にあります。

The differences between monolithic and microservices-based applications is summarized in Table 3.

モノリシックアプリケーションとマイクロサービスベースのアプリケーションの違いは、表3にまとめられています。

Table 3: Logical Differences between Monolithic and Microservices-based Application

表3:モノリシックアプリケーションとマイクロサービスベースのアプリケーションの論理的な違い

Monolithic ApplicationMicroservices-based Application
Must be deployed as a whole.Independent or selective deployment of services.
Change in a small part of the application requires re-deployment of the entire application.Only the modified services need to be re-deployed.
Scalability involves allocating resources to the application as a whole.Each of the individual services can be selectively scaled up by allocating more resources.
API calls are local.Network-exposed APIs enable independent invocation and re-usability.
モノリシックアプリケーションマイクロサービスベースのアプリケーション
全体としてデプロイしなければなりません。サービスの独立した、または選択的なデプロイ。
アプリケーションの小さな一部を変更しても、アプリケーション全体の再デプロイが必要となります。変更されたサービスのみを再デプロイすれば足ります。
スケーラビリティの確保には、アプリケーション全体へのリソースの割り当てが伴います。個々のサービスはそれぞれ、より多くのリソースを割り当てることによって選択的にスケールアップできます。
API 呼び出しはローカルです。ネットワークに公開された API により、独立した呼び出しと再利用が可能になります。

A.1.1 An Example Application to Illustrate the Design and Deployment differences

A.1.1 設計および配備の違いを説明するためのサンプルアプリケーション

The following example of a small, Online Shopping Application illustrates the design and deployment differences discussed above. The main functions of this application are:

小規模なオンラインショッピングアプリケーションの以下の例は、上記で議論した設計と配備の違いを説明しています。このアプリケーションの主な機能は以下の通りです。

•A module that displays the catalog of products offered by the retailer with pictures of the products, product numbers, product names, and the unit prices;

•小売業者が提供する商品のカタログを、商品の写真、商品番号、商品名、単価とともに表示するモジュール。

•A module for processing customer orders by gathering information about the customer (e.g., name, address) and the details of the order (e.g., name of the product from the catalog, quantity, unit price) as well as creating a bin containing all the items ordered in that session;

•顧客に関する情報(例:氏名、住所)および注文の詳細(例:カタログからの商品名、数量、単価)を収集するとともに、そのセッションで注文されたすべての品目を含むビンを作成することによって顧客の注文を処理するモジュール。

•A module for preparing the order for shipping, specifying the total bill of lading (i.e., the total package to be shipped, quantity of each item in the order, shipping preferences, shipping address); and

•出荷に向けて注文を準備し、総運送状(すなわち、出荷される荷物の総量、注文内の各品目の数量、配送設定、配送先住所)を指定するモジュール。ならびに

•A module for invoicing the customer with a built-in feature for making payments by credit card or bank account.

•クレジットカードまたは銀行口座による支払いを行うための組み込み機能を備えた、顧客に請求書を発行するためのモジュール。

The differences in the design of this Online Shopping Application as a monolithic versus microservices-based are given in Table 4. Schematic diagrams of this application under monolithic and microservices architectures are given in Figures 1 and 2 respectively.

モノリシックとマイクロサービスベースでのこのオンラインショッピングアプリケーションの設計の違いは、表4に示されています。モノリシックアーキテクチャおよびマイクロサービスアーキテクチャの下でのこのアプリケーションの概略図は、それぞれFigures 1および2に示されています。

Table 4: Differences in Application Construct between Monolithic and Microservices-based Application

表4:モノリシックアプリケーションとマイクロサービスベースのアプリケーションにおけるアプリケーション構成概念の違い

Application ConstructMonolithMicroservices-based
Communication between functional modulesAll communications are in the form of procedure calls or some internal data structures (e.g., socket). The module handling the order processing makes a procedural call to the module handling the shipping function and waits for successful completion (blocking type synchronous communication).The shipping functionality and the order processing functionality are each designed as independent services. Communication takes place as an API call across the network using a web protocol. The order processing microservice can either (a) make a request-response call to the shipping microservice and wait for a response or (b) put the details of the order to be shipped in a message queue to be picked up asynchronously by the shipping microservice, which has subscribed to the event.
Handling changes or enhancements (e.g., invoicing module needs to be changed to accept debit cards)The entire application must be recompiled and redeployed after making the necessary changes.The invoicing function is designed as a separate microservice, so that service can simply be recompiled and redeployed.
アプリケーション構成要素モノリスマイクロサービスベース
機能モジュール間の通信すべての通信は、手続き呼び出しまたは何らかの内部データ構造(例:ソケット)の形式をとります。注文処理を扱うモジュールは、配送機能を扱うモジュールに対して手続き呼び出しを行い、正常な完了を待機します(ブロッキング型の同期通信)。配送機能と注文処理機能は、それぞれ独立したサービスとして設計されます。通信は、Web プロトコルを使用したネットワーク越しの API 呼び出しとして行われます。注文処理マイクロサービスは、(a) 配送マイクロサービスに対してリクエスト・レスポンス型の呼び出しを行い、応答を待機するか、(b) 配送対象の注文の詳細を、そのイベントをサブスクライブしている配送マイクロサービスが非同期に取り出せるよう、メッセージキューに投入するかのいずれかを行えます。
変更や機能強化への対応(例:デビットカードを受け付けるために請求モジュールを変更する必要がある場合)必要な変更を加えた後、アプリケーション全体を再コンパイルして再デプロイしなければなりません。請求機能は個別のマイクロサービスとして設計されているため、そのサービスのみを再コンパイルして再デプロイすれば足ります。

30

Application ConstructMonolithMicroservices-based
Scaling the application, allocation of increased resources (e.g., order processing module needs to be allocated more resources to handle a larger load)The order processing functionality involves longer transaction times compared to shipping or invoicing functions. Vertical scaling that involves using servers with more memory or CPUs must be deployed for the entire application.It is enough to allocate increased resources for hardware where the order processing microservice is deployed. Also, the number of instances of order-processing microservices can be increased for better load balancing.
Development and deployment strategyDevelopment is handled by the development team which, after necessary testing by the QA team, transfers the task of deployment to an infrastructure team that oversees the allocation of suitable resources for deployment.The complete lifecycle—from development to deployment—is handled by a single DevOps team for each microservice since it is a relatively small module with a single functionality and built-in platform (e.g., OS, languages libraries) that is optimal for that functionality.
アプリケーション構成要素モノリスマイクロサービスベース
アプリケーションのスケーリングと、増強したリソースの割り当て(例:より大きな負荷を処理するために、注文処理モジュールにより多くのリソースを割り当てる必要がある場合)注文処理機能は、配送機能や請求機能と比べてトランザクション時間が長いです。より多くのメモリまたは CPU を備えたサーバーを使用する垂直スケーリングを、アプリケーション全体に対して適用しなければなりません。注文処理マイクロサービスがデプロイされているハードウェアに対して、増強したリソースを割り当てるだけで十分です。また、負荷分散を改善するために、注文処理マイクロサービスのインスタンス数を増やすこともできます。
開発およびデプロイの戦略開発は開発チームが担当し、QA チームによる必要なテストを経た後、デプロイの作業は、デプロイに適したリソースの割り当てを監督するインフラストラクチャチームに引き継がれます。各マイクロサービスは、単一の機能と、その機能に最適な組み込みプラットフォーム(例:OS、言語ライブラリ)を備えた比較的小さなモジュールであるため、開発からデプロイまでのライフサイクル全体を、マイクロサービスごとに単一の DevOps チームが担当します。

A.2 Run-time Differences

A.2 実行時の違い

A monolithic application runs as a single computational node such that the node is aware of the overall system or application state. In a microservices environment, the application is designed as a set of multiple nodes that each provide a service. Since they operate without the need to coordinate with others, the overall system state is unknown to individual nodes. In the absence of any global information or global variable values, the individual nodes make decisions based on locally available information. The independence of the nodes means that failure of one node does not affect other nodes. Unlike monolithic applications where services may share database connections or a data repository, a microservice architecture may deploy a pattern wherein each service has its own data repository. In many situations, interaction between services may require a distributed transaction which, if not designed properly, may affect the integrity of the databases.

モノリシックアプリケーションは単一の計算ノードとして実行されるため、そのノードはシステム全体またはアプリケーションの状態を認識しています。マイクロサービス環境では、アプリケーションはそれぞれがサービスを提供する複数のノードのセットとして設計されます。これらは互いに調整する必要なく動作するため、個々のノードにはシステム全体の状態は不明です。グローバル情報やグローバル変数の値が存在しない状況では、個々のノードは局所的に利用可能な情報に基づいて意思決定を行います。ノードの独立性は、1つのノードの障害が他のノードに影響を与えないことを意味します。サービスがデータベース接続やデータリポジトリを共有することがあるモノリシックアプリケーションとは異なり、マイクロサービスアーキテクチャでは各サービスが独自のデータリポジトリを持つパターンを採用することがあります。多くの状況において、サービス間の相互作用には分散トランザクションが必要となる場合があり、適切に設計されていない場合はデータベースの整合性に影響を与える可能性があります。

The runtime differences between monolithic and microservices applications and their implications are summarized in Table 5.

モノリシックアプリケーションとマイクロサービスアプリケーションにおけるランタイムの違いおよびその影響は、表5に要約されています。

Table 5: Architectural Differences between Monolithic and Microservices-based Application

表5:モノリシックアプリケーションとマイクロサービスベースのアプリケーション間のアーキテクチャ上の相違点

Monolithic ApplicationMicroservices-based Application
Runs as a single computational node; overall state information fully known.Designed as a set of multiple nodes, each providing a service; overall system state is unknown to individual nodes.
Designed to make use of global information or values of global variables.Individual nodes make decisions based on locally available information.
Failure of the node means crash of the application.Failure of one node should not affect other nodes.
モノリシックアプリケーションマイクロサービスベースのアプリケーション
単一の計算ノードとして動作し、全体の状態情報が完全に把握されています。それぞれがサービスを提供する複数のノードの集合として設計され、個々のノードにはシステム全体の状態が分かりません。
グローバル情報またはグローバル変数の値を利用するように設計されています。個々のノードは、ローカルで利用可能な情報に基づいて判断を行います。
ノードの障害は、アプリケーションのクラッシュを意味します。1 つのノードの障害が他のノードに影響を与えるべきではありません。

31

図表

図1: オンラインショッピングアプリケーション – モノリシックアーキテクチャ。左から右へ、Online Shopping App UI と記された箱から Web Server と題された大きな箱へ矢印が延びる。Web Server の中には Product Catalog Module、Order Processing Module、Invoicing Module、Shipping Module の 4 つのモジュールがある。Web Server から Database for Online Shopping App と記された円筒へ矢印が延びる。

Figure 1: Online Shopping Application – Monolithic Architecture

図1: オンラインショッピングアプリケーション – モノリシックアーキテクチャ

図表

図2: オンラインショッピングアプリケーション – マイクロサービスアーキテクチャ。Online Shopping Client App と記された箱から API Gateway と記された楕円へ矢印が延びる。API Gateway から Product Catalog Microservice、Order Processing Microservice、Invoicing Microservice の 3 つのマイクロサービスへ矢印が延びる。Product Catalog Microservice は Product Catalog Database と記された円筒と両方向の矢印で結ばれている。Order Processing Microservice から下の Shipping Microservice へ矢印が延び、両者から Orders & Shipments Database と記された円筒へ矢印が延びる。Invoicing Microservice から Invoicing/ Billing Database と記された円筒へ矢印が延びる。

Figure 2: Online Shopping Application – Microservices Architecture

図2: オンラインショッピングアプリケーション – マイクロサービスアーキテクチャ

Appendix B—Traceability of Security Strategies to Microservices Architectural Features

付録B—セキュリティ戦略とマイクロサービスのアーキテクチャ上の特徴との対応関係

All security strategies discussed in sections 4 & 5 (a total of 13) are listed in Table 6 along with either the microservice core feature or the architectural framework to which each of them pertain.

4節および5節で論じたすべてのセキュリティ戦略(計13件)を、それぞれが関係するマイクロサービスのコア機能またはアーキテクチャフレームワークとともに、表6に示します。

Table 6: Security Strategies for Microservices

表6: マイクロサービスのセキュリティ戦略

Security Strategy IdentifierSecurity StrategyMicroservices Core Feature / Architectural Framework
MS-SS-1• Authentication to microservices APIs that have access to sensitive data should not be done simply by using API keys. Access to such APIs should require authentication tokens that have either been digitally signed (e.g., client credentials grant) or that is verified with an authoritative source. Additionally, some services may require either single-use tokens or short-lived tokens (tokens that expire after a short time period) to limit the damage a compromised token can cause.
• Authentication tokens should be handle-based, cryptographically signed, or protected by an HMAC scheme.
• Every API Key that is used in the application should have restrictions specified both for the applications (e.g., mobile app, IP address) and the set of APIs where they can be used.
• The restriction scope for functionality of every API Key should be commensurate with the level of assurance provided during identity proofing, whether it be machine or human driven identity proofing.
• When stateless authentication tokens (e.g., JSON Web Tokens (JWT)) are used by implementing shared libraries associated with a microservice, the following security precautions must be observed: (a) the token expiry times should be as short as possible since they determine the duration of the session and an active session cannot be revoked, and (b) the token secret key must not be a part of the library code, it must be a dynamic variable represented by an environmental variable or specified in an environment data file. The key value should be stored in a data vault solution.
• If standards-based techniques such as OAuth or OpenID connect are implemented, they must be deployed securely [19].
Authentication
セキュリティ戦略識別子セキュリティ戦略マイクロサービスのコア機能/アーキテクチャフレームワーク
MS-SS-1• 機密データにアクセスできるマイクロサービス API への認証は、単に API キーを使用するだけで行うべきではありません。そのような API へのアクセスには、デジタル署名されている(例:クライアントクレデンシャルグラント)か、信頼できる情報源によって検証される認証トークンを要求すべきです。さらに、危殆化したトークンが引き起こす被害を抑えるために、使い捨てトークンまたは有効期間の短いトークン(短時間で失効するトークン)のいずれかを要求するサービスもあります。
• 認証トークンは、ハンドルベース、暗号学的に署名されたもの、または HMAC 方式で保護されたものであるべきです。
• アプリケーションで使用するすべての API キーには、アプリケーション(例:モバイルアプリ、IP アドレス)と、それらを使用できる API の集合の両方について制限を指定すべきです。
• すべての API キーの機能に対する制限の範囲は、機械主導か人間主導かを問わず、身元確認(identity proofing)の際に提供される保証レベルに見合ったものであるべきです。
• マイクロサービスに関連付けられた共有ライブラリを実装してステートレス認証トークン(例:JSON Web Token(JWT))を使用する場合、次のセキュリティ上の予防措置を遵守しなければなりません。(a) トークンの有効期限はセッションの継続期間を決定し、アクティブなセッションを失効させることはできないため、できる限り短くすべきです。(b) トークンの共通鍵をライブラリコードに含めてはなりません。それは環境変数で表されるか、環境データファイルで指定される動的変数でなければなりません。鍵の値はデータボールトソリューションに格納すべきです。
• OAuth や OpenID Connect などの標準ベースの技術を実装する場合は、安全に導入しなければなりません [19]。
認証

34

Security Strategy IdentifierSecurity StrategyMicroservices Core Feature / Architectural Framework
MS-SS-2• Access policies to all APIs and their resources should be defined and provisioned to an access server. Access policies at a coarse level of granularity say “Permit to Call for a given set of addressable functionalities” should be defined and enforced at the initial API gateway while authorizations at the finer level of granularity (e.g., related to domain of the particular microservices’ business logic) should be defined and enforced closer to the location of the microservices (e.g., at the microgateway) or sometimes at the microservice itself.
• Caching Mechanism: It may be appropriate to allow microservices to cache policy data; this cache should be only relied upon when an access server is unavailable and should expire after a duration appropriate for the environment/infrastructure.
• The access server should be capable of supporting fine-grained policies.
• Access decisions from the access server should be conveyed to individual and sets of microservices through standardized tokens encoded in a platform-neutral format (e.g., OAuth 2.0 token encoded in JSON format). The token can be either a handle-based token or an assertion bearing token.
• The scope of internal authorization tokens appended by the micro gateway or decision point to each request should be carefully controlled; for example, in a request for transaction, the internal authorization token should be limited in scope to only involve the API endpoints that must be accessed for that transaction.
• The API gateway can be leveraged to centralize enforcement of authentication and access control for all downstream microservices, eliminating the need to provide authentication and access control for each of the individual services. If this design is chosen, any component suitably positioned on the network can make anonymous connections to the services bypassing the API gateway and its protections. Mitigating controls such as mutual authentication should be leveraged to prevent direct, anonymous connections to the services."
Access management
セキュリティ戦略識別子セキュリティ戦略マイクロサービスのコア機能/アーキテクチャフレームワーク
MS-SS-2• すべての API とそのリソースに対するアクセスポリシーを定義し、アクセスサーバーにプロビジョニングすべきです。たとえば「指定されたアドレス指定可能な機能の集合に対する呼び出しの許可」のような粗い粒度のアクセスポリシーは最初の API ゲートウェイで定義・適用すべきであり、より細かい粒度の認可(例:特定のマイクロサービスのビジネスロジックのドメインに関連するもの)は、マイクロサービスの場所のより近く(例:マイクロゲートウェイ)、場合によってはマイクロサービス自体で定義・適用すべきです。
• キャッシュメカニズム:マイクロサービスにポリシーデータのキャッシュを許可することが適切な場合があります。このキャッシュは、アクセスサーバーが利用できない場合にのみ依拠すべきであり、環境/インフラストラクチャに適した期間が経過した後に失効させるべきです。
• アクセスサーバーは、きめ細かいポリシーをサポートできるべきです。
• アクセスサーバーからのアクセス決定は、プラットフォーム中立な形式でエンコードされた標準化トークン(例:JSON 形式でエンコードされた OAuth 2.0 トークン)を通じて、個々のマイクロサービスおよびマイクロサービスの集合に伝達すべきです。トークンは、ハンドルベースのトークンまたはアサーションを保持するトークンのいずれでもよいです。
• マイクロゲートウェイまたは決定ポイントが各リクエストに付加する内部認可トークンのスコープは、慎重に制御すべきです。たとえば、トランザクションのリクエストでは、内部認可トークンのスコープを、そのトランザクションでアクセスしなければならない API エンドポイントのみに限定すべきです。
• API ゲートウェイを活用して、下流のすべてのマイクロサービスに対する認証とアクセス制御の実施を一元化し、個々のサービスごとに認証とアクセス制御を提供する必要をなくすことができます。この設計を選択した場合、ネットワーク上の適切な位置にあるコンポーネントであれば、API ゲートウェイとその保護を迂回して、サービスへの匿名接続を行えます。サービスへの直接的な匿名接続を防ぐため、相互認証などの緩和策を活用しなければなりません。
アクセス管理

35

Security Strategy IdentifierSecurity StrategyMicroservices Core Feature / Architectural Framework
MS-SS-3• Service registry capabilities should be provided through servers that are either dedicated or part of a service mesh architecture.
• Service registry services should be in a network that has been configured with certain QoS parameters to ensure its availability and resilience.
• Communication between an application service and a service registry should be through a secure communication protocol, such as HTTPS/TLS.
• Service registry should have validation checks to ensure that only legitimate services are performing the registration and refresh operations or querying its database to discover services
• The bounded context and loose coupling principle for microservices should be observed for the service registration/deregistration function; the application service should not have tight coupling with an infrastructure service, such as service registry service, and the service self-registration/deregistration pattern should be avoided. Moreover, when an application service crashes or is running but not in a position to handle requests, it cannot perform deregistration, thus affecting the integrity of the whole process. Registration or deregistration of an application service should be enabled using a third-party registration pattern, and the application service should be restricted to simply querying the service registry for service location information as described in the client-side discovery pattern.
• If a third-party registration pattern is implemented, registration/deregistration should only take place after performing a health check on the application service
• Distributed service registry should be deployed for large microservices applications, and care should be taken to maintain data consistency among multiple service registry instances
Service registry configuration
MS-SS-4• Clients should not be configured to call their target services directly but rather be configured to point to the single gateway URL
• Client to API gateway as well as Service to Service communication should take place after mutual authentication and be encrypted (e.g., using mTLS protocol)
• Frequently interacting services should create keep-alive TLS connections
Secure communication
セキュリティ戦略識別子セキュリティ戦略マイクロサービスのコア機能/アーキテクチャフレームワーク
MS-SS-3• サービスレジストリ機能は、専用サーバー、またはサービスメッシュアーキテクチャの一部であるサーバーを通じて提供すべきです。
• サービスレジストリサービスは、その可用性と回復力を確保するために特定の QoS パラメータを構成したネットワーク内に置くべきです。
• アプリケーションサービスとサービスレジストリ間の通信は、HTTPS/TLS などのセキュアな通信プロトコルを介して行うべきです。
• サービスレジストリは、正当なサービスのみが登録操作や更新操作を実行し、またはサービスを検出するためにそのデータベースに問い合わせていることを確認する検証チェックを備えるべきである
• マイクロサービスにおける境界づけられたコンテキストと疎結合の原則を、サービスの登録/登録解除機能についても遵守すべきです。アプリケーションサービスは、サービスレジストリサービスなどのインフラストラクチャサービスと密結合すべきではなく、サービスの自己登録/登録解除パターンは避けるべきです。さらに、アプリケーションサービスがクラッシュした場合や、稼働していてもリクエストを処理できる状態にない場合は、登録解除を実行できず、プロセス全体の完全性に影響します。アプリケーションサービスの登録または登録解除は、サードパーティ登録パターンを使用して有効にすべきであり、アプリケーションサービスは、クライアント側ディスカバリパターンで説明されているように、サービスの位置情報についてサービスレジストリに問い合わせるだけに制限すべきです。
• サードパーティ登録パターンを実装する場合、登録/登録解除は、アプリケーションサービスのヘルスチェックを実行した後にのみ行うべきである
• 大規模なマイクロサービスアプリケーションには分散サービスレジストリを導入すべきであり、複数のサービスレジストリインスタンス間でデータの一貫性を維持するよう注意すべきである
サービスレジストリの構成
MS-SS-4• クライアントは、対象サービスを直接呼び出すように構成すべきではなく、単一のゲートウェイ URL を指すように構成すべきである
• クライアントから API ゲートウェイへの通信およびサービス間通信は、相互認証の後に行い、暗号化すべきである(例:mTLS プロトコルの使用)
• 頻繁に対話するサービスは、キープアライブ TLS 接続を作成すべきである
セキュアな通信

36

Security Strategy IdentifierSecurity StrategyMicroservices Core Feature / Architectural Framework
MS-SS-5• Security monitoring should be performed at both the gateway and service level to detect, alert and respond to inappropriate behavior, for example a bearer token reuse attack and injection attacks. Further, input validation errors and extra parameters errors, crashes and core dumps must be logged. A class of software that can accomplish this is the OWASP AppSensor which could potentially be implemented in the gateway, service mesh and microservice itself.
• A central dashboard displays the status of various services and the network segments that link them. At a minimum, the dashboard should show security parameters such as input validation failures and unexpected parameters that are obvious signs of injection attack attempts.
• A baseline for normal, uncompromised behavior in terms of the outcome of business logic decisions, contact attempts, and other behavior should be created. The placement and capabilities of IDS nodes should be such that deviations from this baseline can be detected.
Security monitoring
MS-SS-6• A proxy circuit breaker option should be deployed to limit the trusted component to be the proxy, which avoids the need to place the trust on the clients and microservices (e.g.,setting thresholds and cutting off requests based on the set threshold) since they are multiple componentsImplementing circuit breaker
MS-SS-7• The load balancing function should be decoupled from individual service requests; for example, the program that performs health checks on the services to determine the load balancing pool should run asynchronously in the background
• Care must be taken to protect the network connection between the load balancer and the microservice platform.
• When a DNS resolver is deployed in front of a source microservice to provide a table of available target microservice instances, it should work in tandem with the health check program to present a single list to the calling microservice
Implementing load balancing
セキュリティ戦略識別子セキュリティ戦略マイクロサービスのコア機能/アーキテクチャフレームワーク
MS-SS-5• ベアラートークンの再利用攻撃やインジェクション攻撃などの不適切な振る舞いを検出し、警告し、対処するために、セキュリティ監視をゲートウェイとサービスの両方のレベルで実施すべきです。さらに、入力検証エラー、余分なパラメータのエラー、クラッシュ、およびコアダンプをログに記録しなければなりません。これを実現できるソフトウェアの一種に OWASP AppSensor があり、ゲートウェイ、サービスメッシュ、およびマイクロサービス自体に実装できる可能性があります。
• 中央ダッシュボードには、さまざまなサービスとそれらを結ぶネットワークセグメントの状態を表示します。ダッシュボードは、少なくとも、インジェクション攻撃の試みの明白な兆候である入力検証の失敗や予期しないパラメータなどのセキュリティパラメータを表示すべきです。
• ビジネスロジックの判断結果、接続の試行、その他の振る舞いについて、危殆化していない正常な振る舞いのベースラインを作成すべきです。IDS ノードの配置と機能は、このベースラインからの逸脱を検出できるようなものにすべきです。
セキュリティ監視
MS-SS-6• プロキシ型のサーキットブレーカーを導入すべきです。これにより、複数のコンポーネントであるクライアントやマイクロサービスに信頼を置く必要がなくなり、信頼するコンポーネントをプロキシに限定できます(例:しきい値を設定し、設定したしきい値に基づいてリクエストを遮断します)。サーキットブレーカーの実装
MS-SS-7• 負荷分散機能は、個々のサービスリクエストから分離すべきです。たとえば、負荷分散プールを決定するためにサービスのヘルスチェックを行うプログラムは、バックグラウンドで非同期に実行すべきである
• ロードバランサーとマイクロサービスプラットフォーム間のネットワーク接続を保護するよう注意しなければなりません。
• 利用可能な対象マイクロサービスインスタンスの表を提供するために、送信元マイクロサービスの前段に DNS リゾルバーを配置する場合は、ヘルスチェックプログラムと連携して動作し、呼び出し側のマイクロサービスに単一のリストを提示すべきである
負荷分散の実装

37

Security Strategy IdentifierSecurity StrategyMicroservices Core Feature / Architectural Framework
MS-SS-8• Quotas or limits for application usage should be based on both infrastructure and application-related requirements
• Limits should be determined based on well-defined API usage plans
• For high security microservices, replay detection must be implemented. Based on the risk, this feature can be configured to detect replays 100 % of the time or perform random detection.
Rate limiting (throttling)
MS-SS-9• The traffic to both the existing version and the new version of the service should be routed through a central node, such as an API gateway, to monitor that the blue/green transition occurs in a controlled manner and to monitor the risk associated with a canary release. Security monitoring should cover nodes hosting both the existing and newer versions
• Usage monitoring of the existing version should drive the rate of “ramping up” of the traffic to the new version.
• The performance and functional correctness of the new version should be a factor in the ramping up of the traffic to the new version.
• Client preference for the version (existing or new) should be taken into consideration while designing a canary release technique.
Induction of new versions of microservice
MS-SS-10• Session information for a client must be stored securely
• The artifact used for conveying the binding server information must be protected
• Internal authorization tokens must not be provided back to the user, and the user's session tokens must not be passed beyond the gateway for use in policy decisions.
Handling session persistence
セキュリティ戦略識別子セキュリティ戦略マイクロサービスのコア機能/アーキテクチャフレームワーク
MS-SS-8• アプリケーション利用のクォータまたは上限は、インフラストラクチャ関連とアプリケーション関連の両方の要件に基づくべきである
• 上限は、明確に定義された API 利用計画に基づいて決定すべきである
• 高セキュリティのマイクロサービスでは、リプレイ検出を実装しなければなりません。リスクに応じて、この機能は 100 % の確率でリプレイを検出するように、またはランダムに検出を行うように構成できます。
レート制限(スロットリング)
MS-SS-9• ブルー/グリーン移行が制御された形で行われることを監視し、カナリアリリースに伴うリスクを監視するために、サービスの既存バージョンと新バージョンの両方へのトラフィックを、API ゲートウェイなどの中央ノード経由でルーティングすべきです。セキュリティ監視は、既存バージョンと新バージョンの両方をホストするノードを対象とすべきである
• 既存バージョンの利用状況の監視に基づいて、新バージョンへのトラフィックを「増やしていく」速度を決めるべきです。
• 新バージョンの性能と機能の正しさを、新バージョンへのトラフィックを増やしていく際の要素とすべきです。
• カナリアリリースの手法を設計する際には、バージョン(既存または新)に対するクライアントの選好を考慮すべきです。
マイクロサービスの新バージョンの導入
MS-SS-10• クライアントのセッション情報は安全に保存しなければならない
• バインド先サーバーの情報を伝えるために使用するアーティファクトは保護しなければならない
• 内部認可トークンをユーザーに返してはならず、ユーザーのセッショントークンをポリシー決定に使用するためにゲートウェイより先に渡してはなりません。
セッション永続性の扱い

38

Security Strategy IdentifierSecurity StrategyMicroservices Core Feature / Architectural Framework
MS-SS-11• A run-time prevention strategy for credential abuse is preferable to an offline strategy. A threshold for a designated time interval from a given location (e.g., IP address) for the number of login attempts should be established; if the threshold is exceeded, preventive measures must be triggered by the authentication/authorization server. This feature must be present when a bearer token is used, to detect its reuse and enforce prevention.
• A credential-stuffing detection solution has the capability to check user logins against the stolen credential database and warn legitimate users that their credentials have been stolen.
• Configure IDS and boundary devices to detect the following: (a) a denial of service attack and raise an alert before the service is no longer accessible, and (b) a distributed network probe.
• Configure service hosts to scan file uploads and the contents of each container's memory and file system for resident malware threats.
Preventing credential abuse and stuffing attacks
MS-SS-12• Integrate the API gateway with an identity management application to provision credentials before activating the API.
• When identity management is invoked through the API gateway, connectors should be provided for integrating with identity providers (IdPs).
• The API gateway should have a connector to an artifact that can generate an access token for the client request (e.g., OAuth 2.0 Authorization Server).
• Securely channel all traffic information to a monitoring and/or analytics application for detecting attacks (e.g., denial of service, malicious actions) and unearthing explanations for degrading performance.
• Distributed gateway deployments (or a combination of initial gateway (that intercepts all client accesses) and microgateways (closer to microservices)) should have a token translation (exchange) service [18] between gateways. The token presented to the initial gateway should have permissions with a broad scope whereas the token presented to inside gateways (or microgateways) should be more narrowly scoped with specific permissions or an entirely different token type that is appropriate for the target microservice platform. This helps to implement the least privilege paradigm.
API gateway configuration
セキュリティ戦略識別子セキュリティ戦略マイクロサービスのコア機能/アーキテクチャフレームワーク
MS-SS-11• クレデンシャル悪用に対しては、オフラインの戦略よりもランタイムの防止戦略が望まれます。特定の場所(例:IP アドレス)からの、指定した時間間隔内のログイン試行回数のしきい値を設定すべきです。しきい値を超えた場合は、認証/認可サーバーが防止措置を発動しなければなりません。この機能は、ベアラートークンを使用する場合に、その再利用を検出して防止を実施するために備えていなければなりません。
• クレデンシャルスタッフィング検出ソリューションには、盗まれたクレデンシャルのデータベースとユーザーログインを照合し、正規のユーザーに対してクレデンシャルが盗まれたことを警告する機能があります。
• 次を検出するように IDS と境界デバイスを設定します。(a) サービス拒否攻撃を検出し、サービスが利用不能になる前にアラートを発します。(b) 分散型ネットワークプローブを検出します。
• ファイルのアップロードや各コンテナのメモリおよびファイルシステムの内容をスキャンして、常駐するマルウェアの脅威を検出するようにサービスホストを設定します。
クレデンシャルの悪用およびスタッフィング攻撃の防止
MS-SS-12• API を有効化する前にクレデンシャルをプロビジョニングするため、API ゲートウェイを ID 管理アプリケーションと統合します。
• API ゲートウェイを通じて ID 管理を呼び出す場合は、アイデンティティプロバイダー(IdP)と統合するためのコネクタを提供すべきです。
• API ゲートウェイは、クライアントのリクエストに対してアクセストークンを生成できるアーティファクト(例:OAuth 2.0 認可サーバー)へのコネクタを備えるべきです。
• 攻撃(例:サービス拒否、悪意のある行為)の検出や、性能低下の原因の解明のために、すべてのトラフィック情報を監視アプリケーションまたは分析アプリケーション(あるいはその両方)へ安全に送ります。
• 分散ゲートウェイの展開(または、すべてのクライアントアクセスを傍受する初期ゲートウェイと、マイクロサービスに近いマイクロゲートウェイの組合せ)では、ゲートウェイ間にトークン変換(交換)サービス [18] を備えるべきです。初期ゲートウェイに提示するトークンは広いスコープの権限を持つべきであるのに対し、内部のゲートウェイ(またはマイクロゲートウェイ)に提示するトークンは、特定の権限に絞ったより狭いスコープのもの、または対象のマイクロサービスプラットフォームに適した全く別のトークン種別とすべきです。これは最小権限のパラダイムの実装に役立ちます。
API ゲートウェイの構成

39

Security Strategy IdentifierSecurity StrategyMicroservices Core Feature / Architectural Framework
MS-SS-13• Policy support should be enabled for: (a) designating a specific communication protocol between pairs of services and (b) specifying the traffic load between pairs of services based on application requirements
• The default configuration should always be to enable access control policies for all services
• Avoid configurations that may lead to privilege escalation (e.g., the service role permissions and binding of the service role to service user accounts)
• Service mesh deployments should have configuration capabilities to specify resource usage limits for its components. The absence of this feature creates the potential for these components to impact the resiliency and availability of the overall microservices application.
• Service mesh deployments should have configuration capabilities to collect and send environment metrics, including request metrics, to a centralized service for monitoring. Policies should allow for specifying either a single service mesh or multiple service meshes (each with their own control plane) for multi-cluster microservices environments to ensure high availability and resiliency in those scenarios.
• For highly sensitive microservices-based applications, Layer 3 network segmentation must be configured within the orchestrator platform to complement the Layer 5 network segmentation achieved throughout the service mesh layer. This is a countermeasure to the threat by malicious actors circumventing or bypassing the sidecar proxy that the service mesh uses for firewalling and blocking network traffic.
Service mesh configuration
セキュリティ戦略識別子セキュリティ戦略マイクロサービスのコア機能/アーキテクチャフレームワーク
MS-SS-13• 次に対するポリシーのサポートを有効にすべきです。(a) サービスの組の間で使用する特定の通信プロトコルの指定、(b) アプリケーション要件に基づく、サービスの組の間のトラフィック負荷の指定
• 既定の構成は、常にすべてのサービスに対してアクセス制御ポリシーを有効にするものとすべきである
• 権限昇格につながる可能性のある構成(例:サービスロールの権限や、サービスロールのサービスユーザーアカウントへのバインド)を避ける
• サービスメッシュの展開では、そのコンポーネントのリソース使用量の上限を指定できる構成機能を備えるべきです。この機能がないと、これらのコンポーネントがマイクロサービスアプリケーション全体の回復力と可用性に影響を及ぼすおそれがあります。
• サービスメッシュの展開では、リクエストメトリクスを含む環境メトリクスを収集し、監視用の集中サービスへ送信できる構成機能を備えるべきです。ポリシーでは、マルチクラスターのマイクロサービス環境において高可用性と回復力を確保するため、単一のサービスメッシュまたは複数のサービスメッシュ(それぞれが独自のコントロールプレーンを持つ)のいずれかを指定できるようにすべきです。
• 機密性の高いマイクロサービスベースのアプリケーションでは、サービスメッシュ層全体で実現されるレイヤー 5 のネットワークセグメンテーションを補完するため、オーケストレーターのプラットフォーム内でレイヤー 3 のネットワークセグメンテーションを構成しなければなりません。これは、サービスメッシュがファイアウォール処理およびネットワークトラフィックの遮断に用いるサイドカープロキシを、悪意のある者が回避または迂回するという脅威への対策です。
サービスメッシュの構成

Appendix C—References

附属書C—参考文献

[1] Sill A (2016) The design and architecture of microservices. IEEE Cloud Computing 3(5):76-80. https://doi.org/10.1109/MCC.2016.111

[1] Sill A (2016) The design and architecture of microservices. IEEE Cloud Computing 3(5):76-80. https://doi.org/10.1109/MCC.2016.111

[2] Richardson C, Smith F (2016) Microservices: From design to deployment (NGINX Inc.). Available at https://www.nginx.com/resources/library/designing-deploying-microservices/

[2] Richardson C, Smith F (2016) Microservices: From design to deployment (NGINX Inc.). 入手先: https://www.nginx.com/resources/library/designing-deploying-microservices/

[3] TechTarget (n.d.) Comparing two schools of application development: Traditional vs. Cloud-Native. Available at https://searchcloudcomputing.techtarget.com/PaaS/Comparing-Two-Schools-of-Application-Development-Traditional-vs-Cloud-Native

[3] TechTarget (n.d.) Comparing two schools of application development: Traditional vs. Cloud-Native. https://searchcloudcomputing.techtarget.com/PaaS/Comparing-Two-Schools-of-Application-Development-Traditional-vs-Cloud-Native から入手可能

[4] Richardson C (2015) Building microservices: Using an API gateway. Available at https://www.nginx.com/blog/building-microservices-using-an-api-gateway/

[4] Richardson C (2015) Building microservices: Using an API gateway. https://www.nginx.com/blog/building-microservices-using-an-api-gateway/ から入手可能

[5] Palladino M (2016) Microservices and API gateway, Part 1: Why an API gateway? Available at https://shadrin.org/nginx/blog/content/microservices-api-gateways-part-1-why-an-api-gateway.html

[5] Palladino M (2016) Microservices and API gateway, Part 1: Why an API gateway? 入手先: https://shadrin.org/nginx/blog/content/microservices-api-gateways-part-1-why-an-api-gateway.html

[6] Jander K, Braubach L, Pokahr A (2018) Defense in-depth and role authentication for microservice systems. Procedia Computer Science 130:456-463. https://doi.org/10.1016/j.procs.2018.04.047

[6] Jander K, Braubach L, Pokahr A (2018) Defense in-depth and role authentication for microservice systems. Procedia Computer Science 130:456-463. https://doi.org/10.1016/j.procs.2018.04.047

[7] Richardson C (2015) Building microservices: Inter-process communication in a microservices architecture. Available at https://www.nginx.com/blog/building-microservices-inter-process-communication/

[7] Richardson C (2015) Building microservices: Inter-process communication in a microservices architecture. 入手先: https://www.nginx.com/blog/building-microservices-inter-process-communication/

[8] Harms H, Rogowski C, Lo Iacono L (2017) Guidelines for adopting frontend architectures and patterns in microservices-based systems. Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering (ACM, Paderborn, Germany), pp 902-907. https://doi.org/10.1145/3106237.3117775

[8] Harms H, Rogowski C, Lo Iacono L (2017) Guidelines for adopting frontend architectures and patterns in microservices-based systems. Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering (ACM, Paderborn, Germany), pp 902-907. https://doi.org/10.1145/3106237.3117775

[9] Montesi F, Weber J (2016) Circuit breakers, discovery, and API gateways in microservices. arXiv preprint. https://arxiv.org/abs/1609.05830v2

[9] Montesi F, Weber J (2016) Circuit breakers, discovery, and API gateways in microservices. arXiv preprint. https://arxiv.org/abs/1609.05830v2

[10] O’Neill M, Malinverno P (2018) Critical capabilities for full life cycle API management. (Gartner, Stamford, CT), ID G00334223. Available at https://www.gartner.com/doc/reprints?id=1-51SE2EK&ct=180601&st=sb

[10] O’Neill M, Malinverno P (2018) Critical capabilities for full life cycle API management. (Gartner, Stamford, CT), ID G00334223. https://www.gartner.com/doc/reprints?id=1-51SE2EK&ct=180601&st=sb から入手可能

[11] Calcote L (2018) The enterprise path to service mesh architectures (O’Reilly Media, Sebastopol, CA).

[11] Calcote L (2018) The enterprise path to service mesh architectures (O’Reilly Media, Sebastopol, CA).

[12] Twistlock (n.d.) Securing the service mesh: Understanding the value of service meshes, why Istio is rising in popularity, and exploring official Twistlock compliance checks for Istio. Available at https://www.twistlock.com/resources/securing-service-mesh-istio-compliance-checks/

[12] Twistlock (n.d.) Securing the service mesh: Understanding the value of service meshes, why Istio is rising in popularity, and exploring official Twistlock compliance checks for Istio. 入手先: https://www.twistlock.com/resources/securing-service-mesh-istio-compliance-checks/

[13] Yarygina T, Bagge, AH (2018). Overcoming security challenges in microservice architecture. Proceedings of 2018 IEEE Symposium on Service-Oriented System Engineering (IEEE, Bamberg, Germany), pp 11-20. https://doi.org/10.1109/SOSE.2018.00011

[13] Yarygina T, Bagge, AH (2018). Overcoming security challenges in microservice architecture. Proceedings of 2018 IEEE Symposium on Service-Oriented System Engineering (IEEE, Bamberg, Germany), pp 11-20. https://doi.org/10.1109/SOSE.2018.00011

[14] OpenID (2019) Welcome to OpenID Connect. Available at https://openid.net/connect/

[14] OpenID (2019) Welcome to OpenID Connect. 入手先:https://openid.net/connect/

[15] Hardt D (ed.) (2012) The OAuth 2.0 authorization framework. (Internet Engineering Task Force), IETF Request for Comments (RFC) 6749. https://doi.org/10.17487/RFC6749

[15] Hardt D (ed.) (2012) The OAuth 2.0 authorization framework. (Internet Engineering Task Force), IETF Request for Comments (RFC) 6749. https://doi.org/10.17487/RFC6749

[16] NGINX (n.d.) High-performance load balancing: Scale out your applications with NGINX and NGINX Plus. Available at https://www.nginx.com/products/nginx/load-balancing/

[16] NGINX (n.d.) High-performance load balancing: Scale out your applications with NGINX and NGINX Plus. 入手先: https://www.nginx.com/products/nginx/load-balancing/

[17] Katz O (2017) Improving credential abuse threat mitigation. Available at https://blogs.akamai.com/2017/01/improving-credential-abuse-threat-mitigation.html

[17] Katz O (2017) Improving credential abuse threat mitigation. 入手先: https://blogs.akamai.com/2017/01/improving-credential-abuse-threat-mitigation.html

[18] Jones M, Nadalin A, Campbell B (ed.), Bradley J, Mortimore C (2018) OAuth 2.0 token exchange. (Internet Engineering Task Force), IETF Internet-Draft. Available at https://datatracker.ietf.org/doc/draft-ietf-oauth-token-exchange/

[18] Jones M, Nadalin A, Campbell B (ed.), Bradley J, Mortimore C (2018) OAuth 2.0 token exchange. (Internet Engineering Task Force), IETF Internet-Draft. 入手先: https://datatracker.ietf.org/doc/draft-ietf-oauth-token-exchange/

[19] Lodderstedt T, Bradley J, Labunets A, Fett D (2019) OAuth 2.0 security best current practice. (Internet Engineering Task Force), IETF Internet-Draft. Available at https://datatracker.ietf.org/doc/draft-ietf-oauth-security-topics/

[19] Lodderstedt T, Bradley J, Labunets A, Fett D (2019) OAuth 2.0 security best current practice. (Internet Engineering Task Force), IETF Internet-Draft. 入手先: https://datatracker.ietf.org/doc/draft-ietf-oauth-security-topics/

[20] Jain J (2015) HTTP verb tempering: Bypassing web authentication and authorization. Available at https://resources.infosecinstitute.com/http-verb-tempering-bypassing-web-authentication-and-authorization/

[20] Jain J (2015) HTTP verb tempering: Bypassing web authentication and authorization. 入手先: https://resources.infosecinstitute.com/http-verb-tempering-bypassing-web-authentication-and-authorization/

42