Tuesday, March 17, 2015

Solaris 10: How to give Special Privileges to specific Zones


Whenever we install Solaris Zones, Solaris will assign some set of privileges to take care of activities that impacts overall systems that means that particular zone as well as other zones. And Solaris classifies the available privileges as 
1. Default Privileges
2. Optional Privileges
3. Prohibited Privileges
  • Default Privileges- which are assigned to every zone during the installation
Example: file_chown
Allows a process to change a file's owner user ID.
Allows a process to change a file's group ID to one other than the process' effective group ID or one of the process' supplemental group IDs.
  • Optional Privileges-  which we have to assign manually, using the limitpriv option
Example: sys_time
Allows a process to manipulate system time using any of the appropriate system calls: stime, adjtime, ntp_adjtime and the IA specific RTC calls.
Why it is Optional?
A system with non-global zones will share one kernel for all zones (the global zone as well as all configured non-global zone). As a result there is only one date/time on the entire setup and this time is usually controlled by the global zone only. By default the privilege to change the date and time is not available inside a non-global zone and therefore the NTP service will fail to adjust the time.
The default configuration for non-global zones assumes that the time synchronization is done in the global zone and that there is no need to adjust the system time from inside a non-global zone.
If the administrator of a non-global zone is able to change the system time then these changes will affect all running zones (including the global zone) and this may be considered a security risk.
How to assign Optional Privilege to zone?
global-zone# zonecfg -z myzone info limitpriv
limitpriv:

global-zone# zonecfg -z myzone set limitpriv="default,sys_time"
global-zone# zoneadm -z myzone reboot  
Once the sys_time privilege is available in the non-global zone you can continue to setup NTP as usual, i.e. configure the /etc/inet/ntp.conf file and enable the ntp service.
  • Prohibited  Privileges -  which currently not supported to assign

 
How do we know currently available privileges set to a Zone?
global-zone# ppriv -lv myzone
contract_event
Allows a process to request critical events without limitation.
Allows a process to request reliable delivery of all events on
any event queue.
contract_observer
Allows a process to observe contract events generated by
contracts created and owned by users other than the process's
effective user ID.
Allows a process to open contract event endpoints belonging to
contracts created and owned by users other than the process's
effective user ID.
file_chown
Allows a process to change a file's owner user ID.
Allows a process to change a file's group ID to one other than
the process' effective group ID or one of the process'
supplemental group IDs.

-------------------------- SNIP ---------------------------------

 
Below are List of Available Privileges in Solaris 10

 

Privilege Status Notes 
cpc_cpuOptional Access to certain cpc(3CPC) counters
dtrace_procOptional fasttrap and pid providers; plockstat(1M)
dtrace_userOptional profile and syscall providers
graphics_accessOptional ioctl(2) access to agpgart_io(7I)
graphics_mapOptional mmap(2) access to agpgart_io(7I)
net_rawaccessOptional in shared-IP zones. 
Default in exclusive-IP zones. 
Raw PF_INET/PF_INET6 packet access
proc_clock_highresOptional Use of high resolution timers 
proc_priocntlOptional Scheduling control; priocntl(1)
sys_ipc_configOptional Raising IPC message queue buffer size 
sys_timeOptional System time manipulation; xntp(1M)
dtrace_kernelProhibited Currently unsupported 
proc_zoneProhibited Currently unsupported 
sys_configProhibited Currently unsupported 
sys_devicesProhibited Currently unsupported 
sys_linkdirProhibited Currently unsupported 
sys_net_configProhibited Currently unsupported 
sys_res_configProhibited Currently unsupported 
sys_suser_compatProhibited Currently unsupported 
proc_execRequired, Default Used to start init(1M)
proc_forkRequired, Default Used to start init(1M)
sys_mountRequired, Default Needed to mount required file systems 
sys_ip_configRequired, Default in exclusive-IP zones 
Prohibited in shared-IP zones 
Required to boot zone and initialize IP networking in exclusive-IP zone 
contract_eventDefault Used by contract file system 
contract_observerDefault Contract observation regardless of UID 
file_chownDefault File ownership changes 
file_chown_selfDefault Owner/group changes for own files 
file_dac_executeDefault Execute access regardless of mode/ACL 
file_dac_readDefault Read access regardless of mode/ACL 
file_dac_searchDefault Search access regardless of mode/ACL 
file_dac_writeDefault Write access regardless of mode/ACL 
file_link_anyDefault Link access regardless of owner 
file_ownerDefault Other access regardless of owner 
file_setidDefault Permission changes for setid, setgid, setuid files
ipc_dac_readDefault IPC read access regardless of mode 
ipc_dac_ownerDefault IPC write access regardless of mode 
ipc_ownerDefault IPC other access regardless of mode 
net_icmpaccessDefault ICMP packet access: ping(1M)
net_privaddrDefault Binding to privileged ports 
proc_auditDefault Generation of audit records 
proc_chrootDefault Changing of root directory
proc_infoDefault Process examination 
proc_lock_memoryDefault Locking memory; shmctl(2)and mlock(3C)
If this privilege is assigned to a non-global zone by the system administrator, consider also setting the zone.max-locked-memory resource control to prevent the zone from locking all memory.
proc_ownerDefault Process control regardless of owner 
proc_sessionDefault Process control regardless of session 
proc_setidDefault Setting of user/group IDs at will 
proc_taskidDefault Assigning of task IDs to caller 
sys_acctDefault Management of accounting 
sys_adminDefault Simple system administration tasks 
sys_auditDefault Management of auditing 
sys_nfsDefault NFS client support 
sys_resourceDefault Resource limit manipulation 
  

No comments:

Post a Comment