Esempio n. 1
0
# TODO: move a lot of this to VPCconfig, and use some sort of filter to only list SGs in EC2 classic

from opinel.utils.aws import get_name
from opinel.utils.console import printException, printInfo
from opinel.utils.fs import load_data
from opinel.utils.globals import manage_dictionary

from AWSScout2.configs.regions import RegionalServiceConfig, RegionConfig
from AWSScout2.utils import get_keys, ec2_classic

########################################
# Globals
########################################

icmp_message_types_dict = load_data('icmp_message_types.json',
                                    'icmp_message_types')
protocols_dict = load_data('protocols.json', 'protocols')

########################################
# EC2RegionConfig
########################################


class EC2RegionConfig(RegionConfig):
    """
    EC2 configuration for a single AWS region

    :ivar vpcs:                         Dictionary of VPCs [id]
    :ivar instances_count:              Number of instances in the region
    :ivar parameter_groups:             Dictionary of parameter groups [id]
    :ivar parameter_groups_count:       Number of parameter groups in the region
Esempio n. 2
0
import netaddr

from opinel.utils.aws import get_name
from opinel.utils.globals import manage_dictionary
from opinel.utils.fs import load_data, read_ip_ranges

from AWSScout2.utils import ec2_classic, get_keys
from AWSScout2.configs.regions import RegionalServiceConfig, RegionConfig
from AWSScout2.configs.vpc import VPCConfig as SingleVPCConfig

########################################
# Globals
########################################

protocols_dict = load_data('protocols.json', 'protocols')

########################################
# VPCRegionConfig
########################################


class VPCRegionConfig(RegionConfig):
    """
    VPC configuration for a single AWS region
    """

    def parse_customer_gateway(self, global_params, region, cgw):
        cgw['id'] = cgw.pop('CustomerGatewayId')
        self.customer_gateways[cgw['id']] = cgw
Esempio n. 3
0
# -*- coding: utf-8 -*-

import netaddr

from opinel.utils.aws import get_name
from opinel.utils.globals import manage_dictionary
from opinel.utils.fs import load_data, read_ip_ranges

from AWSScout2.utils import ec2_classic, get_keys
from AWSScout2.configs.regions import RegionalServiceConfig, RegionConfig

########################################
# Globals
########################################

protocols_dict = load_data('protocols.json', 'protocols')

########################################
# VPCRegionConfig
########################################


class VPCRegionConfig(RegionConfig):
    """
    VPC configuration for a single AWS region

    :ivar subnets:                       Dictionary of subnets [name]
    :ivar subnets_count:                 Number of subnets in the region
    """
    def __init__(self):
        self.flow_logs = {}
Esempio n. 4
0
from opinel.utils.aws import get_name
from opinel.utils.console import printException, printInfo
from opinel.utils.fs import load_data
from opinel.utils.globals import manage_dictionary

from AWSScout2.configs.regions import RegionalServiceConfig, RegionConfig, api_clients
from AWSScout2.configs.vpc import VPCConfig
from AWSScout2.utils import get_keys, ec2_classic


########################################
# Globals
########################################

icmp_message_types_dict = load_data('icmp_message_types.json', 'icmp_message_types')
protocols_dict = load_data('protocols.json', 'protocols')



########################################
# EC2RegionConfig
########################################

class EC2RegionConfig(RegionConfig):
    """
    EC2 configuration for a single AWS region
    """

    def parse_elastic_ip(self, global_params, region, eip):
        """