Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Oracle Solaris 11 Advanced Administration Cookbook.docx
Скачиваний:
3
Добавлен:
01.07.2025
Размер:
3 Мб
Скачать
☆

References

f Installing Oracle Solaris 11 Systems at http://docs.oracle.com/cd/ E23824_01/html/E21798/docinfo.html#scrolltoc

f Booting and Shutting Down Oracle Solaris 11.1 Systems at http://docs.oracle. com/cd/E26502_01/html/E28983/docinfo.html#scrolltoc

f Configuring a Basic DNS Server + Client in Solaris 11, Paul Johnson, at http://www.oracle.com/technetwork/articles/servers-storage- admin/solaris11-net-svcs-ips-2086656.html

f Exploring Networking, Services, and the New Image Packaging System In Oracle Solaris 11, Alexandre Borges, at http://www.oracle.com/technetwork/articles/ servers-storage-admin/solaris11-net-svcs-ips-2086656.html

7

Configuring and

Administering RBAC

and Least Privileges

In this chapter, we will cover the following topics:

f Configuring and using RBAC

f Playing with least privileges

Introduction

Role-based access control (RBAC) is an amazing feature, which also exists on Oracle Solaris 11 (its origin was in Oracle Solaris 8), that primarily makes it possible to restrict the granted privileges to a normal user for executing tasks. Putting this another way, RBAC makes it feasible to delegate only the necessary privileges for a regular user to be able to accomplish administrative tasks in a way similar to that of a sudo program. When compared with a sudo program, the main difference is the fact that RBAC is completely integrated in the operating system, and it is used during the user logon process to Oracle Solaris 11. Moreover, RBAC offers a more granular access to privileges than sudo does, and integration with another great feature from Oracle Solaris 11 named least privilege, which is used to cut out unnecessary privileges from processes and programs, allows you to reduce the attack surface of a hacker.

Configuring and Administering RBAC and Least Privileges

Configuring and using rbac

Before explaining and implementing the RBAC feature, it is necessary to remember why RBAC is necessary and, afterwards, to learn some fundamental concepts.

According to our previous study on Oracle Solaris 11, it would not be possible for a normal user to reboot an Oracle Solaris 11 system, as shown in the following command:

root@solaris11-1:~# useradd -d /export/home/aborges -m -s /bin/bash aborges

80 blocks

root@solaris11-1:~# passwd aborges

New Password: hacker123!

Re-enter new Password: hacker123!

passwd: password successfully changed for aborges root@solaris11-1:~# su - aborges

Oracle Corporation SunOS 5.11 11.1 September 2012 aborges@solaris11-1:~$ reboot

reboot: permission denied aborges@solaris11-1:~$

A simple and completely inappropriate solution would be to give a password from the root

account to user aborges. However, this is unimaginable in a professional company. Another and a recommended solution is to use RBAC, which is a security feature that allows regular users to accomplish administrative tasks such as rebooting a system, as we have tried previously.

The RBAC framework contains the following objects:

f Role: This is a special type of user that is created to execute administrative tasks, although it isn't possible to log in to a system and the correct procedure is to log in as a user and to assume the role using the su command. As the role is a kind of user,

it is configured in the /etc/passwd file and it has a password defined in the /etc/

shadow file. However, different from a user, it isn't possible to log in to Oracle Solaris 11 using a role. The user must log in using a normal account and then they can assume a role using the su command.

Chapter 7

f Profile: This is a set of commands. Any role assigned to a profile can execute any command from this profile. All system profiles are defined in the /etc/security/ prof_attr.d/core-os file, and local profiles can be defined in the /etc/ security/prof_attr file. To list all the profiles, use the following command:

root@solaris11-1:~# getent prof_attr | more

Software Installation:RO::Add application software to the system:auths=solaris.smf.manage.servicetags;profiles=ZFS File System Management;help=RtSoftwareInst

all.html

NTP Management:RO::Manage the NTP service:auths=solaris.smf. manage.ntp,solaris.smf.value.ntp

Desktop Configuration:RO::Configure graphical desktop software:auths=solaris.smf.manage.dt.login,solaris.smf.manage. x11,solaris.smf.manage.font,solaris.smf.m

