العودة للرئيسية
AWS Organizations Architecture Diagram
اضغط على الصورة للتكبير

نظرة عامة على الهيكلة

هذا المشروع يوضح تصميم بنية تحتية AWS Organizations متكاملة لإدارة بيئة مؤسسية متعددة الحسابات باستخدام CloudFormation كـ Infrastructure as Code.

تشمل الهيكلة:

  • 4 وحدات تنظيمية (OUs): Production, Development, Security, Sandbox
  • 7 حسابات أعضاء موزعة حسب الوظيفة والبيئة
  • 8 سياسات تحكم (SCPs) لفرض قواعد الأمان والامتثال
  • سياسة وسوم (Tag Policy) لتوحيد التصنيف عبر المنظمة
  • سياسة نسخ احتياطي (Backup Policy) تلقائية يومية للإنتاج

مكونات الهيكلة

Production OU

يحتوي على حسابي Prod-App و Prod-Data مع أعلى مستوى حماية: تشفير S3 إلزامي، MFA للعمليات الحرجة، حظر Root User.

5 SCPs Applied

Development OU

يحتوي على حسابي Development و Testing مع تقييد المناطق وحظر الأجهزة المكلفة للتحكم بالتكاليف.

2 SCPs Applied

Security OU

يحتوي على حسابي Security و Audit مع حظر Root User ومنع S3 العامة لحماية البيانات الحساسة.

2 SCPs Applied

Sandbox OU

يحتوي على حساب Sandbox للتجارب مع قيود صارمة على الأجهزة والخدمات المكلفة لمنع النفقات غير المخطط لها.

1 SCP Applied

ProtectCloudTrail (Root)

سياسة مطبقة على مستوى الجذر (Root) لمنع تعطيل أو حذف CloudTrail في جميع الحسابات الأعضاء بالمنظمة.

Organization Root

Tag & Backup Policies

سياسة وسوم موحدة (Environment, Owner, CostCenter) على مستوى Root، وسياسة نسخ احتياطي يومي تلقائي على Production OU.

Root + Production

تفاصيل سياسات التحكم

# اسم السياسة الوصف الهدف
1 RegionRestriction تقييد العمليات على us-east-1 و us-west-2 فقط Production Development
2 RequireS3Encryption إلزام تشفير جميع ملفات S3 (AES256 / KMS) Production
3 DenyRootUserAccess حظر استخدام Root User بالكامل Production Security
4 RequireMFA إلزام MFA للعمليات التدميرية (حذف EC2, RDS, S3...) Production
5 ProtectCloudTrail منع تعطيل أو تعديل أو حذف CloudTrail Root (كل المنظمة)
6 DenyExpensiveInstances السماح فقط بـ t2/t3/t4g instances Development
7 DenyPublicS3Buckets منع إنشاء S3 Buckets عامة Production Security
8 SandboxBudgetLimit تقييد الأجهزة المكلفة وحظر RDS/Redshift/ES Sandbox

نموذج من الكود

AWSTemplateFormatVersion: '2010-09-09'
Description: 'AWS Organizations Multi-Account Setup with SCPs'

Resources:
  ProductionOU:
    Type: AWS::Organizations::OrganizationalUnit
    Properties:
      Name: Production
      ParentId: !Ref OrganizationRootId

  DevelopmentOU:
    Type: AWS::Organizations::OrganizationalUnit
    Properties:
      Name: Development
      ParentId: !Ref OrganizationRootId

  RegionRestrictionSCP:
    Type: AWS::Organizations::Policy
    Properties:
      Name: RegionRestriction
      Type: SERVICE_CONTROL_POLICY
      TargetIds:
        - !Ref ProductionOU
        - !Ref DevelopmentOU

  RequireS3EncryptionSCP:
    Type: AWS::Organizations::Policy
    Properties:
      Name: RequireS3Encryption
      Type: SERVICE_CONTROL_POLICY
      Content:
        Version: '2012-10-17'
        Statement:
          - Sid: DenyUnencryptedS3Uploads
            Effect: Deny
            Action: s3:PutObject
            Resource: '*'
            Condition:
              StringNotEquals:
                s3:x-amz-server-side-encryption:
                  - AES256
                  - aws:kms
      TargetIds:
        - !Ref ProductionOU