예제 #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)
예제 #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}})
예제 #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)
예제 #4
0
파일: api.py 프로젝트: JMassapina/elastatus
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)
예제 #5
0
def sgaudit(account, region):
    c = connect(account, region, 'ec2')
    report, empty_groups = get_reports(c)
    return render_template('sgaudit.html', report=report)
예제 #6
0
def sgaudit(account, region):
    c = connect(account, region, 'ec2')
    report, empty_groups = get_reports(c)
    return render_template('sgaudit.html', report=report)