{"id":4154,"date":"2012-06-22T08:32:02","date_gmt":"2012-06-22T13:32:02","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=4154"},"modified":"2012-06-22T08:32:03","modified_gmt":"2012-06-22T13:32:03","slug":"weblogic11g-security-providers","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=4154","title":{"rendered":"WebLogic11g: Security Providers"},"content":{"rendered":"<div class='toc wptoc'>\n<h2>Contents<\/h2>\n<ol class='toc-odd level-1'>\n\t<li>\n\t\t<a href=\"#Configure_Security_Providers\">Configure Security Providers<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Required_providers\">Required providers<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Optional_providers\">Optional providers<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Audit_Provider\">Audit Provider<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Authentication_Provider\">Authentication Provider<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Password_Validation_Provider\">Password Validation Provider<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Add_Other_Providers\">Add Other Providers<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#ExportImport_Authentication_Data\">Export\/Import Authentication Data<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Configure_Entitlement_Caching\">Configure Entitlement Caching<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Set_Default_Security_Realm\">Set Default Security Realm<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Reverting_Realm\">Reverting Realm<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Add_Users\">Add Users<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Add_Groups\">Add Groups<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Security_Roles\">Security Roles<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Security_Policies\">Security Policies<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#WAR_and_EJB_Security_Models\">WAR and EJB Security Models<\/a>\n\t\t\t\t<ol class='toc-odd level-3'>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#DD_Only_Model\">DD Only Model<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#Custom_Roles_Model\">Custom Roles Model<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#Custom_Roles_and_Policies_Model\">Custom Roles and Policies Model<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#DD_Security_Elements\">DD Security Elements<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t<\/ol>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Configure_Embedded_LDAP_Server\">Configure Embedded LDAP Server<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#RDBMS_Security_Store\">RDBMS Security Store<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#References\">References<\/a>\n\t<\/li>\n<\/ol>\n<\/ol>\n<\/div>\n<div class='wptoc-end'>&nbsp;<\/div>\n<span id=\"Configure_Security_Providers\"><h2>Configure Security Providers<\/h2><\/span>\n<p>* Create a new realm named <strong>tmprealm<\/strong><\/p>\n<span id=\"Required_providers\"><h3>Required providers<\/h3><\/span>\n<p>&#8211; Authentication provider,<br \/>\n&#8211; Authorization provider,<br \/>\n&#8211; Adjudication provider,<br \/>\n&#8211; Credential Mapping provider,<br \/>\n&#8211; CertPath Builder,<br \/>\n&#8211; Role Mapping provider. <\/p>\n<span id=\"Optional_providers\"><h3>Optional providers<\/h3><\/span>\n<p>&#8211; Identity Assertion,<br \/>\n&#8211; Auditing,<br \/>\n&#8211; Certificate Registry providers<\/p>\n<span id=\"Audit_Provider\"><h3>Audit Provider<\/h3><\/span>\n<p>* Add DefaultAuditor name <strong>tmpDefAud<\/strong><br \/>\n* Default logfile: <em>DOMAIN_ HOME\\<server_name>\\logs\\DefaultAuditRecorder.log<\/em><br \/>\n* Change default log file directory: -Dweblogic.security.audit.auditLogDir=C:\\audit<br \/>\n* Enable configuration auditing:<br \/>\n<em>Domain > Configuration > General > Advanced > Configuration Audit Type<\/em><br \/>\n&#8211; audit<br \/>\n&#8211; log<br \/>\n&#8211; log and audit<\/p>\n<span id=\"Authentication_Provider\"><h3>Authentication Provider<\/h3><\/span>\n<p>* Authentication Provider control flag:<br \/>\n&#8211; REQUIRED: if fails go to next authenticator<br \/>\n&#8211; REQUISITE: if fails return to application<br \/>\n&#8211; SUFFICIENT:<br \/>\n&#8211; OPTIONAL:<br \/>\n* Create a new DefaultAuthenticator named <strong>tmpDefAuth<\/strong><br \/>\n<em>Security Realm > Realm Name > Providers > Authentication Provider<\/em><\/p>\n<span id=\"Password_Validation_Provider\"><h3>Password Validation Provider<\/h3><\/span>\n<p>* Add Password Validation Provider named <strong>tmpSysPassVal<\/strong><br \/>\n<em>Security Realm > Realm Name > Providers > Password Validation<\/em><\/p>\n<span id=\"Add_Other_Providers\"><h3>Add Other Providers<\/h3><\/span>\n<p>* Add <strong>tmpDefIdAsserter<\/strong>; set active type to <strong>AuthenticatedUser<\/strong><br \/>\n* Add <strong>tmpXACMLAuthorizer<\/strong><br \/>\n* Add <strong>tmpDefAdj<\/strong><br \/>\n* Add <strong>tmpXACMLRoleMapper<\/strong><br \/>\n* Add <strong>tmpCredMapper<\/strong><br \/>\n* Add <strong>tmpWebLogicCertPath <\/strong>(<strong>check <\/strong><em>Current Builder<\/em>)<\/p>\n<span id=\"ExportImport_Authentication_Data\"><h3>Export\/Import Authentication Data<\/h3><\/span>\n<p>* Export<br \/>\n<em>Security Realm > myrealm > Providers > Authentication > DefaultAuthenticator > Migration > Export<\/em><br \/>\n* Import<br \/>\n<em>Security Realm > tmprealm > Providers > Authentication > DefaultAuthenticator > Migration > Export<\/em><\/p>\n<span id=\"Configure_Entitlement_Caching\"><h3>Configure Entitlement Caching<\/h3><\/span>\n<p>* Set cache preload to true:<br \/>\n-Dweblogic.entitlement.engine.cache.preload=true<br \/>\n* Set cache max numbers:<br \/>\n-Dweblogic.entitlement.engine.cache.max_role_count=4000<br \/>\n-Dweblogic.entitlement.engine.cache.max_resource_count=3200<\/p>\n<span id=\"Set_Default_Security_Realm\"><h3>Set Default Security Realm<\/h3><\/span>\n<p>* Set at:<br \/>\n<em>domain > Security > General > Default realm<\/em><\/p>\n<span id=\"Reverting_Realm\"><h3>Reverting Realm<\/h3><\/span>\n<p>* Backup config.xml files: domain\/config\/backup_confign.xml<br \/>\n* Copy backup config file to config.xml<\/p>\n<span id=\"Add_Users\"><h3>Add Users<\/h3><\/span>\n<p>* Go to <em>Security Realm > tmprealm > Users and Groups > Users<\/em><br \/>\n* Add user tmpUser\/welcome1<br \/>\n* Go to <em>Security Realm > tmprealm > Users and Groups > tmpUser > Groups<\/em><br \/>\n* Add <em>Administrator <\/em>group<\/p>\n<span id=\"Add_Groups\"><h3>Add Groups<\/h3><\/span>\n<p>* Go to <em>Security Realm > tmprealm > Users and Groups > Groups<\/em><br \/>\n* Add group tmpGroup<br \/>\n* Default Groups:<br \/>\n&#8211; Administrators<br \/>\n&#8211; Deployers<br \/>\n&#8211; Operators<br \/>\n&#8211; Monitors<br \/>\n&#8211; AppTesters<br \/>\n&#8211; CrossDomainConnectors<br \/>\n&#8211; AdminChannelUsers<br \/>\n&#8211; OracleSystemGroup<\/p>\n<span id=\"Security_Roles\"><h3>Security Roles<\/h3><\/span>\n<p>* Security roles are privileges the server grants to a user, group, or time of day.<br \/>\n* Difference from groups:<br \/>\n&#8211; granted at runtime dynamically (by role mapper provider)<br \/>\n&#8211; can be scoped to a specific resource<br \/>\n* Role types:<br \/>\n&#8211; Global roles<br \/>\n&#8211; Scoped roles<br \/>\n* Default global roles<br \/>\n&#8211; Admin<br \/>\n&#8211; Anonymous<br \/>\n&#8211; Deployer<br \/>\n&#8211; Operator<br \/>\n&#8211; Monitor<br \/>\n&#8211; AppTester<br \/>\n&#8211; CrossDomainConnector<br \/>\n&#8211; OracleSystemRole<\/p>\n<span id=\"Security_Policies\"><h3>Security Policies<\/h3><\/span>\n<p>* Security policy restricts WebLogic resource to a user, group, or security role<br \/>\n* Root level security policies: apply to a specific <strong>type <\/strong>of resource, e.g. JMS resource, EJB resource<br \/>\n* Hierarchical security policies: apply to a specific <strong>instance <\/strong>of resource, e.g. web app, ear app, ejb method<\/p>\n<span id=\"WAR_and_EJB_Security_Models\"><h3>WAR and EJB Security Models<\/h3><\/span>\n<p>* Two security models:<br \/>\n&#8211; JEE Security model aka DD Only model<br \/>\n&#8211; WebLogic security model<br \/>\n* Which model to use is made at deployment time. Need redeployment to change security model.<\/p>\n<span id=\"DD_Only_Model\"><h4>DD Only Model<\/h4><\/span>\n<p>* Uses groups, roles, and security policies defined in<br \/>\n&#8211; web.xml<br \/>\n&#8211; weblogic.xml<br \/>\n&#8211; ejb-jar.xml<br \/>\n&#8211; weblogic-ejb-jar.xml<br \/>\n* Developers use DD to<br \/>\n&#8211; Define security roles (if developer does not define roles then no security)<br \/>\n&#8211; Map EJBs\/Web URLs to roles<br \/>\n&#8211; Map Roles to principals (users\/groups)<br \/>\n* DD contained security info is parsed at server bootup time by<br \/>\n&#8211; Authorization Provider that implements <strong>DeployableAuthorizationProvider <\/strong><br \/>\n&#8211; Role Mapping Provider that implements <strong>DeployableRoleProvider<\/strong><\/p>\n<span id=\"Custom_Roles_Model\"><h4>Custom Roles Model<\/h4><\/span>\n<p>* Developers define security policies (not principals) in DD to map:<br \/>\n&#8211; EJBs\/Web URLs to roles<br \/>\n* Administrator\/Deployer:<br \/>\n&#8211; Define security roles (all roles defined in DD are ignored by server)<br \/>\n&#8211; Map roles to principals<\/p>\n<span id=\"Custom_Roles_and_Policies_Model\"><h4>Custom Roles and Policies Model<\/h4><\/span>\n<p>* Completely ignores DD security settings<br \/>\n* ??The drawback with this security model is that it doesn&#8217;t provide fine-grained security checks based on a client accessing a specific URL or EJB method&#8211;the server checks the security permissions following each client request for a URL or EJB method, leading to an additional overhead.<\/p>\n<span id=\"DD_Security_Elements\"><h4>DD Security Elements<\/h4><\/span>\n<p>* web.xml<\/p>\n<pre lang=\"xml\">\r\n<security-role>\r\n<security-role-ref>\r\n<security-constraint>\r\n<web-resource-collection>\r\n<user-data-constraint><transport-guarantee>\r\n<\/pre>\n<p>* weblogic.xml<\/p>\n<pre lang=\"xml\">\r\n<externally-defined>\r\n\r\n<weblogic-web-app> \r\n  <security-role-assignment> \r\n    <role-name>PayrollAdmin<\/role-name> \r\n    <principal-name>Nina<\/principal-name> \r\n    <principal-name>Sam<\/principal-name> \r\n    <principal-name>system<\/principal-name> \r\n  <\/security-role-assignment> \r\n\r\n <run-as-role-assignment>\r\n   <role-name>runasrole<\/role-name>\r\n   <run-as-principal-name>sam<\/run-as-principal-name>\r\n <\/run-as-role-assignment>\r\n<\/weblogic-web-app>\r\n\r\n<\/pre>\n<span id=\"Configure_Embedded_LDAP_Server\"><h3>Configure Embedded LDAP Server<\/h3><\/span>\n<p>* Admin server maintains master LDAP server, managed server maintains replicated LDAP server<br \/>\n* Admin console configure link: <em>Domain > Security > Embedded LDAP<\/em><br \/>\n* LDAP directories:<br \/>\nWL_HOME\\domains\\<domain_name>\\ servers\\<server_name>\\data\\ldap<br \/>\n&#8211; backup<br \/>\n&#8211; ldapfiles<br \/>\n&#8211; conf<br \/>\n&#8211; log<br \/>\n&#8211; replicadata<\/p>\n<span id=\"RDBMS_Security_Store\"><h2>RDBMS Security Store<\/h2><\/span>\n<span id=\"References\"><h2>References<\/h2><\/span>\n<p>* Oracle WebLogic Server 11g Administration Handbook By: Sam Alapati<br \/>\n* <a href=\"http:\/\/biemond.blogspot.com\/2009\/09\/sso-with-weblogic-1031-and-saml2.html\">SSO with WebLogic 10.3.1 and SAML2 <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configure Security Providers * Create a new realm named tmprealm Required providers &#8211; Authentication provider, &#8211; Authorization provider, &#8211; Adjudication provider, &#8211; Credential Mapping provider, &#8211; CertPath Builder, &#8211; Role Mapping provider. Optional providers &#8211; Identity Assertion, &#8211; Auditing, &#8211; &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=4154\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[104],"tags":[],"class_list":["post-4154","post","type-post","status-publish","format-standard","hentry","category-weblogic11g"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-150","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/4154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4154"}],"version-history":[{"count":8,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/4154\/revisions"}],"predecessor-version":[{"id":4761,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/4154\/revisions\/4761"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}