Novalys Visual Guard - Secure Your Application Part 1

Securing Your Application With Visual Guard – Part 1

On 4 June, 2013 01:00:52, in Reviewed, by Dirk Strauss

Visual Guard Features
Installation
Start Visual Guard WinConsole and create a Repository
Integrate Visual Guard Runtime with your Application
Connecting to your Repository / Set up your Application
Creating a User
Edit Password Policy

I think any developer will agree with me that adding security features to an application can be an absolute pain. This is especially true if you don’t have a set template or module that you can slot into your application.

Novalys Visual Guard

Well with Novalys Visual Guard, the integration of security features is no longer a slog. Visual Guard makes this process very easy to do indeed. In this post we will look at using Visual Guard with a plain simple Windows Forms Application, but Visual Guard can be integrated with .NET 2.0 and above, C#, vb.net, asp.net, Winforms, WCF, WPF, Silverlight, MVC3, MVC4, Windows Azure, PowerBuilder 8 and above, Microsoft Sharepoint and any technologies Supporting HTTP Requests (Java, C++…).

I have to admit that while much of the integration processes should be quite straight forward for most developers, the extensive help files and Developer’s Guide do warrant a read though in order to grasp some of the more advanced features of Visual Guard.

Novalys Visual Guard Features

The product comes in two flavours namely Professional and Enterprise and the features of both are very impressive indeed. Here follows a short list of those features:

  • User Management – Creation and management of username/passwords and User groups. You can also use Windows accounts to identify users.
  • User Authentication – Including form-based, Single Sign on, Mixed Mode, Web Single Sign On, Remote Windows Authentication, Off-line Mode and Identity Federation. You can also set a password policy.
  • Permission and Roles – Application Level Permissions, Support for Static and Dynamic Permissions, Hide/Display controls on the UI or filter data based on permissions, Application and Shared Roles. You can also grant Roles to User Accounts or Groups.
  • Reporting and Auditing – Generate access control reports, Logging and Auditing End-user/Administrator operations.
  • Visual Guard Applications – Windows and Web Administration Console, Visual Guard Server, VG Federation Client as well as a deployment utility for security data.
  • Development Technologies Supported - .NET 2.0 and above, C#, vb.net, asp.net, Winforms, WCF, WPF, Silverlight, MVC3, MVC4, Windows Azure, PowerBuilder 8 and above, Microsoft Sharepoint and Any technologies Supporting HTTP Requests (Java, C++…).
  • Architecture supported - 2 tiers (Front-end + Database), n-tiers (Front-end + webservices + database), Multiple sites with distinct networks, SaaS applications.
  • DBMS hosting the VG Repository - Oracle, SQL Server, Proprietary File System.
  • Identity Stores – Active Directory.
  • Product Customization – Custom Identity Module (Support of identities & users accounts) and Customization of the VG WebConsole (VG WebConsole Module).

Obviously not all of these features are available for the Professional Edition. Visit the Visual Guard site for a full comparison between Professional and Enterprise.

Installation

Installing Visual Guard is quite straightforward and takes no time at all.

Install Screen

Installing Visual Guard

Start Visual Guard WinConsole and create a Repository

After the installation completes, search for Visual Guard WinConsole from the Windows 8 Search Charm. For easy access, I pinned the app to my taskbar.

Start visual guard WinConsole

Clicking on the icon will launch the Visual Guard WinConsole.

Visual Guard Console

This is where you will create a new repository and manage all your secured features of your application. To add a new repository, select the ‘Add repository’ menu item from the Action menu.

Visual Guard Add Repository

This will start the Repository Creation Wizard.

Repository Creation Wizard

Select Next and choose the option to create a new empty repository.

Repository Creation Wizard Create new empty repository

The wizard allows you to choose 3 repository types. For the purposes of this post, we will create a File repository but you can choose to create a SQL Server or an Oracle based repository.

Repository Creation Wizard Select Repository Type

The next step is to choose a location for the File Repository.

Repository Creation Wizard Repository Location

Visual Guard now allows you to select the Authentication Mode which can be a mix of Windows or Visual Guard authentication.

Repository Creation Wizard Authentication Mode

The next step allows you to name your repository and also to specify a username and password for the Visual Guard authentication mode.

Repository Creation Wizard Repository Name

That is all that is needed to create a new repository. Clicking ‘Finish’ will take you back to the main WinConsole screen.

Visual Guard Repository Created

Integrate Visual Guard Runtime with your Application

In order to continue, you now need to Integrate the Visual Guard Runtime into your application. In the solution explorer in Visual Studio (I am using Visual Studio 2012 Ultimate), select to add a reference to your application.

