/ns2html

Primary LanguageHTMLGNU General Public License v2.0GPL-2.0

##########################################################################
#            NS2HTML - The Netscreen to HTML file converter              #
##########################################################################
# Developed by: Rodrigo Pace de Barros - rodrigo.pace.barros@gmail.com   #
# ============= 2007 - Brazil                                            #
##########################################################################
##########################################################################
#   Copyright (C) by                                                     #
#     - 2007: Rodrigo Pace de Barros <rodrigo.pace.barros@gmail.com>     #
#                                                                        #
#   This program is free software; you can redistribute it and/or modify #
#   it under the terms of the GNU General Public License as published by #
#   the Free Software Foundation; either version 2 of the License, or    #
#   (at your option) any later version.                                  #
#                                                                        #
##########################################################################

INTRODUCTION
============

   These file is intended to help you understand the whole NS2HTML
structure. Its quite simple, but lets talk about the scripts stuffs.

1 - DIRECTORIES
---------------

   After unpacking the NS2HTML .tar.gz file, some directories will be
created under the "ns2html" directory. These directories are the following:

   - bin
   - etc
   - conf
   - html
   - tmp

   Lets describe all of them:

   ns2html-0.4.1/bin: Where all the NS2HTML scripts are found.
   ns2html-0.4.1/conf: Where you will store all your Netscreen's config files.
   ns2html-0.4.1/docs: Where the documentation are located.
   ns2html-0.4.1/etc: Some files used to generate the HTML's are stored there.
   ns2html-0.4.1/html: Where the HTML generated by NS2HTML are stored.
   ns2html-0.4.1/tmp: Where the temporary files are stored. They are used to
                    generate the HTML files with your rulebase.

   On ns2html-0.4.1/html, there is a directory called 'firewalls'. Inside
this directory you will find some other directories. It will be created
when you execute the NS2HTML and these directories will have the same name
as the firewall's hostnames you have downloaded the configs.

2 - SCRIPTS
-----------

   Under the ns2html-0.4.1/bin directory you will found some Perl scripts. These
scripts are the heart of NS2HTML. They are the following:

   ns2html.db.pl: The master script. You will execute it in order to generate
                  the HTML files from your Netscreen's config.
   RuleCreator.pl: This script is responsible for the HTML page that contains
                    the rulebase of the config file processed.
   AddrCreator.pl: This script is responsible for the address table of the
                    firewall's configuration. MIPs are described here too.
                    Group of addresses are included in this HTML.
   SvcCreator.pl: This script is responsible for the services table of the
                   firewall's configuration. Group of services are included in
                   this HTML, as well the default services.

3 - OTHER FILES
---------------

   etc/default_group_services.txt: This file contains the default group services
                                   configured on the firewall.
   etc/default_services.txt: This file contains the default services
                                   configured on the firewall.
   etc/ns2html.cfg: This file contains some variables used in NS2HTML. At this
                    moment, we have only one, but in future there will be a 
                    little more. ;)

RUNNING NS2HTML
===============

   Running NS2HTML is quite simple.

   To run NS2HTML, please go to "ns2html/bin" directory and execute the following
command:

   # perl ns2html.pl -f ../conf/<Netscreen_config_file>

   or

   # perl ns2html.pl -f <PATH_TO_CONF>/<Netscreen_config_file>

   After the execution, go to "ns2html/html/firewalls" and there will be a directory
with the hostname of the firewall that you save the config into the clear text file.
Inside you will find some HTML files and a directory called "images".

   Now, in version 0.4.1, we can say to NS2HTML where to generate the output HTML
files. You can do it on 2 diferent ways:

   1 - Using the '-p' switch:

   # perl ns2html.pl -f ../conf/<Netscreen_config_file> -p <output_dir>

   2 - Changing the PUBLISH variable into the etc/ns2html.cfg file:

   If you do not execute NS2HTML with the '-p' option, the value defined on PUBLISH
variable will be used. The default value is '../html/firewalls'. 

   That's it. You got the HTML rulebase of your clear text file.