Intellicus Enterprise Reporting and Business Insights 18.1

Security

0 views August 26, 2019 0

Audit Log
Get Audit Detail

This Java API is used to get the Audit detail information from the Intellicus Repository.

Refer to <Intellicus_Install_Path>/SampleCodes/Java APIs/Audit Log/GetAuditDetail.java for sample code of this use case.

Steps:

  1. Initialize Report Client.
  2. Initialize Requestor UserInfo.
  3. Create an Audit Manager controller class object for audit management related operations.

    AuditManager am= new AuditManager();

  1. Set the filter for values fields.

    // prepare parameters for filtering

    Date fromDate = new Date(2006-1900 ,2-1,01);

    Date toDate = new Date(2006-1900,3-1,9);

    String reportName              = “Product”;

    String username = “Admin”;

    String reportId = “91FEE269-3AEE-C23D-6F04-7A9979BEBE09”;

    String categoryId = “Test”;

    Filter filter=new Filter();

    filter.setFilterField(“REPORTNAME”,reportName);

    filter.setFilterField(“CATEGORYID”,categoryId);

    filter.setFilterField(“FROMDATE”,fromDate);

    filter.setFilterField(“TODATE”,toDate);

    filter.setFilterField(“REPORTID”,reportId );

    filter.setFilterField(“USERID”,userName);

  1. Get the Audit Log details based on filter applied.
     
    Method : getAuditLogList

    public java.util.ArrayList getAuditLogList

    (java.lang.String fromDate,

    java.lang.String toDate,

    java.lang.String reportName,

    java.lang.String userName,

    java.lang.String reportId,

    java.lang.String categoryId,

    UserInfo userInfo)

    throws AuditManagerException

    This method will provide the list containing audit log information.

    Parameters :

    • Filter: Filter which can take request filters from Enums.Filters.AuditLog

    i.e.

    Enums.Filters.AuditLog.REPORTNAME

    Enums.Filters.AuditLog.CATEGORYID

    Enums.Filters.AuditLog.FROMDATE

    Enums.Filters.AuditLog.TODATE

    Enums.Filters.AuditLog.REPORTID

    Enums.Filters.AuditLog.USERID

    • userInfo: The User Information Object

    Returns:

    ArrayList of Audit Log information of various reports.Each element of list is object of class AuditLogData.

    ArrayList arrayList=am.getAuditLogList(filter,requestorUserInfo);

Delete Audit Detail

This Java API is used to delete Audit Log information.

Refer to <Intellicus_Install_Path>/SampleCodes/Java APIs/Audit Log/DeleteAuditLog.java for sample code of this use case.

