The Assimilation Project  based on Assimilation version 1.1.6.1462601511
cma.query Namespace Reference

Data Structures

class  AllPythonHostScores
 
class  AllPythonRuleScores
 
class  AllPythonTotalScores
 
class  ClientQuery
 
class  CypherExecutor
 
class  PythonAllPackageQuery
 
class  PythonDroneSubgraphQuery
 
class  PythonExec
 
class  PythonHostSecScores
 
class  PythonPackagePrefixQuery
 
class  PythonPackageQuery
 
class  PythonPackageRegexQuery
 
class  PythonSecRuleScores
 
class  QueryExecutor
 

Functions

def setup_dict3 (d, key1, key2, key3)
 
def setup_dict4 (d, key1, key2, key3, key4)
 
def grab_category_scores
 
def yield_total_scores
 
def yield_drone_scores (categories, drone_totals, dtype_totals)
 
def yield_rule_scores (categories, dtype_totals, rule_totals)
 

Variables

tuple PackageTuple
 
 metadata1 = \
 
tuple q1 = ClientQuery('allqueries', metadata1)
 
 metadata2 = \
 
tuple q2 = ClientQuery('allqueries', metadata2)
 
 metadata3 = \
 
 metadata4 = \
 
tuple q3 = ClientQuery('ipowners', metadata3)
 
tuple q4 = ClientQuery('subgraph', metadata4)
 
tuple neodb = neo4j.Graph()
 
dictionary umap = {'ClientQuery': True}
 
dictionary ckmap = {'ClientQuery': {'index': 'ClientQuery', 'kattr':'queryname', 'value':'None'}}
 
tuple qstore = Store(neodb, uniqueindexmap=umap, classkeymap=ckmap)
 
tuple queries = ClientQuery.load_tree(qstore, "%s/../queries" % (os.path.dirname(sys.argv[0])))
 
list qlist = [q for q in queries]
 
tuple qe2 = qstore.load_or_create(ClientQuery, queryname='list')
 
string testresult = ''
 

Function Documentation

def cma.query.grab_category_scores (   store,
  categories = None,
  domains = None,
  debug = False 
)
Method to create and return some python Dicts with security scores and totals by category
and totals by drone/category
Categories is None, a desired category, or a list of desired categories.
domains is None, a desired domain, or a list of desired domains.

Definition at line 807 of file query.py.

References cma.query.setup_dict3(), and cma.query.setup_dict4().

Referenced by cma.query.AllPythonRuleScores.result_iterator(), cma.query.PythonSecRuleScores.result_iterator(), cma.query.PythonHostSecScores.result_iterator(), cma.query.AllPythonHostScores.result_iterator(), and cma.query.AllPythonTotalScores.result_iterator().

Here is the call graph for this function:

Here is the caller graph for this function:

def cma.query.setup_dict3 (   d,
  key1,
  key2,
  key3 
)

Definition at line 784 of file query.py.

Referenced by cma.query.grab_category_scores().

Here is the caller graph for this function:

def cma.query.setup_dict4 (   d,
  key1,
  key2,
  key3,
  key4 
)

Definition at line 793 of file query.py.

Referenced by cma.query.grab_category_scores().

Here is the caller graph for this function:

def cma.query.yield_drone_scores (   categories,
  drone_totals,
  dtype_totals 
)
Format the drone_totals + dtype_totals as a named tuple
We output the following fields:
    0:  domain
    1:  category name
    2:  discovery-type
    3:  total score for this discovery type _across all drones_
    4:  drone designation (name)
    5:  total score for this drone for this discovery type

Definition at line 872 of file query.py.

Referenced by cma.query.PythonHostSecScores.result_iterator(), and cma.query.AllPythonHostScores.result_iterator().

Here is the caller graph for this function:

def cma.query.yield_rule_scores (   categories,
  dtype_totals,
  rule_totals 
)
Format the rule totals + dtype_totals as a CSV-style output
We output the following fields:
    0:  domain
    1:  category name
    2:  discovery-type
    3:  total score for this discovery type _across all rules
    5:  rule id
    6:  total score for this rule id

Definition at line 895 of file query.py.

Referenced by cma.query.AllPythonRuleScores.result_iterator(), and cma.query.PythonSecRuleScores.result_iterator().

Here is the caller graph for this function:

def cma.query.yield_total_scores (   dtype_totals,
  categories = None 
)
Format the total scores by category as a named tuple.
We output the following fields:
    0:  domain
    1:  category name
    3:  total score for this category

Definition at line 853 of file query.py.

Referenced by cma.query.AllPythonTotalScores.result_iterator().

Here is the caller graph for this function:

Variable Documentation

dictionary cma.query.ckmap = {'ClientQuery': {'index': 'ClientQuery', 'kattr':'queryname', 'value':'None'}}

Definition at line 1198 of file query.py.

cma.query.metadata1 = \

Definition at line 1079 of file query.py.

cma.query.metadata2 = \

Definition at line 1093 of file query.py.

cma.query.metadata3 = \

Definition at line 1117 of file query.py.

cma.query.metadata4 = \

Definition at line 1143 of file query.py.

tuple cma.query.neodb = neo4j.Graph()

Definition at line 1194 of file query.py.

tuple cma.query.PackageTuple
Initial value:
1 = collections.namedtuple('PackageTuple',
2  ['domain', 'drone', 'package', 'version', 'packagetype'])

Definition at line 920 of file query.py.

Referenced by cma.query.PythonPackagePrefixQuery.result_iterator(), cma.query.PythonAllPackageQuery.result_iterator(), cma.query.PythonPackageRegexQuery.result_iterator(), and cma.query.PythonPackageQuery.result_iterator().

tuple cma.query.q1 = ClientQuery('allqueries', metadata1)

Definition at line 1091 of file query.py.

tuple cma.query.q2 = ClientQuery('allqueries', metadata2)

Definition at line 1115 of file query.py.

tuple cma.query.q3 = ClientQuery('ipowners', metadata3)

Definition at line 1188 of file query.py.

tuple cma.query.q4 = ClientQuery('subgraph', metadata4)

Definition at line 1190 of file query.py.

tuple cma.query.qe2 = qstore.load_or_create(ClientQuery, queryname='list')

Definition at line 1210 of file query.py.

list cma.query.qlist = [q for q in queries]

Definition at line 1207 of file query.py.

tuple cma.query.qstore = Store(neodb, uniqueindexmap=umap, classkeymap=ckmap)

Definition at line 1200 of file query.py.

tuple cma.query.queries = ClientQuery.load_tree(qstore, "%s/../queries" % (os.path.dirname(sys.argv[0])))

Definition at line 1206 of file query.py.

string cma.query.testresult = ''

Definition at line 1212 of file query.py.

dictionary cma.query.umap = {'ClientQuery': True}

Definition at line 1197 of file query.py.