Tuesday, September 1, 2015

OpenAM Performance ... with APM solution

In all my deployment of OpenAM in Production, I will always tune the JVM as well as OpenAM tunable parameters before I hand-over the SSO infrastructure to customers.


From tuning perspective, I only have 1 product in mind ... i.e. this particular JVM is supposed to run OpenAM optimally. I will not cater for any other component(s) that might be deployed on the same JVM. Honestly, if I am not told beforehand, how do I know what to cater for and which parameters to tune?


These days, APM solutions are picking up. APM vendors preach that their solutions, when deployed on the same JVM where the production codes are running, have little footprint. And thus, it is alright to run APM alongside production codes.




Really? I just had a customer who reported a JVM heap of over 80% 5-6 times per month.

Their systems/middleware team deployed the APM diagnostic tool when the SSO system went LIVE as part of their go-LIVE procedure ... without thinking of any impact/side-effect.

After removing the diagnostic tool, there is no more report of heap size issue for almost a month.

Lesson learnt I hope.

.






Friday, August 21, 2015

Install OpenDJ Directory Server With a Properties File

We were working with some AWS engineers on creating puppet scripts for a Open Identity Stack installation.


OpenDJ installation with a properties file was what we tackled first since it is fairly easy to get OpenDJ up and running, with command line.

There is a section in ForgeRock Documentation that describes how to Install OpenDJ Directory Server With a Properties File.

A sample properties file was given, but it was unclear what is the use of ldifFile?


As I didn't know what was that ldifFile parameter for, I commented it during installation. All went fine and the installation was completed successfully. But ...

When we started to configure OpenAM, we encountered error - "Invalid Suffix".


So I fired up OpenDJ Control Panel to take a look, and I discovered why. 


There was no entry at all. 

Usually when I install OpenDJ via command line, I would be given an option to choose like the following:



And I usually choose Option 1. I needed an equivalent via the Properties File installation method.

The documentation was not clear enough what we should do in such a situation. So I played around with the ldifFile parameter. I should define a base entry in the ldif File. And that will do.

dn: dc=cdemo,dc=sg
dc: cdemo
objectClass: top
objectClass: domain
And that really solved the issue! A check with OpenDJ Control Panel showed everything was in place after the successful configuration of OpenAM.




Nice!

.


Thursday, August 20, 2015

OpenAM 12 Sessions

Peter has a nice blog (Sessions) regarding how sessions work in OpenAM, especially in release 12 onwards.



I was discussing with a customer few days ago regarding how to deploy OpenAM optimally on Amazon Web Services. One topic which we discussed in-depth was how does OpenAM session work and why do OpenAM nodes need to be aware of one another.


ForgeRock documentation has a lot of information regarding how the Core Token Service (CTS) works and how performance is optimised when Reduced Crosstalk is enabled.





However, the documentation did not mention much about any activity besides sessions validation via cross-talk. 

Our discussion that day was : "What is the other usage(s) of crosstalk? Can we remove crosstalk totally as we scale up/down frequently in AWS environment? If not, what happens when an OpenAM node is removed from site? Will crosstalk becomes the performance bottleneck in "non-locatable" OpenAM situation? "



Luckily, as what Peter has mentioned in his blog, Cluster State Service is here to help. 

Monitoring servers
As we already know, under normal circumstances OpenAM uses crosstalk when requests gets misrouted, and this is something that does not change once session failover is enabled. Although the sessions are stored in OpenDJ, OpenAM will remain to send crosstalk requests to the other instances (in essence, this behavior is what the reduced crosstalk mode attempts to change).

In case of session failover it doesn’t really help if AM waits on crosstalk response from a node which may be actually unavailable. In order to prevent this scenario, there is a component that gets automatically enabled once session failover has been enabled: the ClusterStateService (or CSS as I’d like to call it). The ClusterStateService essentially tries to monitor the servers within the current site (and since 12 it also monitors remote site URLs), so that if there is a need to do a crosstalk, OpenAM first checks with ClusterStateService whether the given node is available, before sending any kind of crosstalk request.


Great stuff!


PS: Peter has started using diagrams in his blog! Keep it up! :)

.

Wednesday, August 19, 2015

OpenAM 12 : Changes & Deprecated Functionality

We kick-started an Open Identity Stack (OpenAM, OpenIdM, OpenDJ) project yesterday. * feeling excited *



So for this project, we intend to use OpenAM 12.0.1 - the latest release to 12 series.


