Skip to content

Commit

Permalink
update deactivated key
Browse files Browse the repository at this point in the history
  • Loading branch information
wbooth committed Jun 27, 2019
1 parent 51b311b commit 0c9778e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/service/data_svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async def explode_groups(self, criteria=None):

async def explode_agents(self, criteria: object = None) -> object:
agents = await self.dao.get('core_agent', criteria)
sql = 'SELECT g.id, g.name, m.agent_id FROM core_group g JOIN core_group_map m on g.id=m.group_id WHERE g.deactivated is null '
sql = 'SELECT g.id, g.name, m.agent_id FROM core_group g JOIN core_group_map m on g.id=m.group_id WHERE g.deactivated = 0 '
groups = await self.dao.raw_select(sql)
for a in agents:
a['groups'] = [dict(id=g['id'], name=g['name']) for g in groups if g['agent_id'] == a['id']]
Expand Down
2 changes: 1 addition & 1 deletion conf/core.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE if not exists core_result (link_id integer, output text, parsed data);
CREATE TABLE if not exists core_ability (id integer primary key AUTOINCREMENT, ability_id text, technique integer, name text, test text, description text, cleanup text, platform, UNIQUE (ability_id, platform) ON CONFLICT IGNORE);
CREATE TABLE if not exists core_payload (id integer primary key AUTOINCREMENT, ability integer, payload text, UNIQUE (ability, payload) ON CONFLICT IGNORE);
CREATE TABLE if not exists core_group (id integer primary key AUTOINCREMENT, name text, deactivated date, UNIQUE(name));
CREATE TABLE if not exists core_group (id integer primary key AUTOINCREMENT, name text, deactivated date DEFAULT 0, UNIQUE(name, deactivated));
CREATE TABLE if not exists core_group_map (group_id integer, agent_id integer, UNIQUE(group_id, agent_id));
CREATE TABLE if not exists core_adversary (id integer primary key AUTOINCREMENT, name text, description text, UNIQUE (name));
CREATE TABLE if not exists core_adversary_map (phase integer, adversary_id integer, ability_id text, UNIQUE (adversary_id, phase, ability_id));
Expand Down

0 comments on commit 0c9778e

Please sign in to comment.