anage.opengl

Device Security:RO::Manage devices and Volume Manager:auths=solaris.smf.manage.dt.login,solaris. device.*,solaris.smf.manage.vt,solaris.smf.manage.allocate;he

lp=RtDeviceSecurity.html

Desktop Removable Media User:RO::Access removable media for desktop user:

(truncated output)

f Authorization: This represents a special form of privilege that is set in order

to accomplish specific tasks, such as accessing a CD-ROM and managing the CUPS printing service, NTP service, Zones, SMF framework, and so on. Typically, authorizations are created either from the Oracle Solaris installation or from new installed software. All system authorizations are defined in the /etc/ security/auth_attr.d/core-os file, and local authorizations are defined

in the /etc/security/auth_attr file. To list all the authorizations, we run the following command:

root@solaris11-1:~# getent auth_attr | more

solaris.smf.read.ocm:::Read permissions for protected Oracle Configuration Manager Service Properties::

solaris.smf.value.ocm:::Change Oracle Configuration Manager System Repository Service values::

solaris.smf.manage.ocm:::Manage Oracle Configuration Manager System Repository Service states::

solaris.smf.manage.cups:::Manage CUPS service states::help=ManageCUPS.html

solaris.smf.manage.zfs-auto-snapshot:::Manage the ZFS Automatic Snapshot Service::

Configuring and Administering RBAC and Least Privileges

solaris.smf.value.tcsd:::Change TPM Administation value properties::

(truncated output)

f Privilege: This is a singular right that can be assigned to a user, role, command, or even a system.

f Execution attributes: These are commands that are defined in the /etc/ security/exec_attr.d/core-os (system execution attributes) or /etc/ security/exec_attr files (local definitions), and they are assigned to one

or more profiles. To list all the execution attributes, we run the following command:

root@solaris11-1:~# getent exec_attr | more

DTrace Toolkit:solaris:cmd:::/usr/dtrace/DTT/*/*:privs=dtrace_ kernel,dtrace_proc,dtrace_user

Desktop Configuration:solaris:cmd:RO::/usr/bin/ scanpci:euid=0;privs=sys_config

Desktop Configuration:solaris:cmd:RO::/usr/X11/bin/ scanpci:euid=0;privs=sys_config

OpenLDAP Server Administration:suser:cmd:RO::/usr/sbin/slapd:uid=o penldap;gid=openldap;privs=basic,net_privaddr

OpenLDAP Server Administration:suser:cmd:RO::/usr/sbin/slapacl:uid

=openldap;gid=openldap

(truncated output)

f Profile shell: This is a special kind of profile (pfbash, pfsh, pfcsh, or pfzsh) assigned to users during a su command to assume a role or a login shell that allows access to specific privileges. It is necessary to use any one of these profile shells.

f Security policy: This defines default privileges and profiles for users. The related configuration file is /etc/security/policy.conf, as shown in the following command:

root@solaris11-1:~# more /etc/security/policy.conf

There are two ways to use RBAC. The first method is simpler and more straightforward; you can create and assign a profile directly to a user account in order to log in as a normal user and use the pfexec command to execute additional commands from the assigned profile.

The second method is to put all mentioned concepts about RBAC (commands, authorizations, profiles, roles, and users) together following a schema as shown next (from right to left):

User <-- Role <-- Profile <-- Commands and/or Authorizations

Chapter 7

The second method is more complex, and the required steps to use RBAC, as described in the previous sequence, are as follows:

  1. Create a role using the roleadd command.

  2. Create a profile, editing the /etc/security/prof_attr file.

  3. Assign commands to the created profile (step 2) in /etc/security/exec_attr or assign authorizations (/etc/security/auth_attr) to the profile in the /etc/ security/prof_attr file.

  4. Assign the profile to the role using the rolemod command.

  5. Create a password for the role using the passwd command.

  6. Assign one or more users to the role using the usermod command.

  7. When the user needs to use the assigned commands, execute su - <rolename>.

This is nice! This is a summary of the concepts required to manage RBAC. We will learn how to execute a step-by-step procedure for both methods.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]