org.owasp.orizon
Class Session

java.lang.Object
  extended by org.owasp.orizon.O
      extended by org.owasp.orizon.Session

public class Session
extends O

This class models a code review session. Users ask for a code review specifying if it must be performed over a single source file, some files or a full directory. An Orizon session will containing all information about input files to be analyzed by Orizon. The Session object is also responsible about managing report Folder object. A Folder is a container of Report object, and can be used to have a complete source code assessment report generation. With the Mirage engine, it is now its task to open the web application, reading the files and create SessionInfos. It will be also forbid to scan a single source file. Before version 1.1, it was Session to manage SessionInfo(s) values trying to figure it out which kind of input is issued. Starting by version 1.1, Mirage will open the web application directory, scanning for sources and creating SessionInfos... So Skyline will ask Mirage to open the input files and Mirage will feed Session object. So, this is the workflow:

Since:
0.99
Author:
thesp0nge
See Also:
Folder

Field Summary
 
Fields inherited from class org.owasp.orizon.O
base64, hasName, initialized, line_start, line_stop, log, reduced, what
 
Constructor Summary
Session(java.util.HashMap<java.lang.String,java.lang.String> p)
          Create a new Session.
 
Method Summary
 boolean crawl()
          Crawl a web application for dangerous keyword.
 java.lang.String generateReport(Formatter f)
           
 int getFilesInSession()
           
 int getIssues()
           
 Mirage getMirageEngine()
           
 java.lang.String getProperty(java.lang.String key)
           
 Folder getRawScanResults()
           
 boolean init()
          This method is called by Skyline during startup.
 boolean isActive()
           
 boolean isModelComplete()
           
 boolean isModeled()
           
 boolean isOpened()
           
 boolean list()
           
 boolean model()
           
 boolean open()
          Open a web application.
 boolean readXmlNode(org.w3c.dom.Node n)
          As far from version 0.62 all items must be responsible for XML Node reading routine.
 boolean search(java.lang.String qString)
           
 void setOutputChannel(java.io.PrintWriter out)
           
 void setReader(ConsoleReader reader)
           
 void setUI(CommonUI ui)
           
 java.lang.String stats()
           
 
Methods inherited from class org.owasp.orizon.O
clone, getStartLine, getStopLine, isCompatible, isInitialized, setStartLine, setStopLine, trackThis
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session(java.util.HashMap<java.lang.String,java.lang.String> p)
Create a new Session.

Method Detail

setUI

public void setUI(CommonUI ui)

setOutputChannel

public void setOutputChannel(java.io.PrintWriter out)

open

public boolean open()
Open a web application. This method will create the Mirage object for this web application.

Returns:
true if the application can be modeled or false otherwise.

stats

public java.lang.String stats()

model

public boolean model()

crawl

public boolean crawl()
Crawl a web application for dangerous keyword. When users ask Orizon to do a source code crawl, this method will be called. This service is "source oriented" so the crawler engine will be into the SessionInfo classes and this method will act as proxy.

Returns:
true if a potentially dangerous call has been found, or false otherwise.

getIssues

public int getIssues()

init

public boolean init()
This method is called by Skyline during startup. Before version 1.1 this method will be responsible about opening the application and gathering info. Starting by now, it is one of the Mirage goals. So this init() method must contain only session object initialization.

Returns:
true if Session can be initialized, or false otherwise.

generateReport

public java.lang.String generateReport(Formatter f)

getProperty

public java.lang.String getProperty(java.lang.String key)

isActive

public boolean isActive()

getFilesInSession

public int getFilesInSession()

readXmlNode

public boolean readXmlNode(org.w3c.dom.Node n)
Description copied from class: O
As far from version 0.62 all items must be responsible for XML Node reading routine. Source class must be able to instantiate an object passing XML Node as parameter and having that code read

Specified by:
readXmlNode in class O
Parameters:
n - the node being read
Returns:
true if xml node is well formed and correctly read, or false otherwise.

isOpened

public boolean isOpened()

isModeled

public boolean isModeled()

isModelComplete

public boolean isModelComplete()

getRawScanResults

public Folder getRawScanResults()

list

public boolean list()

search

public boolean search(java.lang.String qString)

setReader

public void setReader(ConsoleReader reader)

getMirageEngine

public Mirage getMirageEngine()