def audit_sns(accounts, send_report):
    """ Runs auditors/sns """
    accounts = __prep_accounts__(accounts)
    au = SNSAuditor(accounts=accounts, debug=True)
    au.audit_all_objects()

    if send_report.lower() == 'true' or send_report == True:
        report = au.create_report()
        au.email_report(report)

    au.save_issues()
    db.session.close()
Exemple #2
0
def audit_sns(accounts, send_report):
    """ Runs auditors/sns """
    accounts = __prep_accounts__(accounts)
    au = SNSAuditor(accounts=accounts, debug=True)
    au.audit_all_objects()

    if send_report:
        report = au.create_report()
        au.email_report(report)

    au.save_issues()
    db.session.close()
def find_sns_changes(accounts):
    """ Runs watchers/sns """
    accounts = __prep_accounts__(accounts)
    cw = SNS(accounts=accounts, debug=True)
    (items, exception_map) = cw.slurp()
    cw.find_changes(current=items, exception_map=exception_map)

    # Audit these changed items
    items_to_audit = []
    for item in cw.created_items + cw.changed_items:
        snsitem = SNSItem(region=item.region, account=item.account, name=item.name, config=item.new_config)
        items_to_audit.append(snsitem)

    au = SNSAuditor(debug=True)
    au.audit_these_objects(items_to_audit)
    au.save_issues()

    cw.save()
    db.session.close()
Exemple #4
0
def find_sns_changes(accounts):
    """ Runs watchers/sns """
    accounts = __prep_accounts__(accounts)
    cw = SNS(accounts=accounts, debug=True)
    (items, exception_map) = cw.slurp()
    cw.find_changes(current=items, exception_map=exception_map)

    # Audit these changed items
    items_to_audit = []
    for item in cw.created_items + cw.changed_items:
        snsitem = SNSItem(region=item.region, account=item.account, name=item.name, config=item.new_config)
        items_to_audit.append(snsitem)

    au = SNSAuditor(accounts=accounts, debug=True)
    au.audit_these_objects(items_to_audit)
    au.save_issues()

    cw.save()
    db.session.close()