Friday June 13, 2008 GlassFish security references (part1)
JAXWS/SSL - How to secure a WS endpoint at transport level (https)
In order to secure webservice endpoints developed using JavaEE components (Servlets/EJB) at transport level (https), there is a easy and simple declarative way in GlassFish application server. The following information helps in understanding and trying out a sample called SSL-JAXWS application in JavaEESDK samples.
You can get the samples bundle from Java EE SDK downloads page.
Steps:
->Java EE Downloads page
->Goto "Download the Components Independently"
->Goto "Java EE 5 Samples Download" and click on download.
Unzip the saved file and browse the samples index page and go to JavaEE5 samples @
.../java_ee_sdk-5_01-samples/javaee5/index.html .
The JAXWS/SSL sample is "webservices/ssl-jaxws-ear" and can be found @
.../javaee5/webservices/ssl-jaxws-ear/docs/index.html
Posted by Jagadesh Babu Munta
( Mar 05 2007, 06:44:43 PM PST )
Permalink
GlassFishV2: How to see WSS SOAP messages
How to configure Security Manager ON/OFF? By default, the security manager is off on GlassFish, Sun Java System application server. One can enable the security manager by setting the following jvm option in the server configuration and restart the server.
-Djava.security.manager
If the development of the applications happend without security manager and later enabled in the production, there is a possibility that the application need more permissions. These permissions can be set in the domain's server.policy .
How to add JVM option?
Admin console --> http://localhost:4848/
goto ApplicationServer-> JVM Settings -> JVM Options -> Add JVM Option
It is better to test the applications with security manager to get the production ready applications.
Posted by Jagadesh Babu Munta
( Apr 17 2006, 05:01:24 PM PDT )
Permalink
Comments [1]
WSS security - new XWS providers
These new providers are named as XWS_ServerProvider and XWS_ClientProvider, mainly added the following new features to the earlier providers. 1. By default username token is encrypted. 2. Dynamically determine the encryption key from the request at the server.
At application level, one can use the above providers or configure at server level by default using admin console or CLI.Applying security to webservice message layer on glassfish
Feb 3, 2006 7:26:11 PM com.sun.xml.wss.impl.filter.DumpFilter process
INFO: ==== Sending Message Start ====
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://tax.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" env:mustUnderstand="1">
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="XWSSGID-11390235703121194903842">MIIClDCCAf0CBEPkDe4wDQYJKoZIhvcNAQEEBQAwgZAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpD
.......
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
.......
</wsse:Security>
</env:Header>
<env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1139023571163-313201494">
.......
</env:Body>
</env:Envelope>
==== Sending Message End ====
Feb 3, 2006 7:26:12 PM com.sun.xml.wss.impl.filter.DumpFilter process
INFO: ==== Received Message Start ====
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://tax.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" env:mustUnderstand="1">
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="XWSSGID-1139023367140-550544941">MIIClDCCAf0CBEPkDe4wDQYJKoZIhvcNAQEEBQAwgZAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpD
.......
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
.......
</wsse:Security>
</env:Header>
<env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1139023571907-1675963724">
.......
</env:Body>
</env:Envelope>
==== Received Message End ====
How is SSL in Glassfish
The SSL (Secure Socket Layer) or TLS (Transport Layer Security) configuration is so simple and is readily available on Glassfish appserver.The latest version is TLS1.0 or SSL3.0.
The default server certificate installed and configured when the appserver is installed and domain is created. The default SSL port is 8181 unless changed during the installation. Once the installation is done, https://localhost:8181/ should work.
The SSL implementation in glassfish is JSSE (Java Secure Socket Extension) and certificate database is the java standard JKS format. The server certificate is a self signed RSA algorithm without any extensions. It is very usual that one generate a certificate request and get signed with a well known CA (Certificate Authority) certificate and import back into the certificate store (say keystore).
There is a simple page on commands and ant based targets for listing , generating, importing and exporting of certificates with keytool is available at
handling certs.
...more to come... have a nice weekend!
Posted by Jagadesh Babu Munta
( Jan 21 2006, 12:55:13 AM PST )
Permalink
Comments [5]