Friday August 01, 2008 Students part of GFGC community program
GlassFish security references (part1)
Configure Solaris Trusted Extensions and run GlassFish Application Server
(From Jagadesh Babu Munta and Shaline Gowda)
Trusted Extensions software package is a layered product on top of the Solaris operating system.
Trusted Extensions provides special security features that enable an organization to define and implement a security policy on a Solaris system. A security policy is the set of rules and practices that help protect information and other resources, such as computer hardware, at your site. Typically, security rules handle such issues as who has access to which information or who is allowed to write data to removable media. Security practices are recommended procedures for performing tasks[1]. See the answers to the common questions on Trusted Extensions can be found at [2]. Currently the product is being evaluated for CCC [3].
GlassFish is a
free, open source, production quality, enterprise application server
which implements the newest features in the Java EE platform. It is
the reference implementation fro the JavaEE standard from Sun [8].
The simplest way of getting TX is to install Solaris 10 U5 (Solaris 10 11/06) [5]. No need to install any additional TX related packages. TX packages are already installed when you install S10 U5.
However, one has to start up “labeld” process so it can be a TX system.
Run the command:
|
svcadm
enable -s labeld
|
and must reboot. Note that at this time, you can only access the system through console (until remote access is enabled).
For all other OS cases, refer the document [6].
The next preparation step is to create zfs pool for zones. Creating zones using zfs cloning is the quickest method to create zones, but you may need to do extra steps to make sure the zones are stable.
Follow the steps:
Login as root user to global zone.
Comment out the /zone entry in /etc/vfstab file added by editing the jumpstart profile . Note the partition name for /zone, for example /dev/dsk/c1t0d0s0
Unmount /zones #umount /zone
Create zone pool
|
zpool
create -f
zone /dev/dsk/c1t0d0s0
|
Check the spool status, use the following commands:
|
zpool status -x zone zpool list |
The following 3 steps are good enough to enable the remote access [6].
Comment out CONSOLE from /etc/default/login file. Below is the snapshot from a TX system.
|
# If CONSOLE is set, root can only login on that device. #
Comment this
line out to allow remote login by root. |
Add the DNS name servers in /etc/resolv.conf file. Below is the snapshot from a TX system.
|
#
cat
/etc/resolv.conf # |
Edit /etc/pam.conf to allow remote user and from the non TX systems. Below is the snapshot from a TX system. Basically change the following line to have allow_remote and allow_unlabeled at the end.
|
#
cat
/etc/pam.conf | egrep allow |
On Solaris 10 U5, open the netservices because by default disabled due to Secure By Default (SBD) feature. Run the following command to disable SBD:
|
netservices open |
Trusted Extensions uses solaris containers or zones for labeling. The global zone is an administrative zone, and is not available to users. Non-global zones are called labeled zones. Labeled zones are used by users. The global zone shares some system files with users. When these files are visible in a labeled zone, the label of these files is ADMIN_LOW. Network communication is restricted by label. By default, zones cannot communicate with each other because their labels are different. Therefore, one zone cannot write into another zone [1].
The simplest way to create and manage the labeled zones is to use “txzonemgr”, an easy to use GUI tool.
A typical states of a labled zone is as follows [7]:
Undefined --> Configured --> Installed --> Ready -->Running
Before start creating the labeld zones, check if the network interfaces shared by all zones are not. You can do this by doing “ifconfig -a” and look for “all-zones”.
If not, use txzonemgr to create the network interface for the non global zones. Run the tool, /usr/sbin/txzonemgr that creates networks interface and zones . Select Manage Networks Interface, then select the physical interface and share it.
In the labeled zones creation process, the first step is to create a labeled zone and configure it. Later create a snapshot and clone it for other labeled zones.
Follow the below steps from the /usr/sbin/txzonemgr GUI interface:-
Create first new labeled zone (say public) --> Select -->Install --> Zone console --> Boot --> Configure NFS and domain --> Running (public)
Running labeled zone (public) -->Halt --> Create snapshot
Create other new labeled zone (internal) --> Select -->Clone -->select the snapshot (public) --> Zone console --> Boot -->Running (internal)
Repeat above steps for all other labels such as needtoknow, restricted etc.
Some of the screen shots from txzonemgr are listed here for your checks.
Fig-1. List of all labeled zones from labled zone manager (txzonemgr)

Fig-2. Installed public zone (txzonemgr). Ready to Boot or Create Snapshot.

Fig-3. Installing a labled zone from a configured one. Clone from existing snapshot (txzonemgr)