In Additional New Features, I saw the following which my customers asked for:

  • Audit Logging to Syslog
  • CORS Support for OpenAM APIs
  • Session Failover Across Sites
  • Whitelist for Custom Login URIs
  • Policy Support for Common HTTP Operations

Personally, since I'm very much into the internal working of OpenAM, my favourite will be:


  • Reduced Cross-Talk



In OpenAM 12, there are quite a number of important changes which we need to be aware of. Read Chapter 3. OpenAM Changes & Deprecated Functionality.

The Policy Evaluation engine has undergone huge changes, so one has to be careful here when performing an upgrade. Luckily this is a green field project!

There is also a lot of fixes - read 4.1. Key Fixes.


.

Thursday, August 13, 2015

Adaptive Risk Authentication

Adaptive Risk Authentication has been built into most SSO products these days. Should I say all? It used to be an add-on module or by-product, which customers have to pay extra. However, these days, we are seeing that this feature is shipped by default.


So, what makes a good authentication of choice? I found this slide from a CA webinar.




.


Wednesday, August 12, 2015

OpenAM 13 : Stateless Sessions

OpenAM 13 is scheduled to be released in Q4 2015, according to OpenAM Roadmap.



One of the new features I am looking forward to is Stateless Sessions for Scale and Elasticity. There is a slide (Customer Scale: Stateless Sessions and Managing High-Volume Digital Services) that can better illustrate this feature.


Basically, what we know of OpenAM now is it can only handle stateful sessions. This means in a highly-available deployment, failover storage (OpenDJ used as CTS) is required. This makes deployment slightly more tricky and at times cumbersome. It is especially true if multiple data centers are involved.



In some deployments where session failover is not required, a stateless session architecture is much preferred. Cleaner and faster. SSO product like CA SiteMinder is stateless by default.



.


Wednesday, August 5, 2015

Tomcat container log file is filling up with messages from OpenAM's OAuth authorization service

I was browsing through OpenAM 12 documentation and came across the Troubleshooting section.


There is this particular FAQ that caught my attention.

Q: My container log file is filling up with messages from OpenAM's OAuth authorization service and OpenID Connect provider. What can I do to prevent all these messages from being logged?

I shall paste the answer shamelessly from the OpenAM documentation.

A:

This behavior is governed by the log settings for RESTlet, which is used by OpenAM for OAuth 2.0 and OpenID Connect 1.0. Use log configuration settings to turn off logging from RESTlet.

For example, if your container is Apache Tomcat, follow these steps.

1. Stop Tomcat.
$ /path/to/tomcat/bin/shutdown.sh
       
2. Edit the Tomcat settings script, catalina.sh or catalina.bat, to use the logging configuration file.
For example, in /path/to/tomcat/bin/catalina.sh, uncomment the following line, and then save your work:

LOGGING_CONFIG= \
  "-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"

3. In $CATALINA_BASE/conf/logging.properties, add the following line, and then save your work:
org.restlet.level=OFF
       
4. Start Tomcat.
$ /path/to/tomcat/bin/startup.sh


I have seen these logs in catalina.out in my customer's Tomcat servers, but did not find the time to find out why they appear there. This solves the mystery. :)

.



Saturday, August 1, 2015

Device Identification to prevent Session Hijacking

This slide was from a webinar from CA I attended. It talked about how to prevent session hijacking by using device identification techniques.



So, besides ensuring the user is coming in from a "trusted" device during initial authentication, each access to a protected application is validated again. 

This can be quite resource intensive, but if an application is sensitive and of highest importance to customers, then it makes sense.

.




Thursday, July 23, 2015

Goggle OAuth2 Authentication Module in OpenAM - Part II

I find the following OAuth 2.0 Playground from Google very useful.


Step 1 exposes all the possible APIs/Scopes that are "query-able". 




Step 2 allows one to exchange authorization tokens with Google.

Steps 3 allows listing possible operations.



Finally, one can send a request to Google OAuth2 Provider.



A response is returned with requested information.



I find this very useful when trying to configure Google OAuth2 authentication module in OpenAM.


Wednesday, July 22, 2015

Goggle OAuth2 Authentication Module in OpenAM

I was configuring OAuth2 Authentication Module in OpenAM and trying to integrate with Google OAuth2 Provider.




I need the user profile and email from Google.  I know this has to be set in the Scope. So, I tried "profile, email".




But I kept getting the following error:


Error: invalid_scope 