Visual Studio Add Reference

If the required Novalys DLL’s aren’t available in the Add References dialog, browse for them in the Bin folder of the Novalys installation directory. For the WinForms application you need to add the following three DLL’s:

  • Novalys.VisualGuard.Security
  • Novalys.VisualGuard.Security.File
  • Novalys.VisualGuard.Security.WinForm

For other platforms, review the support documentation for the required DLL’s to include.

Browse for DLL's

After you have added the references, select each reference and change the Copy Local property to True. This will ensure that the DLL’s are copied to the Bin folder. When you reference the exe in the repository later on,it will require these DLL’s to be present.

Change Refereced DLL's to Copy Local

The next step you need to perform is to add the required code to the Main section of your application. Before any other code is run, you need to run the Novalys code. In C#, have a look in the Program.cs file and add the following using statements:

  • using Novalys.VisualGuard.Security
  • using Novalys.VisualGuard.Security.WinForm

Visual Studio Add Using Statements to Main

Change the static void Main of your application as follows: (Please note that you can specify the Login Text  and even which username should be defaulted in the login screen)

Visual Studio Add Login Form Code

Connecting to your Repository / Set up your Application

At this point, you have integrated enough in code in order to connect to the repository you created and configure it correctly. So the next step is to open up the WinConsole again and connect to your newly created repository using the username and password you created previously. To do this, right click on the repository and select ‘Connect’ from the context menu.

Connect to Repository

Enter the username and password in the Login form.

Enter Username and Password

The next screen allows you to set up your application. Select the application type which in our case would be a WinForm application.

Application Creation Wizard Select Application Type

Visual Guard now asks you if you have integrated the runtime with your application. If you select the second option, the Application Creation Wizard will display a warning message and give you the option to review the help documentation. Because we have already integrated the runtime in the application, select the first option and click next.

Visual Guard Integration Runtime Integrated

The next step is to select the main assembly of your application. It is here that the referenced DLL’s need to be output to the Bin folder.

Visual Guard Select Main Assembly

Visual Guard Select Main Assembly Selected

The next screen allows you to configure some advanced options. Select the option to Generate the Visual Guard configuration files and click Finish.

Visual Guard Advanced Options

Visual Guard now reminds you to deploy the configuration files that were modified with your application.

Visual Guard Config Files Modified

Creating a User

The next step you need to do is create a user in the WinConsole. To do this, right click on Users and select ‘New Visual Guard User’ from the context menu.

Add New Visual Guard User

The ‘Create New User’ form is displayed. Here you can create a user with a default password and require the user to change his or her password at the next logon.

Create New User

If you head on over to Visual Studio and debug your application, you will now be presented with a Login form.

Visual Studio Debug Login

After logging in, the user will be prompted to change the default password.

Change Password

Password Changed

After the password has been changed, the user will be logged in to the application. This shows you how easy it was to add a login form to your application. With minimal code we can add a layer of security to our application and modify that easily via the WinConsole.

Edit Password Policy

Let us say that we want to implement a more stringent password policy. This is easily done by clicking on the SalesOrderInterface repository and selecting ‘Edit Password Policy’ from the context menu.

Edit Password Policy

The Edit password policy screen now displays and allows you to modify various settings such as the minimum password length and the number of special characters required in each password.

Edit Password Policy

The next step to take is to modify the user and require that the user must change their password at the next Logon. This kind of granularity in the security settings makes Visual Guard a really easy and secure way to add security features to your application.

Ask User to Change Password

In my next post, I will look at more advanced features of securing your application with Visual Guard. My overall experience thus far with Visual Guard has been a very positive one. In a matter of minutes I was able to secure my application with a Login form and have a level of control over the users of my application that normally would take some coding to include, if done as part of the normal development process.

Disclosure of Material Connection: I received one or more of the products or services mentioned above for free in the hope that I would mention it on my blog. Regardless, I only recommend products or services I use personally and believe my readers will enjoy. I am disclosing this in accordance with the Federal Trade Commission’s 16 CFR, Part 255: “Guides Concerning the Use of Endorsements and Testimonials in Advertising.”

The following two tabs change content below.

Dirk Strauss

Software Developer
Dirk is a Software Developer from South Africa. He loves all things Technology and is slightly addicted to Twitter and Jimi Hendrix. Apart from writing code, he also enjoys writing human readable articles. "I love sharing knowledge and connecting with people from around the world. It's the diversity that makes life so beautiful." Dirk feels very strongly that pizza is simply not complete without Tabasco, that you can never have too much garlic, and that cooking the perfect steak is an art he has yet to master.

Latest posts by Dirk Strauss (see all)

Tagged with: