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

Data Structures

class  AllPythonHostScores
 
class  AllPythonRuleScores
 
class  AllPythonTotalScores
 
class  ClientQuery
 
class  CypherExecutor
 
class  PythonAllPackageQuery
 
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 = \
 
tuple q3 = ClientQuery('ipowners', metadata3)
 
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 737 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 714 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 723 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 802 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 825 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 783 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 1047 of file query.py.

cma.query.metadata1 = \

Definition at line 976 of file query.py.

cma.query.metadata2 = \

Definition at line 990 of file query.py.

cma.query.metadata3 = \

Definition at line 1014 of file query.py.

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

Definition at line 1043 of file query.py.

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

Definition at line 850 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 988 of file query.py.

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

Definition at line 1012 of file query.py.

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

Definition at line 1040 of file query.py.

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

Definition at line 1059 of file query.py.

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

Definition at line 1056 of file query.py.

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

Definition at line 1049 of file query.py.

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

Definition at line 1055 of file query.py.

string cma.query.testresult = ''

Definition at line 1061 of file query.py.

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

Definition at line 1046 of file query.py.