import os
import sys

sys.path.append(os.path.dirname(os.path.realpath(__file__))+'/../..')

from malware_data_science.db import DB, AttackTactic

db = DB()
attack_tactics = [
  'Initial Access',
  'Execution',
  'Persistence',
  'Privilege Escalation',
  'Defense Evasion',
  'Credential Access',
  'Discovery',
  'Lateral Movement',
  'Collection',
  'Command and Control',
  'Exfiltration',
  'Impact'
]

for name in attack_tactics:
  if AttackTactic.one_by_name(name):
    continue
  attack_tactic = AttackTactic()
  attack_tactic.name = name
  db.session.add(attack_tactic)
db.session.commit()
