示例#1
0
#
# Software is free software released under the "Original BSD license"
import sys
try:
  import os
  _runPath = os.path.dirname(os.path.realpath(__file__))
  sys.path.append(os.path.join(_runPath, ".."))
  from passlib.hash import pbkdf2_sha256
  from lib.Config import Configuration as conf
except Exception as e:
  print(e)
  sys.exit("Dependencies missing! First run the install script.")

import traceback

rounds = conf.getUserEncryptionRounds()
saltLength = conf.getUserSaltLength()

try:
  conn=conf.getVMpsqlConnection()
  cur = conn.cursor()

  teams=[ ["Team A",      "TestTeam one"],
          ["Team B",      "TestTeam two"],
          ["engineers",   "",           ] ]
  users=[ ["test",       "firstname", "lastname", "test", [["Team A", "reviewer"   ],["Team B", "reviewer"]                        ]],
          ["teamleader", "John",      "Doe",      "test", [["Team A", "teamleader" ],["Team A", "reviewer"], ["Team B", "reviewer"]]],
          ["engineer",   "Foo",       "Bar",      "test", [["-",       "db-engineer"]                                               ]],
          ["management", "Foo",       "Bar",      "test", [["-",       "management" ]                                               ]]]
  systemgroups=[ ["DNS",    "Team A", "Our DNS Servers", ["cpe:2.3:a:libssh:libssh:2.3",
                                                          "cpe:2.3:a:openssl:openssl:1.0.1e",