WAS v8.5 > Script the application serving environment (wsadmin) > Scripting for security > Configure security with scripting > Configure multiple security domains using scripting

Map resources to security domains using scripting

Use this topic to assign management resources to security domains. Set management resources to your security domains to customize your security configuration for a cell, server, or cluster.

Users assigned to the administrator role can configure security domains. Verify that we have the appropriate administrative role before configuring security domains. Also, create a security domain, or copy an existing security domain before assigning resources to a security domain. After creating a security domain, we can map management resources to the security domain. We can assign resources to a security domain at the server, cell, and cluster level. Use the following steps to assign a resource to a security domain:

  1. Launch the wsadmin scripting tool using the Jython scripting language. See the Starting the wsadmin scripting client article for more information.

  2. Determine which security domain to map a resource.

    Use the listSecurityDomains command to view a list of security domains in your configuration. Specify true for the optional -listDescription parameter to list the description for each security domain, as the following Jython example demonstrates:

      print AdminTask.listSecurityDomains('-listDescription true')

    The command returns the following example attribute list output:

    {{name myDomain}
    {description {security domain for administrative applications}}}
    {{name domain2}
    {description {new domain for cell123}}}
  3. Assign a resource to a security domain.

    Use the mapResourceToSecurityDomain command to assign a management resource to the security domain. For example, use the following Jython command to secure all applications on the server1 cell with the security attributes in the domain2 security domain:

      AdminTask.mapResourceToSecurityDomain('-securityDomainName domain2 -resourceName Cell=myCell:Node=myNode:Server=server1')

  4. Save your configuration changes.

    Use the following command example to save your configuration changes:


Results

Your security domain is updated in your configuration. All applications in the specified resource use the security attributes specified by the security domain. If the security domain does not contain all security attributes, then the missing attributes are obtained from the global security configuration.

Restart each resource that you assigned to a security domain.


Related


Configure security domains using scripting
Manage servers and nodes with scripting
Start the wsadmin scripting client using wsadmin.sh


+

Search Tips   |   Advanced Search