Студопедия

Главная страница Случайная страница

Разделы сайта

АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторикаСоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника






Интерфейс Current






Обычно разработчики прибегают к использованию API Security Service в тех случаях, когда нужно отслеживать действия в системе и сохранять информацию об этом, предоставлять права доступа с учетом большого количества информации (в том числе той, которая известна только на момент выполнения вызова) или при организации взаимодействия с унаследованными системами.

Одним из наиболее важных интерфейсов Сервиса Безопасности является интерфейс Current - точнее, таких интерфейсов даже два – они определены в разных модулях. Это интерфейсы SecurityLevel1:: Current и SecurityLevel2:: Current. Получение доступа к интерфейсу Current выполняется стандартным образом, с помощью вызова для ORB метода resolve_initial_references() с аргументом «SecurityCurrent».Как обычно, после вызова метода resolve_initial_references() нужно выполнить преобразование типа результата к нужному интерфейсу Current. При преобразовании к SecurityLevel2:: Current необходимо предварительно убедиться, что реализация поддерживает этот уровень. Получить информацию о реализации можно с помощью вызова метода CORBA:: ORB:: get_service_information(), задав в качестве параметра типа CORBA:: ServiceType значение константы CORBA:: Security. Метод возвращает одно из следующих значений:

module Security { const CORBA:: ServiceOption CommonInteroperabilityLevel0 = 10; const CORBA:: ServiceOption CommonInteroperabilityLevel1 = 11; const CORBA:: ServiceOption CommonInteroperabilityLevel2 = 12; };

На уровне Security Level 1 интерфейс Current содержит единственный метод, который позволяет получить список атрибутов безопасности в контексте выполняемого защищенного вызова:

module SecurityLevel1 { local interface Current: CORBA:: Current { Security:: AttributeList get_attributes (in Security:: AttributeTypeList attributes); }; };

Единственный метод возвращает связанный с контекстом вызова список атрибутов безопасности указанных типов.

IDL-объявления основных типов выглядят так:

module Security { typedef string SecurityName; typedef sequence < octet> Opaque; // Объявления констант для Security Service Options const CORBA:: ServiceOption SecurityLevel1 = 1; const CORBA:: ServiceOption SecurityLevel2 = 2; const CORBA:: ServiceOption NonRepudiation = 3; const CORBA:: ServiceOption SecurityORBServiceReady = 4; const CORBA:: ServiceOption SecurityServiceReady = 5; const CORBA:: ServiceOption ReplaceORBServices = 6; const CORBA:: ServiceOption ReplaceSecurityServices = 7; const CORBA:: ServiceOption StandardSecureInteroperability = 8; const CORBA:: ServiceOption DCESecureInteroperability = 9; // Service options for Common Secure Interoperability const CORBA:: ServiceOption CommonInteroperabilityLevel0 = 10; const CORBA:: ServiceOption CommonInteroperabilityLevel1 = 11; const CORBA:: ServiceOption CommonInteroperabilityLevel2 = 12;... // Расширяемые семейства (families) для стандартных типов данных struct ExtensibleFamily { unsigned short family_definer; unsigned short family; };
typedef sequence< octet> OID; typedef sequence< OID> OIDList; typedef unsigned long SecurityAttributeType;

 

// Общие атрибуты (family = 0) const SecurityAttributeType AuditId = 1; const SecurityAttributeType AccountingId = 2; const SecurityAttributeType NonRepudiationId = 3; // Атрибуты привилегий (family = 0) const SecurityAttributeType _Public = 1; const SecurityAttributeType AccessId = 2; const SecurityAttributeType PrimaryGroupId = 3; const SecurityAttributeType GroupId = 4; const SecurityAttributeType Role = 5; const SecurityAttributeType AttributeSet = 6; const SecurityAttributeType Clearance = 7; const SecurityAttributeType Capability = 8; struct AttributeType { ExtensibleFamily attribute_family; SecurityAttributeType attribute_type; }; typedef sequence< AttributeType> AttributeTypeList; struct SecAttribute { AttributeType attribute_type; OID defining_authority; Opaque value; // значение зависит от defining_authority }; typedef sequence < SecAttribute> AttributeList; }

Таким образом, метод SecurityLevel1:: Current:: get_attributes() возвращает, по сути, состояние объекта Credentials, сопоставленного с выполняемым вызовом. На уровне Level1 вызов этого метода обычно выполняется самим ORB’ом.

На уровне Level 2 появляется дополнительная функциональность, связанная с явным управлением процессом обеспечения безопасности:

module SecurityLevel2 {... local interface Credentials { Credentials copy (); void destroy(); readonly attribute Security:: InvocationCredentialsType credentials_type; readonly attribute Security:: AuthenticationStatus authentication_state; readonly attribute Security:: MechanismType mechanism; attribute Security:: AssociationOptions accepting_options_supported; attribute Security:: AssociationOptions accepting_options_required; attribute Security:: AssociationOptions invocation_options_supported; attribute Security:: AssociationOptions invocation_options_required;... boolean set_attributes (in Security:: AttributeList requested_attributes, out Security:: AttributeList actual_attributes); Security:: AttributeList get_attributes (in Security:: AttributeTypeList attributes);... }; typedef sequence < Credentials> CredentialsList; local interface ReceivedCredentials: Credentials {... };... local interface Current: SecurityLevel1:: Current { readonly attribute ReceivedCredentials received_credentials; }; };

Заключение

Совместное использование возможностей ORB, стандартных компонентов Сервиса Безопасности CORBA и его API позволяет создавать распределенные системы с требуемым уровнем защиты. При этом разработчик можно легко задействовать стандартные решения в области обеспечения безопасности, которые уже широко используются в компьютерной индустрии.






© 2023 :: MyLektsii.ru :: Мои Лекции
Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав.
Копирование текстов разрешено только с указанием индексируемой ссылки на источник.