#!/usr/bin/perl -w # # Demo script accompanying TD09 presentation # Developing and Deploying Securely # # This script is for the RBAC portion of the talk v1.0.2 # use demotools; demotools::setprompt("[global 1]: \$"); $user = $ENV{"USER"}; #-------------------------------------------------- # main # slide 32 system("clear"); demotools::cmd("whoami"); printf("\n"); demotools::cmd("profiles"); printf("\n"); demotools::cmd("auths"); printf("\n"); demotools::cmd("grep $user /etc/user_attr"); printf("\n"); demotools::cmd("pfexec usermod -P \\\"\\\" $user", "pfexec usermod -P \"\" $user"); printf("\n"); demotools::cmd("grep $user /etc/user_attr"); printf("\n"); demotools::cmd("auths"); # slide 33 printf("\n"); demotools::cmd("pfexec usermod -P \\\"Primary Administrator\\\" $user", "pfexec usermod -P \"Primary Administrator\""); printf("\n"); demotools::cmd("auths \| grep grant"); printf("\n"); printf("## whoami\n"); printf("## usermod -P \"Primary Administrator\" $user\n"); printf("## exit\n"); printf("\n"); demotools::cmd("su root"); printf("\n"); demotools::cmd("grep $user /etc/user_attr"); printf("\n"); demotools::cmd("auths"); #--------------------------------------------------