Esempio n. 1
0
def sgaudit(account, region):
    try:
        c = connect(account, region, 'ec2')
        report, empty_groups = get_reports(c)
        return render_template('sgaudit.html', report=report)
    except Exception, e:
        return render_template('unauthorized.html', account=account)
Esempio n. 2
0
def sgaudit_account_monitor(account=None, region=None):
    if account == None or region == None:
        return jsonify(error='account and region required')
    monitor = dict()
    c = connect(account, region, 'ec2')
    report, empty_groups = get_reports(c)
    security_alert = False
    if report:
        security_alert = report
    return jsonify(audit={account: {region: security_alert}})
Esempio n. 3
0
def sgaudit_monitor():
    monitor = dict()
    for account in current_app.config['CONFIG']['accounts']:
        monitor[account] = dict()
        for region in current_app.config['CONFIG']['regions']:
            c = connect(account, region, 'ec2')
            report, empty_groups = get_reports(c)
            if report:
                monitor[account][region] = True
            else:
                monitor[account][region] = False
    return jsonify(sgaudit=monitor)
Esempio n. 4
0
def sgaudit_monitor():
    monitor = dict()
    for account in current_app.config['CONFIG']['accounts']:
        monitor[account] = dict()
        for region in current_app.config['CONFIG']['regions']:
            c = connect(account, region, 'ec2')
            report, empty_groups = get_reports(c)
            if report:
                monitor[account][region] = True
            else:
                monitor[account][region] = False
    return jsonify(sgaudit=monitor)
Esempio n. 5
0
def sgaudit(account, region):
    c = connect(account, region, 'ec2')
    report, empty_groups = get_reports(c)
    return render_template('sgaudit.html', report=report)
Esempio n. 6
0
def sgaudit(account, region):
    c = connect(account, region, 'ec2')
    report, empty_groups = get_reports(c)
    return render_template('sgaudit.html', report=report)