Some requested scopes were invalid. {valid=[https://www.googleapis.com/auth/userinfo.email], invalid=[profile,]}




After I removed the comma, it works!



Very strange! I recalled the Scope for Facebook was email, read_stream. The hint is as follows:

The OAuth scope is a comma-separated list of values that define the type of information that can be retrieved from the user profile service. The values will depend on the type of permissions that the user has given to the user profile application in the OAuth 2.0 Provider.

Example: email, read_stream



.

Tuesday, July 21, 2015

ForgeRock Professional Service

These days, when ForgeRock sells subscriptions, it has an option to purchase Professional Service as a bundle. Free or not? I'm not too sure. It's part of price negotiation, I believe. 

The ForgeRock Professional Service can be utilized as follows: 


I think the original intend is to get customers up-to-speed with Open Identity Stack (OIS) deployment. This is especially helpful/applicable to customers who are more technical-savvy and would like to deploy OIS by themselves. High-level Architecture Workshop will be helpful.

Now, what if a SI who is well-trained in OIS is involved?

Customers, being customers, will want to cut cost. Always.

The worst case scenario is for a customer to ask the SI to cut-off a few man-days from implementation cost, since the customer can utilize Product Specialist Field Assistance. Wow! Unbelievable, isn't it? Nay, this should not happen at all and it really doesn't make sense. If customer insists, I think the best way is to walk away.


I think this Professional Service should be best utilized in Production, especially On-Site troubleshooting and Performance Analysis. There will be situations (or there had been?) where a site is badly deployed by a so-so System Integrator (SI) and is now causing production issues. It would be real hard for support engineers to provide remote support. An on-site troubleshooting comes in handy.


.


Wednesday, June 24, 2015

Open Identity Stack - Common Audit Framework

I'm looking forward to the Common Audit Framework in the next release of Open Identity Stack (OpenAM, OpenIDM, OpenDJ and OpenIG). 




At present, each component is logging in its own format and to different targets (e.g. file-system, database, syslog). Thus making debugging across components tedious.

This is definitely a good move!

.

Tuesday, June 23, 2015

ForgeRock OpenIG - API Gateway

API Gateway is getting hot these days. In fact, within a span of 2 months, I have 3 potential customers asking for API Gateway solutions.

There are already a few API Gateway solutions out there in the market - namely CA API Management (aka Layer 7), Oracle API Gateway and Mulesoft API Manager.


Well, ForgeRock is now enhancing OpenIG to be a API Gateway!


* Slide extracted from the recent 2015 Identity Summit in US.

You can view the slides from The Platform Big Picture.


.

Sunday, June 21, 2015

Shared Consent Atrribute Name

This blog was meant to be published last month but I was held up with moving to new office. (Yes, we are now in Fusionopolis Place, situated right next to INSEAD and the MRT/Metro is right below our building.)

Of course, in between, I had a short family vacation in Phuket, Thailand where I ran the 10th Laguna Phuket International Marathon.
 



Back to today's topic ...  Lets's assume a scenario as follows:

  1. OpenAM acts as a OAuth 2.0 Provider
  2. An application is protected with OAuth 2.0 (aka it is OAuth 2.0 Client enabled)

When an user access the application for the 1st time, the OAuth 2.0 client will redirect to the OAuth 2.0 provider. In this example, the OAuth 2.0 provider is OpenAM. Thus the OpenAM Login Page will be displayed.

After successful authentication, OpenAM will present the user with an authorization decision page.




When the checkbox is ticked and Allow button is clicked, the user entry in LDAP will be updated, specifically an attribute that was defined during configuration in OpenAM console "Shared Consent Attribute Name". In this example, the attribute name is defined as oauth2consent.





When the user entry is updated, the aooauth2consent attribute will be populated with the following data format:

 [oauth 2.0 client name] [attribute1] [attribute2] [attribute3] ...







Now, in some scenarios, for example Intranet applications, customers would not like the authorization decision page to be shown. 
How can we workaround this since OpenAM does not have the capability to hide this page at the moment?

The simple solution is to provision directly to the LDAP, specially the oauth2consent attribute with the data format shown above. 




PS: Do remember to add oauth2consent into LDAP User Attributes in Data Store. Otherwise, OpenAM is not able to update the user attribute in the LDAP.







Friday, May 22, 2015

Huge IoT Market

I was watching The Identity of Things & The Smart Cities of Tomorrow Webinar May 2015 (YouTube here).


There was a slide that caught my attention.



Huge numbers! IoT is getting more and more exciting!

And my team was joking that IPv6 has not been adopted widely enough, at least in our region. How are we going to see IoT happening?

.

Wednesday, May 13, 2015

New Sign-In from Chrome on Windows - Adaptive Risk Authentication

I was using a shared laptop just now and tried logging on to Gmail. As soon as I logged in, I received an email from Google warning me of "New Sign-In from Chrome on Windows".



This feature is good especially now that the Internet seems an "unsafe" place to be in. :>

Can the same feature be implemented in OpenAM? I believe it is possible by extending the codes in Adaptive Risk Authentication module.

Shouldn't be too difficult to achieve. Let me find some time. :)

.



Monday, May 11, 2015

Online export of OpenAM Configuration data from OpenDJ

We all know that the OpenAM configuration which we managed via the OpenAM Administration console is stored in either an embedded OpenDJ server (by default) or an external OpenDJ server.




For production systems, it would be recommended to backup the OpenAM configuration data nightly, specifically ou=services,o=[your organization]. 

I'm not too sure about ou=opensso adminusers,o=[your organization], but I'll backup a copy just to play safe.



Operationally, how huge will this OpenAM configuration data be? I can safely say it's very small. Will it have any performance hit on the OpenDJ server? Not likely. If the OpenDJ server is embedded which shares the same JVM as OpenAM, will it affect the functioning of OpenAM server? Not likely.

Anyway, we are talking about backup during off-peak hours, ain't we?

.

Friday, May 8, 2015

Porting embedded OpenDJ in OpenAM to external OpenDJ - Part IV

I blogged a few times on the procedures to port embedded OpenDJ in OpenAM to external OpenDJ. See Part I, Part II and Part III.




So we are happily done with the migration from embedded to external OpenDJ. What's next?

There is a last mile -- clean up!

Remember the old embedded OpenDJ is started whenever OpenAM is started? It stays in the same JVM as OpenAM (you'll get it if you are in the Java world).

So this is to say even if OpenAM is configured to point to external OpenDJ, the old embedded OpenDJ will always be started whenever OpenAM is started. Simple logic.

So, how can we stop the old embedded OpenDJ from starting?

.../[openam-configuration-directory]/opends is where the embedded OpenDJ stays. 

Remove or rename the folder will do the trick. (I usually rename, never remove in case I want to roll back)


Done.

.



Thursday, May 7, 2015

Data Store, LDAP User Attributes and Subjects

In my previous blog Global Session vs User Session, I mentioned how to go about configuring Session settings on a per-user basis. 

First, go to the Subjects tab and search for the User.



Then, we set a different Session setting for the user. In this example, we change the Maximum Idle Time for this user from the default 30 minutes to 60 minutes.



Fairly simple from UI perspective, but what really happens behind the scene?


There is a need to map Maximum Idle Time from the UI to an attribute in the user's LDAP entry. In this case, OpenAM makes use of an attribute iplanet-am-session-max-idle-time.



So that means OpenAM needs to be able to edit the user's LDAP entry. (see the other blog of mine) More importantly, the backend Data Stores (e.g. LDAP) must have the necessary attributes defined in the schema. (e.g. iplanet-am-session-max-caching-time, iplanet-am-session-max-idle-time, iplanet-am-session-max-session-time, iplanet-am-session-quota-limit)


In Data Stores, click on the appropriate backend. 



Scroll to the section LDAP User Attributes. Ensure that the necessary attributes are defined. 



Embedded OpenDJ
If the backend is an embedded OpenDJ that is installed together with OpenAM, then we are fairly sure the OpenDJ schema is populated with the required session attributes. The schema is defined in ...//opends/config/schema/99-user.ldif .

External OpenDJ
If the backend is an external OpenDJ, we need to ensure the external OpenDJ is chosen during OpenAM installation. The installation will ensure the appropriate attributes are created in 99-user.ldif.

If the external OpenDJ is configured post OpenAM installation, then we need to ensure 99-user.ldif from the embedded OpenDJ is copied to the the external OpenDJ. One can choose to load the schema manually with pre-defined ldif files in ...//ldif/opendj/.



The above 2 scenarios are quite straight-forward. What if the backend is Microsoft Active Directory or any of the supported user data stores?



Remember we said earlier that we need to load the necessary attributes into the OpenDJ schema? The same has to be done on any other User Data Stores. 

Well, this becomes tricky. 

Will the AD administrator allow non-AD related attributes to be created on the AD? Likely not. This is not a technical issue, but an operational one.


.