A container privilege escalation flaw was found in certain Ansible Automation Platform images. This issue arises from the /etc/passwd file being created with group-writable permissions during the build process. In certain conditions, an attacker who can execute commands within an affected container, even as a non-root user, can leverage their membership in the root group to modify the /etc/passwd file. This vulnerability allows an attacker to add a new user with any arbitrary UID, including UID 0, gaining full root privileges within the container.
A privilege escalation vulnerability in Ansible Automation Platform container images allows non-root users to modify /etc/passwd due to group-writable permissions, enabling arbitrary UID assignment including UID 0 for root access. This affects containerized deployments of Ansible Automation Platform where attackers with container execution capabilities can escalate privileges. While no patch is currently available, immediate compensating controls are essential for organizations running affected container images in production environments.
Immediate Actions:
1. Inventory all Ansible Automation Platform container images in use and identify affected versions
2. Implement strict container runtime security policies restricting group membership modifications
3. Apply principle of least privilege: run containers as non-root users with minimal group memberships
4. Implement network segmentation to limit lateral movement from compromised containers
Compensating Controls (until patch available):
1. Use read-only root filesystem (--read-only flag) for container deployments where possible
2. Implement AppArmor or SELinux profiles to prevent /etc/passwd modifications
3. Deploy container image scanning tools to detect unauthorized /etc/passwd modifications at runtime
4. Use admission controllers (Kubernetes) to enforce pod security policies preventing privileged containers
5. Implement file integrity monitoring (FIM) on /etc/passwd within containers
6. Restrict container execution capabilities using seccomp profiles
Detection Rules:
1. Monitor for processes attempting to write to /etc/passwd from non-root users
2. Alert on UID 0 user creation attempts within containers
3. Track group membership changes in /etc/group files
4. Monitor for unexpected user additions via useradd/usermod commands
5. Implement auditd rules: audit -w /etc/passwd -p wa -k passwd_changes
Patching Strategy:
1. Monitor Red Hat/Ansible security advisories for patch availability
2. Prepare container image rebuild procedures with corrected permissions (644 for /etc/passwd)
3. Establish testing environment for patched images before production deployment
4. Plan phased rollout of patched images across environments
الإجراءات الفورية:
1. قم بحصر جميع صور حاويات منصة أتمتة Ansible قيد الاستخدام وتحديد الإصدارات المتأثرة
2. تطبيق سياسات أمان وقت تشغيل الحاويات الصارمة التي تقيد تعديلات عضوية المجموعة
3. تطبيق مبدأ أقل امتياز: تشغيل الحاويات كمستخدمين غير جذر مع عضويات مجموعة محدودة
4. تطبيق تقسيم الشبكة لتحديد الحركة الجانبية من الحاويات المخترقة
الضوابط التعويضية (حتى توفر التصحيح):
1. استخدم نظام الملفات الجذري للقراءة فقط (علم --read-only) لنشرات الحاويات حيث أمكن
2. تطبيق ملفات تعريف AppArmor أو SELinux لمنع تعديلات /etc/passwd
3. نشر أدوات فحص صور الحاويات للكشف عن تعديلات /etc/passwd غير المصرح بها في وقت التشغيل
4. استخدام وحدات التحكم في القبول (Kubernetes) لفرض سياسات أمان Pod
5. تطبيق مراقبة سلامة الملفات (FIM) على /etc/passwd داخل الحاويات
6. تقييد إمكانيات تنفيذ الحاويات باستخدام ملفات تعريف seccomp
قواعد الكشف:
1. مراقبة العمليات التي تحاول الكتابة إلى /etc/passwd من مستخدمين غير جذر
2. تنبيهات محاولات إنشاء مستخدم UID 0 داخل الحاويات
3. تتبع تغييرات عضوية المجموعة في ملفات /etc/group
4. مراقبة إضافات المستخدمين غير المتوقعة عبر أوامر useradd/usermod
5. تطبيق قواعد auditd: audit -w /etc/passwd -p wa -k passwd_changes
استراتيجية التصحيح:
1. مراقبة استشارات أمان Red Hat/Ansible لتوفر التصحيح
2. تحضير إجراءات إعادة بناء صور الحاويات بأذونات مصححة (644 لـ /etc/passwd)
3. إنشاء بيئة اختبار لصور مصححة قبل نشر الإنتاج
4. التخطيط لنشر متدرج للصور المصححة عبر البيئات