0Pricing
Micro Frontends Architecture with Module Federation · บทเรียน

การรักษาความปลอดภัยแอประยะไกลของ Module Federation

เรียนรู้การปกป้องกลไกโหลดแอประยะไกลเอง เพื่อป้องกันผู้โจมตีจากการแทรกหรือดัดแปลงโค้ดแบบรวมขณะระบบทำงาน

การรักษาความปลอดภัยแอประยะไกลของ Module Federation เป็นบทเรียน Micro Frontends Architecture with Module Federation ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Micro Frontends Architecture with Module Federation และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Micro Frontends Architecture with Module Federation มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

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.

คำถามที่พบบ่อย

บทเรียน “การรักษาความปลอดภัยแอประยะไกลของ Module Federation” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “การรักษาความปลอดภัยแอประยะไกลของ Module Federation” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Micro Frontends Architecture with Module Federation ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Micro Frontends Architecture with Module Federation มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “การรักษาความปลอดภัยแอประยะไกลของ Module Federation”

เรียนรู้การปกป้องกลไกโหลดแอประยะไกลเอง เพื่อป้องกันผู้โจมตีจากการแทรกหรือดัดแปลงโค้ดแบบรวมขณะระบบทำงาน คุณปฏิบัติ Micro Frontends Architecture with Module Federation ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Micro Frontends Architecture with Module Federation หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Micro Frontends Architecture with Module Federation บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน

บทเรียน “การรักษาความปลอดภัยแอประยะไกลของ Module Federation” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Micro Frontends Architecture with Module Federation นี้ได้ไหม

ได้ บทเรียน Micro Frontends Architecture with Module Federation ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. การยืนยันตัวตนและการกำหนดสิทธิ์
  2. ความเสี่ยงด้านความปลอดภัยข้ามแอปพลิเคชัน
  3. แนวทางปฏิบัติที่ดีที่สุดสำหรับสหพันธ์ที่ปลอดภัย
  4. การรักษาความปลอดภัยแอประยะไกลของ Module Federation
← กลับไปที่ Micro Frontends Architecture with Module Federation