Fig-4. List of options from an installed (public) zone (txzonemgr)

Fig-5. Available ZFS zone snapshot created from public zone (txzonemgr)

Fig-6. List of options available on a running labeled zone (txzonemgr)

Fig-7. List of network interfaces (txzonemgr)

To check the created zones, use the following command.
|
# zoneadm list -cv ID NAME STATUS PATH BRAND IP
0 global running / native shared ... |
To check the labels on the files, run the following commands:
|
#
getlabel / |
To login to a public zone from global zone, use the following command.
|
# |
To login to a labeled zone, do the following alternatives.
|
#rlogin -l root <tx-system> #zonelogin
public Select the zone (public/internal), select OK and then select "Zone Console". Login using the root id and password. From there you can operate on that console. |
Download and Install GlassFish [8]. Get the latest GF FCS version and is GFv2 UR2 from [10]. The installation instructions can be found at [10]. You could download on a different machine and copy to the required labeled zone.
There are sanity tests for GF called Quick Look (QL) tests and can be checked out the GF workspace. See the steps at [9].
Run QL tests on the following 3 cases.
“public” zone only (run only public and halt internal zone)
“internal” zone only
simultaneously on both “public” and “internal” while both are running.
If you don't want to use maven, then do the following after setting the environment.
“ant all-pe”
Edit <as-install>/config/asadminenv.conf and change to “cluster” from “developer” profile.
“ant only-ee”
No issues found. All the sanity/QL tests passed.
[1] Trusted Extensions User Guide - http://docs.sun.com/app/docs/doc/819-7313
[2] Solaris Trusted Extensions FAQ http://www.sun.com/bigadmin/sundocs/articles/txfaq.jsp
[3] Solaris Common Criteria Certification - http://www.sun.com/software/security/securitycert/#in-eval
[4] Trusted Extensions Developer Guide - http://docs.sun.com/app/docs/doc/819-7312
[5] Solaris Trusted Extensions Collection - http://docs.sun.com/app/docs/coll/175.12
[6] Trusted Extensions Installation and Configuration - http://docs.sun.com/app/docs/doc/819-7314
[7] Solaris Zones http://www.softpanorama.org/Solaris/Virtualization/zones.shtml
[8] GlassFish http://glassfish.dev.java.net
[9] GlassFish QL instructions - https://glassfish.dev.java.net/public/GuidelinesandConventions.html#Quicklook_Tests
[10] GFv2 UR2 download - https://glassfish.dev.java.net/downloads/v2ur2-b04.html
We
would like to thank the following people are who provided guidance and
information on TX and greatly helped in setting up the TX setup during
this exercise with timely manner.
Satya
Dodda
Lokanath Das
Parameswaran
Namboodiri
Authentication for SIPServlet resources in SailFin Application Server
| <jdbc-resource
enabled="true" jndi-name="jdbc/digestauth"
object-type="user" pool-name="DerbyPool"/> |
|
<auth-realm
classname="com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm" name="Your_Realm_Name"> <property name="user-name-column" value="userid"/> <property name="password-column" value="password"/> <property name="group-name-column" value="groupid"/> <property name="jaas-context" value="jdbcDigestRealm"/> <property name="datasource-jndi" value="jdbc/digestauth"/> <property name="group-table" value="grouptable"/> <property name="user-table" value="usertable"/> </auth-realm> |
![]() |
| jdbcDigestRealm
{ com.sun.enterprise.security.auth.login.JDBCDigestLoginModule required; }; |
| <login-config> <auth-method>DIGEST</auth-method> <realm-name>Your_Realm_Name</realm-name> </login-config> |
|
<security-constraint> <display-name>RegistrarConstraint1</display-name> <resource-collection> <resource-name>RegistrarServlet</resource-name> <description>SIP Servlet resource protection</description> <servlet-name>RegistrarServlet</servlet-name> <sip-method>REGISTER</sip-method> </resource-collection> <auth-constraint> <description>User can Access the files</description> <role-name>User</role-name> </auth-constraint> </security-constraint> <login-config> <auth-method>DIGEST</auth-method> <realm-name>Your_Realm_Name</realm-name> </login-config> <security-role> <description>User Role</description> <role-name>User</role-name> </security-role> <security-role> <description>Admin Role </description> <role-name>Admin</role-name> </security-role> |
| ./bin/asadmin
start-database ./bin/asadmin stop-database |
JavaOne 2008 experience (more with GlassFish)
As a regular JavaOne attendee, this year 2008 also I was at JavaOne. It is a world's largest Java developers conference organized by Sun and happens every year at Moscone Center, San Francisco.
I feel the crowd is more than last year! Seen many students and stalls in the pavillion.
Here are few highlights!
Perspective on open source product testing I thought of having some key ideas on open source product testing.
In my view the following goals
and strategies in the open source products testing can
help in improving the quality and maintaining the testing pace.
1. Set reasonable Quality
(see the decided quality metrics) and excellent user-experience: This
is important as most of the open source projects to come up early in
the users hand ahead rather than waiting for long product release time.
Also these products need to focus on good user experience so that users
can quickly adopt to the product.
Think about stack rather than a piece of the product.
2. Evangelize the product
(more adoption): Try to envangelize the product as much
as possible with various methods - well working samples, clear use case
related examples (these are keys) in addition to blogs, feeds,
webcasts, free tutorials, participating in universities etc.
Again getting more user base is the key. Increase the testers and
initial learners.
3. Full OpenSource
(tools) and contribute the world: Try to use well known
open source tools so that many users known of them and also easy to
participate and contribute in the testing effort.
4. Re-use the
testers/tests/infrastructure: Re-use save time and
energy. So don't need to start from scratch unless there is no solution
out-there. Improve on the existing test base and simplify.
5. Pro-active approach
rather than re-active: It is important to keep in deal
with the criticism and comments where everyone would like show their
own way and known products. So be patient and response pro-actively
rather than re-acting.
6. Automate tests in
maximum: This is important to save lot of time to deal
with changes happening with the product stack in the open source.
7. Measure the quality -
define quality metrics : Unless we measure what
we are doing, we can't really know where we are. In this angle, it is
better to decide some level of metrics such as code coverage, bugs list
etc.
8. Provide feedback
as frequently as possible (say weekly or even daily) on the product
quality to the community. This way people see the dynamism or vibration
in the product community.
Do you have some more key or simple things to do? Please
share.
Sharing is good for everyone!
Posted by Jagadesh Babu Munta
( May 29 2007, 12:52:59 PM PDT )
Permalink
Code quality and coverage
Here are the some of the interesting articles about code quality and code coverage analysis and relation to product quality.
Understand the quality...division of people into 2 groups - " 1. People who know why every good software company ships products with known bugs. 2. People who don't. "
"Code coverage analysis is the process of:
* Finding areas of a program not exercised by a set of test cases,
* Creating additional test cases to increase coverage, and
* Determining a quantitative measure of code coverage, which is an indirect measure of quality. ".
Posted by Jagadesh Babu Munta
( May 24 2007, 06:57:27 PM PDT )
Permalink
How to make money with open source? Today during my browsing for some strategies around open source, I come across the following interesting article, which talks about making money with open source. I know many of friends and collegues were asking similar questions that were address here. So thought of adding here. See article -
How to make money from Open source By Con Zymaris .
Two interesting points -
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
My Experience with AJAX Overall my experience showed AJAX is cool but need more effort than without. Hope more GUI based development and debugging tools available soon. [Read More] Posted by Jagadesh Babu Munta ( Nov 03 2006, 05:23:42 PM PST ) Permalink
How is iMac and Windows on iMac - (Apple + Intel) After playing with Apple's new iMac, my observation is that the desktop is cool and fast compared to Apple's PowerMac. The GlassFish/Sun Java System Application Server worked great without any problems!
iMac need more time for reliability?
During my usage, I found some glitches with the OS/applications i) While rebooting, OS gone infinite loop with "Process Table Full" message on the console. I had to do the hard stop (power off) ii) In another instance, Mail application is not able to close normally. These issues, I never observed with PowerMac.
Windows installation on iMac?
There are some restrictions on windows OS with bootcamp installation on iMac, which allows to install Windows-XP with SP2 from single disc.
See the detailed instructions at bootcamp . Download the guide and things just worked fine except the following one odd thing!
Initially struggled with a volume licensed win-xp CD, which has 3 sub versions, like professional, home edition, tablet PC edition. The CD recognition is ok and displayed A. B. C. and asked to select one of the operating systems. But keyboard and mouse are not recognized!
Finally, used a single CD with single windows-xp SP2 software, then everything went fine as it is loading the minimum drivers automatically and stops at partitioning of the disks.
Enjoy!
Posted by Jagadesh Babu Munta
( Apr 19 2006, 05:24:20 PM PDT )
Permalink
Comments [1]
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 ====