Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

I Protection and Security Goals of Protection In one protection model, computer consists of a collection of objects, hardware or software Each object has a unique name and can be accessed through a well-defined set of operations Protection problem - ensure that each object is access...

I Protection and Security Goals of Protection In one protection model, computer consists of a collection of objects, hardware or software Each object has a unique name and can be accessed through a well-defined set of operations Protection problem - ensure that each object is accessed correctly and only by those processes that are allowed to do so Principles of Protection Guiding principle – principle of least privilege Programs, users and systems should be given just enough privileges to perform their tasks Limits damage if entity has a bug, gets abused Can be static (during life of system, during life of process) Or dynamic (changed by process as needed) – F domain switching, privilege escalation dering life “Need to know” a similar concept regarding time of the access to data Process ‫)‪Principles of Protection (Cont.‬‬ ‫▎أهداف الحماية‬ ‫‪ Must consider “grain” aspect‬‬ ‫‪.1‬النموذج املوجه نحو الكائنات‪ :‬في نموذج الحماية‪ ،‬يُنظر إلى نظام الكمبيوتر على‬ ‫أنه مجموعة من الكائنات‪ ،‬والتي يمكن أن تكون إما أجهزة )مثل الطابعات( أو‬ ‫برمجيات )مثل امللفات أو العمليات(‪.‬لكل كائن معرف فريد‪.‬‬ ‫‪.2‬التحكم في الوصول‪ :‬يمكن الوصول إلى كل كائن من خالل مجموعة محددة من‬ ‫‪ Rough-grained privilege management easier,‬‬ ‫العمليات )مثل القراءة‪ ،‬الكتابة‪ ،‬التنفيذ(‪.‬الهدف هو ضمان إدارة الوصول إلى هذه‬ ‫الكائنات بشكل صحيح‪.‬‬ ‫‪usersTain simpler, but least privilege now done in large‬‬ ‫‪.3‬مشكلة الحماية‪ :‬التحدي الرئيسي هو التأكد من أن العمليات املصرح بها فقط‬ ‫يمكنها الوصول إلى كائنات معينة‪.‬يتضمن ذلك تنفيذ آليات تمنع الوصول غير املصرح‬ ‫به والتالعب‪.‬‬ ‫‪amin Previige chunks‬‬ ‫▎مبادئ الحماية‬ ‫‪.1‬مبدأ أقل االمتيازات‪:‬‬ ‫‪ -‬يجب أن يكون لدى املستخدمني والبرامج واألنظمة الحد األدنى من الوصول‬ ‫الضروري ألداء مهامهم‪.‬‬ ‫‪ For example, traditional Unix processes either have‬‬ ‫‪ -‬يقلل هذا من األضرار املحتملة في حالة وجود أخطاء أو خروقات أمنية‪ ،‬حيث‬ ‫سيكون للكيانات املخترقة قدرات محدودة‪.‬‬ ‫‪.2‬االمتيازات الثابتة مقابل الديناميكية‪:‬‬ ‫‪abilities of the associated user, or of root‬‬ ‫‪ -‬االمتيازات الثابتة‪ :‬يتم تعيينها طوال عمر النظام أو العملية‪.‬‬ ‫‪ -‬االمتيازات الديناميكية‪ :‬يمكن أن تتغير بنا ًء على احتياجات العملية‪ ،‬مما يسمح‬ ‫باملرونة )مثل تغيير النطاق‪ ،‬تصعيد االمتيازات(‪.‬‬ ‫‪I Fine-grained management more complex,‬‬ ‫‪.3‬الحاجة إلى املعرفة‪ :‬مشابه ملبدأ أقل االمتيازات‪ ،‬ينص هذا املبدأ على أن‬ ‫املستخدمني يجب أن يكون لديهم وصول فقط إلى املعلومات الضرورية ملهامهم‪.‬‬ ‫▎إدارة االمتيازات‬ ‫‪ive the‬‬ ‫‪usersmore‬‬ ‫‪overhead, but more protective‬‬ ‫‪.1‬إدارة ذات حبيبات خشنة‪:‬‬ ‫‪ -‬أسهل في التنفيذ لكنها توفر وصوالً أوسع مما هو ضروري‪.‬‬ ‫‪ -‬على سبيل املثال‪ ،‬أنظمة ‪ Unix‬التقليدية تمنح العمليات إما امتيازات على‬ ‫مستوى املستخدم أو امتيازات الجذر‪.‬‬ ‫‪he Pavlige‬‬ ‫‪ File ACL lists, RBAC‬‬ ‫‪.2‬إدارة ذات حبيبات دقيقة‪:‬‬ ‫‪ -‬أكثر تعقيدًا وتستهلك موارد أكبر لكنها تقدم حماية أفضل‪.‬‬ ‫‪hey need‬‬ ‫‪ -‬تتضمن آليات تحكم وصول مفصلة مثل قوائم التحكم في الوصول )‪ (ACLs‬أو‬ ‫‪ Domain‬‬ ‫التحكم القائم على الدور )‪ ،(RBAC‬مما يسمح بتحديد أذونات معينة ملستخدمني أو‬ ‫‪can be user, process, procedure‬‬ ‫عمليات مختلفة‪.‬‬ ‫‪.3‬نطاقات التحكم‪:‬‬ ‫‪ -‬يمكن أن تشير النطاقات إلى املستخدمني أو العمليات أو اإلجراءات‪ ،‬مما يدل‬ ‫على السياق الذي يتم فيه تطبيق ضوابط الوصول‪.‬‬ ‫▎ملخص‬ ‫باختصار‪ ،‬تتضمن الحماية الفعالة في الحوسبة إدارة الوصول إلى الكائنات بعناية‬ ‫من خالل مبادئ مثل أقل االمتيازات والحاجة إلى املعرفة‪ ،‬مع مراعاة تعقيد إدارة‬ ‫االمتيازات لتحقيق توازن بني األمان وسهولة االستخدام‪.‬‬ Domain Structure Access-right = where rights-set is a subset of all valid operations that can be performed on the object Domain = set of access-rights I swim Domain Implementation (UNIX) Domain Process 45 3 Domain = user-id si.e 3 s foirds.be Domain switch accomplished via file system Each file has associated with it a domain bit (setuid bit) 1531 When file is executed and setuid = on, then user-id is set to owner of the file being executed When execution completes user-id is reset Domain switch accomplished via passwords su command temporarily switches to another userʼs domain when other domainʼs password provided Domain switching via commands sudo command prefix executes specified command in another domain (if original domain has privilege or password given) Domain Implementation (MULTICS) Let Di and Dj be any two domain rings II If j < I  Di  Dj jumping box 0 7 1 a II j Multics Benefits and Limits 38 Ring / hierarchical structure provided more than the basic kernel / user or root / normal user design Fairly complex -> more overhead But does not allow strict need-to-know Object accessible in Dj but not in Di, then j must be < i I 0 But then every segment accessible in Di also accessible in Dj Access Matrix View protection as a matrix (access matrix) Rows represent domains Columns represent objects Access(i, j) is the set of operations that a process executing in Domaini can invoke on Objectj Use of Access Matrix If a process in Domain Di tries to do “op” on object Oj, then “op” must be in the access matrix User who creates object can define access column for that object Can be expanded to dynamic protection Operations to add, delete access rights Special access rights: owner of Oi copy op from Oi to Oj (denoted by “*”) control – Di can modify Dj access rights transfer – switch from domain Di to Dj Copy and Owner applicable to an object Control applicable to domain object Use of Access Matrix (Cont.) Access matrix design separates mechanism from policy Mechanism Operating system provides access-matrix + rules If ensures that the matrix is only manipulated by authorized agents and that rules are strictly enforced Policy 6 User dictates policy user I Who can access what object and in what mode But doesnʼt solve the general confinement problem Access Matrix of Figure A with Domains as Objects Access Matrix with Copy Rights Access Matrix With Owner Rights Modified Access Matrix of Figure B Implementation of Access Matrix Generally, a sparse matrix Option 1 – Global table Store ordered triples in table A requested operation M on object Oj within domain Di -> search table for < Di, Oj, Rk > with M ∈ Rk But table could be large -> wonʼt fit in main memory Difficult to group objects (consider an object that all domains can read) Implementation of Access Matrix (Cont.) Option 2 – Access lists for objects Each column implemented as an access list for one object Resulting per-object list consists of ordered pairs defining all domains with non-empty set of access rights for the object Easily extended to contain default set -> If M ∈ default set, also allow access Implementation of Access Matrix (Cont.) cEach column = Access-control list for one object Defines who can perform what operation Domain 1 = Read, Write Domain 2 = Read Domain 3 = Read Each Row = Capability List (like a key) For each domain, what operations allowed on what objects Object F1 – Read Object F4 – Read, Write, Execute Object F5 – Read, Write, Delete, Copy Implementation of Access Control List Implementation of Access Matrix (Cont.) Option 3 – Capability list for domains Instead of object-based, list is domain based Capability list for domain is list of objects together with operations allows on them Object represented by its name or address, called a capability Execute operation M on object Oj, process requests operation and specifies capability as parameter Possession of capability means access is allowed Capability list associated with domain but never directly accessible by domain Rather, protected object, maintained by OS and accessed indirectly Like a “secure pointer” Idea can be extended up to applications Implementation of Capability List Implementation of Access Matrix (Cont.) Option 4 – Lock-key Compromise between access lists and capability lists Each object has list of unique bit patterns, called locks Each domain as list of unique bit patterns called keys Process in a domain can only access object if domain has key that matches one of the locks Comparison of Implementations t.NL Many trade-offs to consider Global table is simple, but can be large Access lists correspond to needs of users We if im in I Determining set of access rights for domain non- localized so difficult Every access to an object must be checked Many objects and access rights -> slow Capability lists useful for localizing information for a given process But revocation capabilities can be inefficient Lock-key effective and flexible, keys can be passed freely from domain to domain, easy revocation Access Control Protection can be applied to non-file resources Oracle Solaris 10 provides role-based access control (RBAC) to implement least privilege Privilege is right to execute system call or use an option within a system call Can be assigned to processes Users assigned roles granting access to privileges and programs Enable role via password to gain its privileges Similar to access matrix Revocation of Access Rights wt Various options to remove the access right of a domain to an object Immediate vs. delayed Selective vs. general Partial vs. total Temporary vs. permanent Access List – Delete access rights from access list Simple – search access list and remove entry Immediate, general or selective, total or partial, permanent or temporary ‫)‪Revocation of Access Rights (Cont.‬‬ ‫‪ Capability List – Scheme required to locate‬‬ ‫‪capability in the system before capability can be‬‬ ‫‪revoked‬‬ ‫‪e‬‬ ‫‪ Reacquisition – periodic delete, with require and denial if‬‬ ‫‪revoked‬‬ ‫‪ Back-pointers – set of pointers from each object to all‬‬ ‫)‪capabilities of that object (Multics‬‬ ‫‪ Indirection – capability points to global table entry which‬‬ ‫‪points to object – delete entry from global table, not‬‬ ‫)‪selective (CAL‬‬ ‫‪ Keys – unique bits associated with capability, generated‬‬ ‫إلغاء القدرات )‪ (Revocation of Capabilities‬هو عملية إبطال حقوق الوصول املرتبطة بقائمة القدرات التي يمتلكها مستخدم أو عملية معينة‪.‬هناك عدة طرق لتنفيذ إلغاء القدرات في األنظمة األمنية‪ ،‬وكل طريقة تقدم مزايا وعيوب مختلفة حسب متطلبات النظام‪.‬فيما يلي شرح مفصل لكل طريقة‪:‬‬ ‫‪.1 ###‬إعادة االستحواذ )‪(Reacquisition‬‬ ‫‪when capability created‬‬ ‫‪ -‬في هذه الطريقة‪ ،‬يتم إجراء حذف دوري للقدرات‪ ،‬أي أن النظام يقوم بشكل دوري بمراجعة القدرات املتاحة وإلغائها‪.‬‬ ‫‪ -‬إذا تم إلغاء قدرة معينة‪ ،‬فسيتم رفض الوصول عند محاولة استخدامها مرة أخرى‪ ،‬ويجب على املستخدم أو العملية "إعادة االستحواذ" على القدرة‪.‬‬ ‫‪ -‬هذه الطريقة مفيدة لتقليل عدد القدرات النشطة بشكل مستمر ولكن قد تكون غير عملية في األنظمة التي تتطلب تحديثًا فوريًا للحقوق‪.‬‬ ‫‪.2 ###‬املؤشرات العكسية )‪(Back-pointers‬‬ ‫‪ Master key associated with object, key matches master key‬‬ ‫‪ -‬هذه الطريقة تتضمن استخدام مجموعة من املؤشرات من كل كائن تشير إلى جميع القدرات املرتبطة بهذا الكائن‪.‬‬ ‫نظرا لضرورة الحفاظ على مجموعة املؤشرات بشكل متزامن ومحدث‪.‬‬ ‫‪for access‬‬ ‫‪ -‬على سبيل املثال‪ ،‬إذا كان هناك كائن يحتوي على قائمة بالقدرات التي تشير إليه‪ ،‬يمكن استخدام هذه القائمة إللغاء جميع القدرات املرتبطة به عند الحاجة‪.‬‬ ‫‪ -‬تعتبر هذه الطريقة أكثر تعقيدًا في التنفيذ ً‬ ‫‪.3 ###‬التحويل )‪(Indirection‬‬ ‫‪ Revocation – create new master key‬‬ ‫‪ -‬في هذه الطريقة‪ ،‬تكون القدرة مرتبطة بمدخل في جدول عاملي‪ ،‬والذي يشير بدوره إلى الكائن‪.‬بمعنى آخر‪ ،‬القدرة ال تشير مباشرة إلى الكائن‪ ،‬بل إلى مدخل وسيط في الجدول‪.‬‬ ‫‪ -‬عند إلغاء القدرة‪ ،‬يتم حذف هذا املدخل الوسيط من الجدول‪ ،‬مما يجعل جميع القدرات التي كانت تشير إليه غير صالحة‪.‬‬ ‫‪ Policy decision of who can create and modify keys – object‬‬ ‫‪ -‬هذه الطريقة تسهل اإللغاء العام ولكنها قد تكون غير مناسبة لإللغاء االنتقائي حيث يتم إلغاء جميع القدرات التي تشير إلى املدخل في نفس الوقت‪.‬‬ ‫‪.4 ###‬املفاتيح )‪(Keys‬‬ ‫?‪owner or others‬‬ ‫‪ -‬كل قدرة ترتبط بمفتاح فريد يتم إنشاؤه عند إنشاء القدرة‪.‬ويكون هناك "مفتاح رئيسي" مرتبط بالكائن نفسه‪.‬‬ ‫‪ -‬عندما يحاول النظام الوصول إلى الكائن باستخدام قدرة معينة‪ ،‬يتم التحقق من تطابق املفتاح مع املفتاح الرئيسي للكائن‪.‬‬ ‫‪ -‬إذا تم تغيير املفتاح الرئيسي )بإعادة تعيينه(‪ ،‬تصبح كل القدرات التي كانت تعتمد على املفتاح القديم غير صالحة‪.‬‬ ‫‪ -‬هذه الطريقة تعتبر فعالة من حيث األداء‪ ،‬لكنها تتطلب إدارة دقيقة للمفاتيح‪ ،‬خاصة إذا كان هناك العديد من القدرات التي تحتاج إلى اإللغاء‪.‬‬ ‫‪.5 ###‬استخدام الجداول املوزعة )‪(Distributed Tables‬‬ ‫‪ -‬في بعض األنظمة‪ ،‬يتم استخدام جداول موزعة تحتوي على معلومات الوصول والقدرات‪ ،‬ويمكن تعديل هذه الجداول بشكل مركزي إللغاء القدرات‪.‬‬ ‫‪ -‬هذه الطريقة مفيدة في األنظمة املوزعة حيث يتم تخزين بيانات القدرات عبر مواقع متعددة‪.‬‬ ‫كل طريقة من هذه الطرق توفر مزايا مختلفة من حيث األداء‪ ،‬التعقيد‪ ،‬واملرونة‪.‬اختيار الطريقة املثلى يعتمد على املتطلبات الخاصة بالنظام‪ ،‬مثل سرعة اإللغاء املطلوبة‪ ،‬وحجم النظام‪ ،‬ومدى الحاجة إلى اإللغاء االنتقائي للقدرات‪.‬‬ Example of Capability Revocation (Indirection) In indirect addressing, a register may contain the address of a word. If that word's high-order bit (i.e. tag) is 1, then it too is treated as an address. This process of following pointers continues until reaching a word whose high-order bit is 0, which is treated as data. The number of levels of indirection is not constrained in this scheme. Example of Capability Revocation (Indirection) Suppose that a subject A owns some object and would like to give B revocable access. We do this by postulating a new type of capability called an alias. For A to give a revocable access right to B. A creates an alias for the object. It then gives a capability allowing access through the alias to B. It can revoke access for B by invalidating the alias. B cannot get to the object without going through the alias first. ‫‪Example of Capability Revocation‬‬ ‫)‪(Indirection‬‬ ‫إليك شرحً ا تفصيليًا لعملية إلغاء القدرات باستخدام أسلوب التحويل )‪ (Indirection‬وبعض األمثلة‪:‬‬ ‫‪ ###‬مفهوم التحويل )‪(Indirection‬‬ ‫التحويل هو عملية استخدام مرجع غير مباشر للوصول إلى الكائنات‪.‬بدالً من أن تشير القدرة مباشرةً إلى الكائن‬ ‫املستهدف‪ ،‬يتم استخدام مستوى وسيط )مثل "العنوان غير املباشر" أو "االسم املستعار"( للوصول إلى الكائن‪.‬هذا‬ ‫يعني أن القدرة ال تحتوي مباشرةً على عنوان الكائن‪ ،‬ولكنها تشير إلى مكان آخر )مثل جدول( يمكن من خالله‬ ‫الحصول على العنوان الفعلي للكائن‪.‬‬ ‫‪ ###‬كيف يعمل التحويل؟‬ ‫‪ -‬في معالجة العناوين غير املباشرة‪ ،‬قد يحتوي السجل على عنوان لكلمة معينة في الذاكرة‪.‬‬ ‫‪ -‬إذا كانت البتة عالية الترتيب )مثل العالمة( في تلك الكلمة تساوي ‪ ،1‬يتم التعامل مع تلك الكلمة كعنوان‪ ،‬ويتم اتباع‬ ‫املؤشر للوصول إلى املستوى التالي‪.‬‬ ‫‪ -‬تستمر هذه العملية حتى يتم الوصول إلى كلمة تكون بتتها العالية الترتيب تساوي ‪ ،0‬مما يشير إلى أنها تحتوي‬ ‫على بيانات حقيقية وليست عنوانًا‪.‬‬ ‫‪ -‬ال يوجد حد معني لعدد املستويات التي يمكن الوصول إليها في هذه العملية‪.‬‬ ‫‪ ###‬مثال على إلغاء القدرات باستخدام التحويل‬ ‫لنفترض أن لدينا كائن ًا يملكه املوضوع ‪ A‬ويرغب في إعطاء املوضوع ‪ B‬حق الوصول إليه مع إمكانية إلغاء الوصول‬ ‫في أي وقت‪.‬‬ ‫‪ -‬إلنجاز هذا‪ ،‬يمكننا إنشاء نوع جديد من القدرات يسمى "االسم املستعار" )‪.(Alias‬‬ ‫‪ -‬يقوم املوضوع ‪ A‬بإنشاء اسم مستعار للكائن‪.‬‬ ‫‪ -‬ثم يقوم بإعطاء القدرة للوصول عبر االسم املستعار إلى املوضوع ‪.B‬‬ ‫‪ -‬يمكن للموضوع ‪ A‬إلغاء الوصول من خالل إبطال االسم املستعار‪.‬بدون االسم املستعار‪ ،‬لن يتمكن املوضوع ‪ B‬من‬ ‫الوصول إلى الكائن مباشرة‪.‬‬ ‫‪ ###‬ملاذا يعتبر هذا مفيدًا؟‬ ‫استخدام األسماء املستعارة يسمح بإلغاء الوصول بطريقة سهلة وفعالة‪.‬إذا أراد مالك الكائن )‪ (A‬إبطال وصول‬ ‫موضوع آخر )‪ ،(B‬يكفي إبطال االسم املستعار أو تغييره‪ ،‬مما يجعل جميع القدرات التي تشير إلى ذلك االسم‬ ‫املستعار غير صالحة‪.‬‬ ‫‪ ###‬مثال آخر لشرح قوائم القدرات‬ ‫افترض أن هناك سلسلة نصية موجودة في مساحة ذاكرة عملية املستخدم‪ ،‬تحدد كائن ًا معين ًا على النظام‪ ،‬ولكنها ال‬ ‫تحدد حقوق الوصول‪.‬هذه السلسلة النصية ليست قدرة حقيقية ألنها ال تشير إلى حقوق الوصول املشروعة‪.‬‬ ‫‪ -‬إذا كان لدينا بدالً من ذلك زوج من القيم يحدد الكائن مع مجموعة من حقوق الوصول‪ ،‬فإن هذا الزوج ال يزال ال‬ ‫يعتبر قدرة‪ ،‬ألن مجرد وجود هذه القيم في ذاكرة املستخدم ال يعني أن الوصول سيكون مشروعًا‪.‬‬ ‫‪ ###‬تنفيذ العمليات‬ ‫عندما يقوم برنامج املستخدم بتنفيذ تعليمة معينة للوصول إلى الكائن‪ ،‬يتحقق النظام من صحة القدرة من خالل فحص‬ ‫مستوى التحويل وإلغاء القدرة إذا لم تكن القيم مشروعة أو إذا تم إلغاء االسم املستعار‪.‬‬ ‫باختصار‪ ،‬يتيح استخدام التحويل إمكانية إلغاء الوصول بطريقة مرنة دون الحاجة إلى تعديل كل قدرة على حدة‪ ،‬مما‬ ‫يجعل النظام أكثر قابلية لإلدارة وأمانًا‪.‬‬ Examples on Capability List Suppose that, in a user process's memory space, there exists the following string: Although this identifies a unique object on the system, it does not specify access rights and hence is not a capability Suppose there is instead the following pair of values: This pair identifies an object along with a set of access rights. The pair, however, is still not a capability because the user process's possession of these values says nothing about whether that access would actually be legitimate Now suppose that the user program successfully executes the following statement:

Use Quizgecko on...
Browser
Browser