RBAC mitrontokel???

RBAC-cal kell megoldanom valamit, erre en(egy meglevo doksi alapjan)

exec_attr -ba a kivant profile parancsokat, pl:

myprofile:suser:cmd:::/usr/sbin/uiseradd:uid=0

csinalok egy role-t

roleadd -m -d /export/ftdfh/ myrole

hozzaadom a profile-t a rol-hoz

rolemod -P myprofile myrole

csinalok 1 usert magamnak

useradd myuser

hozzaadom a role-t

usermod -R myroole myuser

ezutan

su - myuser
/usr/sbin/useradd -g xxc tut
Permission denied

1 napja tokolok vele, mi lehet a baj. igen az ora-s doksi is kb. ugyanezt csinalja.

Otlet? Ugyfel/project manager/fonokom cimmog, en meg nem birok menni froccsozni, wtf?

Hozzászólások

profiles se hozza az ujonnan hozzaadott profile-t

BDL10442FE# id
uid=0(root) gid=0(root)
BDL10442FE# profiles myuser
Basic Solaris User
All
BDL10442FE#

Szia!

Nemtudom, hogy eliras, vagy tenyleg igy szerepel az exec_attr-ban: myprofile:suser:cmd:::/usr/sbin/uiseradd:uid=0
. Ha igen, akkor javitsd ki useradd-ra. A profiles myuser nem mutatja, azt csak a profiles myrole mutatna meg. A roles myuser mutatja a role-kat.
Masik dolog, hogy az exec_attr-ba beirt parancs nem lehet symlink, azt nem koveti az RBAC. Tehat nezd meg, hogy a /usr/sbin/useradd nem symlink-e veletlenul. Most nincs elottem Solaris, kulonben megneznem magam.
A userbol at kell menni role-ba (su - myrole), hogy mukodjon. Ha a userhez rendeled a profile-t, akkor a user pfexec useradd... modon tudja hasznalni a profile-ban levo parancsot.

Remelem segitettem.

Toni

man roles, hasznos olvasmány

Each user may have zero or more roles. Roles have most of
the attributes of normal users and are identified like nor-
mal users in passwd(4) and shadow(4). Each role must have an
entry in the user_attr(4) file that identifies it as a role.
Roles can have their own authorizations and profiles. See
auths(1) and profiles(1).

Roles must have valid passwords and one of the shells that
interprets profiles: either pfcsh, pfksh, or pfsh. See
pfexec(1).

Role assumption may be performed using su(1M), rlogin(1), or
some other service that supports the PAM_RUSER variable.
Successful assumption requires knowledge of the role's pass-
word and membership in the role. Role assignments are speci-
fied in user_attr(4).

Ja, és bezárhatnád a postban a code taget rendesen, mert így a kommentek is csúnyák. Két helyen is hiányzik a / a lezáró tagből.

Mivel azota se jott "megoldas", ugy veszem, hogy nem en rontok el valamit. De akkor hanem ki/mi? Eddig akarmi doksit/howtot neztem, mind kb. ugyanezt csinalja. Ha ebbol nem lesz valami holnap, az csunya lesz. Sajnos nem tudok remote-t adni, pedig meg 1-2 sort is megerne a segites.

Szerintem nem hagytam ki egy parancsot sem, de szóljál, ha nem pont ugyanezt kapod:
root@x # echo 'myprofile:::my profile:' >> /etc/security/prof_attr
root@x # echo 'myprofile:solaris:cmd:::/usr/sbin/useradd:uid=0' >> /etc/security/exec_attr
root@x # roleadd -c myrole -m -d /export/home/myrole myrole
root@x # passwd myrole
New Password:
Re-enter new Password:
passwd: password successfully changed for myrole
root@x # rolemod -P myprofile myrole
root@x # groupadd -g 200 mygroup
root@x # rolemod -g 200 myrole
root@x # useradd -g 200 -u 200 -c myuser -s /bin/bash -m -d /export/home/myuser myuser
root@x # usermod -R myrole myuser
root@x # su - myuser
Oracle Corporation SunOS 5.10 Generic Patch January 2005
myuser@x:~>roles
myrole
myuser@x:~>profiles
Basic Solaris User
All
myuser@x:~>su - myrole
Password:
\u@\h:\w>roles
No roles
\u@\h:\w>profiles
myprofile
Basic Solaris User
All
\u@\h:\w>which useradd
/usr/sbin/useradd
\u@\h:\w>useradd test
\u@\h:\w>userdel test
UX: userdel: ERROR: Permission denied.
\u@\h:\w>id test
uid=150027(test) gid=1(other)