Open5

Module Federation

佐藤 匡剛佐藤 匡剛

https://module-federation.io/
Module Federationのセキュリティについて。

  1. 外部ストレージなど共有の場所からのモジュールの読み込み
  2. モジュール読み込み先の通信秘匿化(HTTPS化)
  3. 読み込みモジュールの署名検証による完全性確認/改ざん防止

2.は頑張って対応できてるか確認すればいいだけだが、問題は3.か。MFにハッシュのチェックみたいな機能あるんだろうか。

佐藤 匡剛佐藤 匡剛

Module Federationにおいてリモートモジュールの完全性を検証する方法

Module Federationはとても強力で素晴らしいフレームワークです!

一方で、あまりに強力な機能を持っていて、動的に色々なところから何でもモジュールを読み込むことができるため、セキュリティに細かい制約がある文脈で気になることがあります。その1つが、リモートから読み込んだモジュールの完全性、それが第三者によってネットワーク上で改ざんされていないかをどうやって保証できるのかということです。

一般的に、動的なモジュールローディングの仕組みを持つようなシステムは、リモートに置かれたモジュールの信頼性を検証するために、そのモジュールのハッシュや署名をローディング時に検証する機能を提供することがあります。モジュールのビルド時に予め生成されたハッシュ値や署名を読み込み時に検証することで、そのモジュールがネットワーク通信中に改ざんされていないことを確認できます。

質問ですが、Module Federationにそのような機能はありますか。あるとしたら、ぜひその方法を教えてください。もしなかったとしたら、これからそういった機能を実装することは可能でしょうか。


How to Verify the Integrity of Remote Modules in Module Federation

Module Federation is a very powerful and excellent framework!

However, it has such powerful features that it can dynamically load modules from anywhere, which raises concerns about security in a more restricted context. One of these concerns is how to ensure the integrity of modules loaded remotely, that is, guaranteeing they have not been tampered with by 3rd parties over the network.

Generally, systems with dynamic module loading mechanisms may provide a feature to validate the hash or signature of the module at loading time. By validating a pre-generated hash value or signature at the time of module build when loading it, it can be confirmed that the module has not been tampered with during network transmission.

Question: Does Module Federation have such a feature? If so, please tell me how I can use the feature. If not, is it possible to implement such functionality in the future?