Steps:

  1. Initialize Report Client.
  2. Initialize Requestor UserInfo.
  3. Create a Audit Manager controller class object for audit management related operations.

    AuditManager am= new AuditManager();

  1. Set the filter for values fields that are to be deleted in Audit Details.

    Date fromDate = new Date(2006-1900 ,2-1,01);

    Date toDate          = new Date(2006-1900,3-1,9

    String reportName              = “Product”;

    String username = “Admin”;

    String categoryId = “Test”;

    String reportId      = “91FEE269-3AEE-C23D-6F04-7A9979BEBE09”;

     

    Filter filter=new Filter();

    filter.setFilterField(“REPORTNAME”,reportName);

    filter.setFilterField(“CATEGORYID”,categoryId);

    filter.setFilterField(“FROMDATE”,fromDate);

    filter.setFilterField(“TODATE”,toDate);

    filter.setFilterField(“REPORTID”,reportId );

    filter.setFilterField(“USERID”,userName);

  1. Delete the Audit Log List as per filter
     
    Method : deleteAuditLogList

    public void deleteAuditLogList(Filter filter, UserInfo userInfo)

    throws AuditManagerException

    This method will delete audit log information from the Report Engine.

    Parameters:

    • Filter: Filter which can take request filters from Filters.AuditLog

    i.e.

    Enums.Filters.AuditLog.REPORTNAME

    Enums.Filters.AuditLog.CATEGORYID

    Enums.Filters.AuditLog.FROMDATE

    Enums.Filters.AuditLog.TODATE

    Enums.Filters.AuditLog.REPORTID

    Enums.Filters.AuditLog.USERID

    • UserInfo: The User Information Object

     am.deleteAuditLogList(filter,requestorUserInfo);

Data Masking
Save Data Masking

This Java API is used to save the data masking details.

Refer to <Intellicus_Install_Path>/SampleCodes/Java APIs/Data Masking/SaveData Masking.java for sample code of this use case.

Steps:

  1. Initialize Report Client.
  2. Initialize Requestor UserInfo.
  3. Create an instance of SecurityManager.

    SecurityManager sMgr = SecurityManager.getInstance();

  1. Set the various required details, like Connection name, table name, column name, masking character etc.

    MaskedData maskedData = new MaskedData();

    ArrayList<ConnMaskedDetails> connList = new ArrayList<ConnMaskedDetails>();

    ConnMaskedDetails connMaskedDetailsObj = new ConnMaskedDetails();

    connMaskedDetailsObj.setConnectionName(“DemoReportDB”); //Connection Name

    ArrayList<DBSchema> dbSchemaList = new ArrayList<DBSchema>();

    DBSchema dbSchemaObj = new DBSchema();

    DBMaskedEntities dbMaskedEntitiesObj = new DBMaskedEntities();

    DBMaskedEntity dbMaskedEntityObj = new DBMaskedEntity();

    dbMaskedEntityObj.setDBEntityName(“BRANCH”); //Table name

    dbMaskedEntityObj.setDBEntityType(“0”);

     

    Column columnObj = new Column();

    columnObj.setColumnId(“365372309”); //Some GUID for setting Column Id

    columnObj.setColumnName(“BRANCH_ID”); //column Name

    columnObj.setColumnMaskChar(“#”); //Mask character

    columnObj.setMaskLevel(“1”); //For Masking only on provided connection, 0 for Mask for All Connections

    columnObj.setMaskType(0); //for masking completely set o, and for masking partially set 1

    columnObj.setColumnOpcode(“ADD”);//ADD for adding data masking on a column, UPDATE for updating data masking on already masked column

     

    ArrayList<ColGrant> colGrantList = new ArrayList<ColGrant>();

    ColGrant colGrantObj = new ColGrant();

    colGrantObj.setOrgId(“HostOrg”); //Organization for exceptional users and roles

    colGrantObj.addRoleId(“Admin”);     //Role

    colGrantObj.addUserId(“John”);       //User

    colGrantObj.addUserId(“Mary”);       //User

    colGrantList.add(colGrantObj);

    columnObj.setColGrantList(colGrantList);

     

    dbMaskedEntityObj.addColumn(columnObj);

    dbMaskedEntitiesObj.addMaskedEntity(dbMaskedEntityObj);

    dbSchemaObj.setDbMaskedEntities(dbMaskedEntitiesObj);

    dbSchemaList.add(dbSchemaObj);

     

    connMaskedDetailsObj.setDbSchemaList(dbSchemaList);

    connList.add(connMaskedDetailsObj);

    maskedData.setConnList(connList);

  1. Save the data masking details.
     
    Method : saveColsSecurityInfo

    public void saveColsSecurityInfo(String strCLRSaveList, UserInfo userInfo)

    throws ISecurityException

    Parameters :

    • maskedData : Object of {@link com.intellica.client.security.MaskedData} with all the column masking* details filled.
    • userInfo: userInfo object keeping the detail about the current user
Get Masked Columns

This Java API is used to get the Masked columns details for specified connection

Refer to <Intellicus_Install_Path>/SampleCodes/Java APIs/Audit Log/GetMaskedColumns.java for sample code of this use case.

Steps:

  1. Initialize Report Client.
  2. Initialize Requestor UserInfo.
  3. Create an instance of SecurityManager.

    SecurityManager sMgr = SecurityManager.getInstance();

  1. Get the masking details.
     
    Method: getColsSecurityInfo

    Returns the security information of all columns as ArrayList of ColSecurityInfo class.

    public MaskedData getColsSecurityInfo(Filter filter, UserInfo userInfo)

    throws ISecurityException

    Parameters :

    • filter : Filter object to get the masked details of given filter creteria only.

    Possible values of filter are {@link com.intellica.client.common.Enums.Filters.ColumnMaskDetails}.

    • userInfo: userInfo object keeping the detail about the current user
  1. Below is the code snippet for iterating through the masked column list-

    MaskedData maskedData = sMgr.getColsSecurityInfo(filter, requestorUserInfo);
    ArrayList connList = maskedData.getConnList();
    //Iterating over the connections to get masked columns for that connection
    for(int i=0;i<connList.size();i++){
    	ConnMaskedDetails connMaskedDetailObj = (ConnMaskedDetails)connList.get(i);
    	ArrayList dbSchemaList = connMaskedDetailObj.getDbSchemaList();
    	for(int j=0;j<dbSchemaList.size();j++){
    		DBSchema dbSchemaObj = (DBSchema)dbSchemaList.get(j);
    		DBMaskedEntities dbMaskedEntitiesObj = dbSchemaObj.getDbMaskedEntities();
    		ArrayList dbMaskedEntityList = dbMaskedEntitiesObj.getMaskedEntityList();
    		for(int k=0;k<dbMaskedEntityList.size();k++){
    			DBMaskedEntity dbMaskedEntityObj = (DBMaskedEntity)dbMaskedEntityList.get(k);
    			System.out.println("Table Name = "+dbMaskedEntityObj.getDBEntityName());	//Table name
    			System.out.println("----------------------------");
    			ArrayList columnList = dbMaskedEntityObj.getColumnList();
    			//Iterating over the masked column list
    			for(int l=0;l<dbMaskedEntityObj.getColumnListSize();l++){
    				Column colObj = (Column)dbMaskedEntityObj.getColumn(l);
    				System.out.println("Column Name = "+colObj.getColumnName()+", MaskType = "+colObj.getMaskType()+", MaskLevel = "+colObj.getMaskLevel()+", MaskChar = "+colObj.getColumnMaskChar());
    			}
    	System.out.println("=======================================");
    		}
    	}
    }
    

 

Report Server Property
GetReportEnginePortAndIP

This Java API is used to get Report Engine’s IP Address and Port number of the Report Engine.

Refer to <Intellicus_Install_Path>/SampleCodes/Java APIs/ ReportServerProperty/ GetReportEnginePortAndIP.java for sample code of this use case.

Steps:

  1. Initialize Report Client.
  2. Initialize Requestor UserInfo.
  3. Create a Layout Manager class object for report layout management related operations

    LayoutManager lm = new LayoutManager();

  1. Get the IP of Report Engine.
     
    Method : getReportEngineIP

    public java.lang.String getReportEngineIP()

    Get report Engine IP, sets through any of the constructor or if not then returns the default value from ConfigManager class.

    Returns:

    String: Report Engine IP

    // method used to get the IP Address of Report Engine

    // Returns ReportEngine IP as a String value.

    String reportEngineIP=lm.getReportEngineIP();

  1. Get the port of Report Engine.
     
    Method  : getReportEnginePort

    public int getReportEnginePort()

    Get report Engine Port, sets through any of the constructor or if not then returns the default value from ConfigManager class.

    Returns:

    String : report Engine Port

                  // method used to get the Port of Report Engine

    // Returns report Engine Port as Integer value

    int reportEnginePort=lm.getReportEnginePort();

GetReportServerProperty

This Java API is used to get SMTP Server Values of the Report Engine.

Refer to <Intellicus_Install_Path>/SampleCodes/Java APIs/ ReportServerProperty/GetReportServerProperty.java for sample code of this use case.

Steps:

  1. Initialize Report Client.
  2. Initialize Requestor UserInfo.
  3. Create a SecurityManager class object for getting the controller information for all Administration related operations

SecurityManager sMgr=SecurityManager.getInstance();

  1. Get the Property values of Report Server.
     
    Method : getReportServerPropValue

    public java.lang.String getReportServerPropValue

    (java.util.ArrayList reportServerPropList,

    java.lang.String key,UserInfo userInfo)

    throws ClientException

    This method gets the value of Report Server Property from the Report Server for given value of key

    Parameters:

    • UserInfo: The UserInfo
    • ReportServerPropList: ArrayList of all Report Server Properties
    • key: Name of property whose value is required

    Returns:

    String representing required property value.  If no property is identified with given key then this Method returns null.

    Part of Sample Code implementing “getReportServerPropValue” :

    //This returns arraylist of values of Report Server properties

    ArrayList arrList    = sMgr.getReportServerPropDetails(requestorUserInfo);

  1. Get all the property values of Report Server.

    //Set the key for the server property.This key is the name of the property as specified in the ReportEngine.properties     at < Intellicus_Install_path >\ReportEngine\Config folder

    String key="SMTP_SERVER";//Value of Report Server property       
    String value=sMgr.getReportServerPropValue(arrList ,key, requestorUserInfo); 
    System.out.println ("SMTP_SERVER Value : "+value); 
    key="LISTENER_PORT";
    value=sMgr.getReportServerPropValue(arrList ,key, 								requestorUserInfo);
    System.out.println (" LISTENER_PORT Value : "+value);
    key="DATABASE_CONNECTION_TIMEOUT";
    value=sMgr.getReportServerPropValue(arrList ,key, 									requestorUserInfo);
    System.out.println ("DATABASE_CONNECTION_TIMEOUT Value : 		"+value);
     	 			  
    key="SECURITY_FEATURES";
    value=sMgr.getReportServerPropValue(arrList ,key, 									requestorUserInfo);
    System.out.println ("SECURITY_FEATURES Value : "+value);
     	  		
    key ="AUDIT_LOG";
    value=sMgr.getReportServerPropValue(arrList ,key, 										requestorUserInfo);
    System.out.println ("AUDIT_LOG Value : "+value);
     		
    key = "QUEUE_SIZE";
    value=sMgr.getReportServerPropValue(arrList ,key, 										requestorUserInfo);
    System.out.println ("QUEUE_SIZE Value : "+value);
      		
    key = "REMOTE_SESSION_TIMEOUT";
    value=sMgr.getReportServerPropValue(arrList ,key, 									requestorUserInfo);
    System.out.println ("REMOTE_SESSION_TIMEOUT Value : "+value);
    
    key = "RTF_FIELD_CONTROL_MAP";
    value=sMgr.getReportServerPropValue(arrList ,key, 										requestorUserInfo);
    System.out.println ("RTF_FIELD_CONTROL_MAP Value : "+value);
    
    key = "DATA_SOURCE_FETCH_SIZE";
    value=sMgr.getReportServerPropValue(arrList ,key, 							requestorUserInfo);
    System.out.println ("DATA_SOURCE_FETCH_SIZE Value : "+value);
    
    key = "AUDITLOG_PURGE_TIME";
    value=sMgr.getReportServerPropValue(arrList ,key, 										requestorUserInfo);
    System.out.println ("AUDITLOG_PURGE_TIME Value : "+value);
    
    key = "CACHE_PURGE_TIME";
    value=sMgr.getReportServerPropValue(arrList ,key, 									requestorUserInfo);
    System.out.println ("CACHE_PURGE_TIME Value : "+value);
    
    key = "AUTHORIZATION_CACHE_TIMEOUT";
    value=sMgr.getReportServerPropValue(arrList ,key, 									requestorUserInfo);
    System.out.println("AUTHORIZATION_CACHE_TIMEOUT Value : 											"+value);
    key = "SCHD_JOB_DISPATCH_QUEUE_SIZE";
    value=sMgr.getReportServerPropValue(arrList ,key, 										requestorUserInfo);
    System.out.println("SCHD_JOB_DISPATCH_QUEUE_SIZE Value : 									"+value);
    

 

SetReportServerProperty

This Java API is used to set the SMTP Server Values of Report Engine.

Refer to <Intellicus_Install_Path>/SampleCodes/Java APIs/ ReportServerProperty/ SetReportServerProperty.java for sample code of this use case.

Steps:

  1. Initialize Report Client.
  2. Initialize Requestor UserInfo.
  3. Create a SecurityManager class object for getting the controller information for all Administration related operations

    SecurityManager sMgr=SecurityManager.getInstance();

  1. Set the Property values of Report Server by putting them in a Hashmap.

    HashMap ServerPropHMap= new HashMap();
    			  
      String key="SMTP_SERVER";
      String value="192.168.100.20";
      ServerPropHMap.put(key,value);
                  
      key="DATABASE_CONNECTION_TIMEOUT";
      value="800";
      ServerPropHMap.put(key,value);
    			  
      key="SECURITY_FEATURES";
      value="enabled";
      ServerPropHMap.put(key,value);
    			  
    	key="QUEUE_SIZE";
    	value="900";
    	ServerPropHMap.put(key,value);
    
    	key="LOG";
    	value="../logs";
    	ServerPropHMap.put(key,value);
    
    	key="PAGE_CHUNKSIZE";
    	value="10";
    	ServerPropHMap.put(key,value);
    
    	key="LOG_LEVEL";
    	value="INFO";
    	ServerPropHMap.put(key,value);
    
      key="USER_THREADS";
      value="5";
      ServerPropHMap.put(key,value);
    
      key="REPOSITORY_CACHE_TIMEOUT";
      value="15";
      ServerPropHMap.put(key,value);
    
      key="EXIT_ON_ERROR";
      value="disable";
      ServerPropHMap.put(key,value);
    

 

  1. Save these property values set in last step for Report Server
     
    Method : saveReportServerProperties

    public java.lang.String saveReportServerProperties
          (java.util.HashMap reportServerPropMap,
           UserInfo userInfo)
    throws ISecurityException
    

     
    This method saves the modified server properties and returns the status sent by the Report Server.

    Parameters:

    • ReportServerPropMap: HashMap which keeps the property name as key and its its concerning value as the value.
    • UserInfo: The UserInfo object.

    Returns:

    • String: Having the status return by the Report Engine after modifying the property file.

    Part of Sample Code implementing “setReportServerPropValue” :

    sMgr.saveReportServerProperties(ServerPropHMap, requestorUserInfo);

Report Server Connectivity
TestServerConnectivity

This Java API is used to check whether the Report Server is running on the specified IP and Port or not.

Refer to Intellicus_Install_Path>/SampleCodes/Java APIs/TestServerConnectivity/ TestServerConnectivity.java for sample code of this use case.

Steps:

  1. Initialize Report Client.
  2. Create a Security controller class object using its factory for user management related operations

    SecurityManager sMgr=SecurityManager.getInstance();

  1. Get the Security Mode of Report Engine.
     
    Method : getSecurityMode

    public boolean getSecurityMode()

    throws ISecurityException

    This method returns the security mode read from the report engine.

    Returns:

    If the security mode is on on the report engine, it returns true.  In other cases, it returns false.

    boolean securityMode        = false;

    //If it gives Exception, then failed to connect Report Server

    securityMode=sMgr.getSecurityMode();