0Pricing
Micro Frontends Architecture with Module Federation · Lektion

Module-Federation-Remotes absichern

Lernen Sie, den Mechanismus zum Laden von Remotes selbst zu schützen und zu verhindern, dass Angreifer zur Laufzeit föderierten Code einschleusen oder manipulieren.

Module-Federation-Remotes absichern ist eine kostenlose Micro Frontends Architecture with Module Federation-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Micro Frontends Architecture with Module Federation-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Micro Frontends Architecture with Module Federation-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

Remotes Are Live Code

Module Federation fetches and executes remote JavaScript at run time. That power is also a risk: if an attacker controls a remote URL, they can run code inside your app.

The Threat: Remote Tampering

Key threats to the federation layer include:

  • A compromised remote host serving malicious code
  • Man-in-the-middle modification of remoteEntry.js
  • Loading a remote from an unexpected origin

Always Serve Over HTTPS

Loading any remote over plain HTTP allows in-transit tampering. Every remoteEntry.js and chunk must be served over HTTPS, with HSTS enforced.

Allowlist Remote Origins

Do not load remotes from arbitrary URLs. Restrict allowed origins with a Content Security Policy so only trusted hosts can supply scripts.

Content-Security-Policy: script-src 'self' https://cdn.trusted.com

Subresource Integrity (SRI)

SRI lets the browser verify a fetched script matches a known hash, rejecting it if it was altered. Pairing SRI with federation guards against tampered remotes.

<script src="/cart/remoteEntry.js"
  integrity="sha384-..." crossorigin="anonymous">

Validate the Remote Manifest

If you load remote URLs from a manifest, that manifest is a high-value target. Serve it from a trusted origin and validate its contents before using any URL.

Avoid Dynamic Untrusted URLs

Never build a remote URL from user input or untrusted config. An attacker who influences the URL can point your app at malicious code.

// dangerous:
import(userProvidedUrl);
// safe: import from a fixed allowlisted name

Isolate Remotes Where Possible

Because remotes share the same page context, a malicious remote can read the DOM and globals. For untrusted third-party MFEs, consider iframe or sandbox isolation.

Protect Shared State and Tokens

A compromised remote can read shared stores and globals. Never place raw auth tokens on window or in shared state where any remote could harvest them.

Verify Integrity in CI/CD

Generate and pin SRI hashes during the build, and check that deployed remoteEntry files match expected hashes, so a tampered artifact fails verification before users hit it.

Defense in Depth

No single control is enough. Combine HTTPS, CSP allowlists, SRI, manifest validation, and isolation so that bypassing one layer still leaves others protecting the app.

Quick Check

Test your federation-security knowledge.

Recap

You learned to secure federation remotes:

  • Remotes execute live code, so the loader is an attack surface
  • Always use HTTPS and a CSP script-src allowlist
  • Verify integrity with SRI and hash checks in CI
  • Never load remotes from untrusted URLs
  • Isolate untrusted MFEs and protect tokens

Defense in depth keeps federated code trustworthy.

Häufig gestellte Fragen

Ist die Lektion „Module-Federation-Remotes absichern“ kostenlos?

Ja — der vollständige Text von „Module-Federation-Remotes absichern“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Micro Frontends Architecture with Module Federation-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Micro Frontends Architecture with Module Federation-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „Module-Federation-Remotes absichern“?

Lernen Sie, den Mechanismus zum Laden von Remotes selbst zu schützen und zu verhindern, dass Angreifer zur Laufzeit föderierten Code einschleusen oder manipulieren. Du übst Micro Frontends Architecture with Module Federation mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Micro Frontends Architecture with Module Federation zu starten?

Keine Vorkenntnisse erforderlich. Micro Frontends Architecture with Module Federation auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.

Wie lange dauert die Lektion „Module-Federation-Remotes absichern“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Micro Frontends Architecture with Module Federation-Lektion Code schreiben und ausführen?

Ja. Jede Micro Frontends Architecture with Module Federation-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Authentifizierung und Autorisierung
  2. Sicherheitsrisiken zwischen Anwendungen
  3. Best Practices für sichere Federation
  4. Module-Federation-Remotes absichern
← Zurück zu Micro Frontends Architecture with Module Federation