13.07.2015 Views

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

# initialize the value variableset value null# checking the parameter passed to the script# setting the value according to the parameterif {[regexp $argv0 enable]} { set value true }if {[regexp $argv0 disable]} { set value false }if {[regexp $value null]} {puts "Wrong parameter, use enable / disable"return}# modifying the attribute in the configuration$AdminConfig modify $security_item [list [list enabled $value]]# saving the configuration$AdminConfig save# this will dump the current security settings for testing$AdminConfig show $security_itemAs you see, the script assumes that only one application server is defined for thenode since it expects only one secuirty object returning from the query.Configuring user registryThe following script will change the user registry to LDAP.Example: D-3 changeUR.jacl# change user registry# the type of the user registry is hardcoded to LDAP# it also assumes that there is an entry already with the name of LDAP definedfor the security objectset user_regName "LDAP"# get the security objectset security_item [$AdminConfig list <strong>Security</strong>]# list all the user registries definedset user_regs [$AdminConfig list UserRegistry]# find the one that starts with the name we set at the beginning of the scriptforeach user_reg $user_regs { if {[regexp $user_regName $user_reg]} { setnew_user_reg $user_reg; break }}# modify the user registry attribute for the security object$AdminConfig modify $security_item [list [list activeUserRegistry$new_user_reg]]# saving the configuration$AdminConfig saveAppendix D. Using wsadmin scripting for security configuration 517

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!