The Device Access example demonstrates use of the Privilege Separation pattern.
Example architecture
The example contains the following three entities: Device, LoginManager and Storage.
In this example, the Device entity queries the Storage entity to receive information and queries the LoginManager entity for authorization.
The Device entity obtains access to the Storage entity after successful authorization.

This example demonstrates the capability to separate the authorization logic and the data access logic into independent components. This separation guarantees that data access can be opened only after successful authorization. The security module monitors whether authorization was successfully completed. This architecture also enables independent development and testing of the authorization logic and the data access provision logic.
A security policy in the Device Access example has the following characteristics:
Device entity has the capability to query the LoginManager entity for authorization.GetInfo() method of the Storage entity are managed by methods of the Flow security model:session object configuration has two states: unauthenticated and authenticated.unauthenticated.unauthenticated to authenticated and vice versa are allowed.session object is created when the Device entity is started.Device entity successfully calls the Login() method of the LoginManager entity, the state of the session object changes to authenticated.Device entity successfully calls the Logout() method of the LoginManager entity, the state of the session object changes to unauthenticated.Device entity calls the GetInfo() method of the Storage entity, the current state of the session object is verified. The call is allowed only if the current state of the object is authenticated.Example files
The code of the example and build scripts are available at the following path:
/opt/KasperskyOS-Community-Edition-<version>/examples/device_access
Building and running example
See the Building and running examples section.
Page top