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

Data Structures

class  AllPythonHostScores
 
class  AllPythonRuleScores
 
class  AllPythonTotalScores
 
class  ClientQuery
 
class  CypherExecutor
 
class  PythonAllDronesSubgraphQuery
 
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 (store, categories=None, domains=None, debug=False)
 
def yield_total_scores (dtype_totals, categories=None)
 
def yield_drone_scores (categories, drone_totals, dtype_totals)
 
def yield_rule_scores (categories, dtype_totals, rule_totals)
 
def reltype_expr (reltypes)
 

Variables

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

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 808 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.reltype_expr (   reltypes)

Definition at line 1038 of file query.py.

Referenced by cma.query.PythonDroneSubgraphQuery.result_iterator(), and cma.query.PythonAllDronesSubgraphQuery.result_iterator().

Here is the caller graph for this function:

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

Definition at line 785 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 794 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 873 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 896 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 854 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 1243 of file query.py.

string cma.query.dirname = os.path.dirname(sys.argv[0])

Definition at line 1251 of file query.py.

Referenced by _cryptcurve25519_save_a_key(), and curve25519_key_id_to_filename().

cma.query.expandJSON

Definition at line 1260 of file query.py.

cma.query.False

Definition at line 1260 of file query.py.

Referenced by _configcontext_JSON_GScanner_new().

cma.query.idsonly

Definition at line 1260 of file query.py.

cma.query.metadata1 = \

Definition at line 1124 of file query.py.

cma.query.metadata2 = \

Definition at line 1138 of file query.py.

cma.query.metadata3 = \

Definition at line 1162 of file query.py.

cma.query.metadata4 = \

Definition at line 1188 of file query.py.

cma.query.neodb = neo4j.Graph()

Definition at line 1239 of file query.py.

cma.query.None

Definition at line 1260 of file query.py.

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

Definition at line 921 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().

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

Definition at line 1136 of file query.py.

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

Definition at line 1160 of file query.py.

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

Definition at line 1233 of file query.py.

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

Definition at line 1235 of file query.py.

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

Definition at line 1257 of file query.py.

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

Definition at line 1254 of file query.py.

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

Definition at line 1245 of file query.py.

cma.query.queries = ClientQuery.load_tree(qstore, "%s/../queries" % dirname)

Definition at line 1253 of file query.py.

string cma.query.testresult = ''

Definition at line 1259 of file query.py.

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

Definition at line 1242 of file query.py.