예제 #1
0
    def post_process_table(self, field_options):
        fields_add_device_selection(self,
                                    keyword='netprofiler_device',
                                    label='NetProfiler',
                                    module='netprofiler',
                                    enabled=True)
        fields_add_time_selection(self, show_end=True, show_duration=False)

        func = Function(netprofiler_live_templates, self.options)

        TableField.create('template_id',
                          label='Template',
                          obj=self,
                          field_cls=IDChoiceField,
                          parent_keywords=['netprofiler_device'],
                          dynamic=True,
                          pre_process_func=func)

        self.add_column('template_id',
                        'Template ID',
                        datatype='string',
                        iskey=True)
        self.add_column('widget_id',
                        'Widget ID',
                        datatype='integer',
                        iskey=True)
        self.add_column('title', 'Title', datatype='string')
        self.add_column('widget_type', 'Type', datatype='string')
        self.add_column('visualization', 'Visualization', datatype='string')
        self.add_column('datasource', 'Data Source', datatype='string')
    def post_process_table(self, field_options):
        resolution = field_options['resolution']
        if resolution != 'auto':
            if isinstance(resolution, int):
                res = resolution
            else:
                res = int(timedelta_total_seconds(parse_timedelta(resolution)))
            resolution = Report.RESOLUTION_MAP[res]
            field_options['resolution'] = resolution

        fields_add_device_selection(self, keyword='netprofiler_device',
                                    label='NetProfiler', module='netprofiler',
                                    enabled=True)

        duration = field_options['duration']
        if isinstance(duration, int):
            duration = "%d min" % duration

        fields_add_time_selection(self,
                                  initial_duration=duration,
                                  durations=field_options['durations'])

        fields_add_resolution(self,
                              initial=field_options['resolution'],
                              resolutions=field_options['resolutions'],
                              special_values=['auto'])
        self.fields_add_filterexpr()
예제 #3
0
    def post_process_table(self, field_options):
        resolution = field_options['resolution']
        if resolution != 'auto':
            if isinstance(resolution, int):
                res = resolution
            else:
                res = int(timedelta_total_seconds(parse_timedelta(resolution)))
            resolution = Report.RESOLUTION_MAP[res]
            field_options['resolution'] = resolution

        fields_add_device_selection(self, keyword='netprofiler_device',
                                    label='NetProfiler', module='netprofiler',
                                    enabled=True)

        duration = field_options['duration']
        if isinstance(duration, int):
            duration = "%d min" % duration

        fields_add_time_selection(self,
                                  initial_duration=duration,
                                  durations=field_options['durations'])

        fields_add_resolution(self,
                              initial=field_options['resolution'],
                              resolutions=field_options['resolutions'],
                              special_values=['auto'])
        self.fields_add_filterexpr()
예제 #4
0
 def post_process_table(self, field_options):
     self.criteria_handle_func = Function(criteria_handle)
     self.save()
     fields_add_device_selection(self,
                                 keyword='netprofiler_device',
                                 label='NetProfiler',
                                 module='netprofiler',
                                 enabled=True)
    def post_process_table(self, field_options):
        fields_add_device_selection(self, keyword='netprofiler_device',
                                    label='NetProfiler', module='netprofiler',
                                    enabled=True)

        duration = field_options['duration']

        fields_add_time_selection(self,
                                  initial_duration=duration,
                                  durations=field_options['durations'])
예제 #6
0
    def post_process_table(self, field_options):
        fields_add_device_selection(self, keyword='netprofiler_device',
                                    label='NetProfiler', module='netprofiler',
                                    enabled=True)

        duration = field_options['duration']

        fields_add_time_selection(self,
                                  initial_duration=duration,
                                  durations=field_options['durations'])
예제 #7
0
    def post_process_table(self, field_options):
        duration = field_options['duration']
        if isinstance(duration, int):
            duration = "{}m".format(duration)

        fields_add_device_selection(self,
                                    keyword='netshark_device',
                                    label='NetShark',
                                    module='netshark',
                                    enabled=True)

        func = Function(netshark_msa_file_choices, self.options)
        TableField.create(
            keyword='netshark_source_name',
            label='Source',
            obj=self,
            field_cls=IDChoiceField,
            field_kwargs={'widget_attrs': {
                'class': 'form-control'
            }},
            parent_keywords=['netshark_device'],
            dynamic=True,
            pre_process_func=func)

        fields_add_time_selection(self,
                                  initial_duration=duration,
                                  durations=field_options['durations'])
        fields_add_resolution(self,
                              initial=field_options['resolution'],
                              resolutions=field_options['resolutions'])

        if self.options.include_filter:
            fields_add_filterexpr(self)

        if self.options.include_bpf_filter:
            fields_add_bpf_filterexpr(self)

        if self.options.show_entire_msa:
            TableField.create(keyword='entire_msa',
                              obj=self,
                              field_cls=forms.BooleanField,
                              label='Entire MSA (ignore start/end times)',
                              initial=True,
                              required=False)
예제 #8
0
    def post_process_table(self, field_options):
        duration = field_options['duration']
        if isinstance(duration, int):
            duration = "%dm" % duration

        fields_add_device_selection(self,
                                    keyword='netshark_device',
                                    label='NetShark',
                                    module='netshark',
                                    enabled=True)

        func = Function(netshark_source_name_choices, self.options)
        TableField.create(
            keyword='netshark_source_name',
            label='Source',
            obj=self,
            field_cls=IDChoiceField,
            field_kwargs={'widget_attrs': {
                'class': 'form-control'
            }},
            parent_keywords=['netshark_device'],
            dynamic=True,
            pre_process_func=func)

        if self.options.include_persistent:
            TableField.create(keyword='netshark_persistent',
                              label='Persistent View',
                              obj=self,
                              field_cls=forms.BooleanField,
                              initial=False)

        fields_add_time_selection(self,
                                  initial_duration=duration,
                                  durations=field_options['durations'])
        fields_add_resolution(self,
                              initial=field_options['resolution'],
                              resolutions=field_options['resolutions'])

        if self.options.include_filter:
            fields_add_filterexpr(self)

        if self.options.include_bpf_filter:
            fields_add_bpf_filterexpr(self)
예제 #9
0
 def post_process_table(self, field_options):
     fields_add_device_selection(self, keyword='netshark_device',
                                 label='NetShark', module='netshark',
                                 enabled=True)
     fields_add_time_selection(self, show_start=True,
                               initial_start_time='now-1m',
                               show_end=True,
                               show_duration=False)
     fields_add_resolution(self,
                           initial=field_options['resolution'],
                           resolutions=field_options['resolutions'])
     func = Function(netshark_source_name_choices, self.options)
     TableField.create(keyword='netshark_source_name', label='Source',
                       obj=self,
                       field_cls=forms.ChoiceField,
                       parent_keywords=['netshark_device'],
                       dynamic=True,
                       pre_process_func=func)
     fields_add_filterexpr(obj=self)
     self.add_column('filename', datatype='string')
예제 #10
0
    def post_process_table(self, field_options):
        duration = field_options['duration']
        if isinstance(duration, int):
            duration = "{}m".format(duration)

        fields_add_device_selection(self, keyword='netshark_device',
                                    label='NetShark', module='netshark',
                                    enabled=True)

        func = Function(netshark_msa_file_choices,
                        self.options)
        TableField.create(keyword='netshark_source_name', label='Source',
                          obj=self,
                          field_cls=IDChoiceField,
                          field_kwargs={
                              'widget_attrs': {'class': 'form-control'}
                          },
                          parent_keywords=['netshark_device'],
                          dynamic=True,
                          pre_process_func=func)

        fields_add_time_selection(self,
                                  initial_duration=duration,
                                  durations=field_options['durations'])
        fields_add_resolution(self,
                              initial=field_options['resolution'],
                              resolutions=field_options['resolutions'])

        if self.options.include_filter:
            fields_add_filterexpr(self)

        if self.options.include_bpf_filter:
            fields_add_bpf_filterexpr(self)

        if self.options.show_entire_msa:
            TableField.create(keyword='entire_msa', obj=self,
                              field_cls=forms.BooleanField,
                              label='Entire MSA (ignore start/end times)',
                              initial=True,
                              required=False)
예제 #11
0
    def post_process_table(self, field_options):
        # Add a time selection field

        fields_add_device_selection(self, keyword='appresponse_device',
                                    label='AppResponse', module='appresponse',
                                    enabled=True)

        if self.options.source == 'packets':
            func = Function(appresponse_source_choices, self.options)
            fields_add_source_choices(self, func)

            if self.options.show_entire_pcap:
                fields_add_entire_pcap(self)

        if self.options.include_filter:
            fields_add_filterexpr(self)

        fields_add_granularity(self, initial=field_options['granularity'],
                               source=self.options.source)

        fields_add_time_selection(self, show_end=True,
                                  initial_duration=field_options['duration'])
예제 #12
0
    def post_process_table(self, field_options):
        duration = field_options['duration']
        if isinstance(duration, int):
            duration = "%dm" % duration

        fields_add_device_selection(self, keyword='netshark_device',
                                    label='NetShark', module='netshark',
                                    enabled=True)

        func = Function(netshark_source_name_choices,
                        self.options)
        TableField.create(
            keyword='netshark_source_name', label='Source',
            obj=self,
            field_cls=IDChoiceField,
            field_kwargs={'widget_attrs': {'class': 'form-control'}},
            parent_keywords=['netshark_device'],
            dynamic=True,
            pre_process_func=func
        )

        if self.options.include_persistent:
            TableField.create(keyword='netshark_persistent',
                              label='Persistent View', obj=self,
                              field_cls=forms.BooleanField,
                              initial=False)

        fields_add_time_selection(self,
                                  initial_duration=duration,
                                  durations=field_options['durations'])
        fields_add_resolution(self,
                              initial=field_options['resolution'],
                              resolutions=field_options['resolutions'])

        if self.options.include_filter:
            fields_add_filterexpr(self)

        if self.options.include_bpf_filter:
            fields_add_bpf_filterexpr(self)
예제 #13
0
    def post_process_table(self, field_options):
        # Add a time selection field

        fields_add_device_selection(self,
                                    keyword='appresponse_device',
                                    label='AppResponse',
                                    module='appresponse',
                                    enabled=True)

        if self.options.source == 'packets':
            func = Function(appresponse_source_choices, self.options)

            TableField.create(
                keyword='appresponse_source',
                label='Source',
                obj=self,
                field_cls=IDChoiceField,
                field_kwargs={'widget_attrs': {
                    'class': 'form-control'
                }},
                parent_keywords=['appresponse_device'],
                dynamic=True,
                pre_process_func=func)

            if self.options.show_entire_pcap:
                TableField.create(keyword='entire_pcap',
                                  obj=self,
                                  field_cls=forms.BooleanField,
                                  label='Entire PCAP',
                                  initial=True,
                                  required=False)

        fields_add_granularity(self,
                               initial=field_options['granularity'],
                               source=self.options.source)

        fields_add_time_selection(self,
                                  show_end=True,
                                  initial_duration=field_options['duration'])
예제 #14
0
    def post_process_table(self, field_options):
        duration = field_options['duration']
        if isinstance(duration, int):
            duration = "%dm" % duration

        fields_add_device_selection(self, keyword='netshark_device',
                                    label='NetShark', module='netshark',
                                    enabled=True)

        TableField.create(keyword='netshark_source_name', label='Source',
                          obj=self,
                          field_cls=forms.ChoiceField,
                          parent_keywords=['netshark_device'],
                          dynamic=True,
                          pre_process_func=Function(netshark_source_name_choices))

        fields_add_time_selection(self,
                                  initial_duration=duration,
                                  durations=field_options['durations'])
        fields_add_resolution(self,
                              initial=field_options['resolution'],
                              resolutions=field_options['resolutions'])
        self.fields_add_filterexpr()
    def post_process_table(self, field_options):
        fields_add_device_selection(self, keyword='netprofiler_device',
                                    label='NetProfiler', module='netprofiler',
                                    enabled=True)
        fields_add_time_selection(self, show_end=True, show_duration=False)

        func = Function(netprofiler_live_templates, self.options)

        TableField.create('template_id', label='Template',
                          obj=self,
                          field_cls=IDChoiceField,
                          parent_keywords=['netprofiler_device'],
                          dynamic=True,
                          pre_process_func=func)

        self.add_column('template_id', 'Template ID', datatype='string',
                        iskey=True)
        self.add_column('widget_id', 'Widget ID', datatype='integer',
                        iskey=True)
        self.add_column('title', 'Title', datatype='string')
        self.add_column('widget_type', 'Type', datatype='string')
        self.add_column('visualization', 'Visualization', datatype='string')
        self.add_column('datasource', 'Data Source', datatype='string')
예제 #16
0
 def post_process_table(self, field_options):
     fields_add_device_selection(self,
                                 keyword='netshark_device',
                                 label='NetShark',
                                 module='netshark',
                                 enabled=True)
     fields_add_time_selection(self,
                               show_start=True,
                               initial_start_time='now-1m',
                               show_end=True,
                               show_duration=False)
     fields_add_resolution(self,
                           initial=field_options['resolution'],
                           resolutions=field_options['resolutions'])
     func = Function(netshark_source_name_choices, self.options)
     TableField.create(keyword='netshark_source_name',
                       label='Source',
                       obj=self,
                       field_cls=forms.ChoiceField,
                       parent_keywords=['netshark_device'],
                       dynamic=True,
                       pre_process_func=func)
     fields_add_filterexpr(obj=self)
     self.add_column('filename', datatype='string')
예제 #17
0
    def post_process_table(self, field_options):
        fields_add_device_selection(self,
                                    keyword='netshark_device_src',
                                    label='NetShark Source',
                                    module='netshark',
                                    enabled=True)
        fields_add_device_selection(self,
                                    keyword='netshark_device_dst',
                                    label='NetShark Dest',
                                    module='netshark',
                                    enabled=True)

        fields_add_device_selection(self,
                                    keyword='netshark_device_upload',
                                    label='NetShark MSA',
                                    module='netshark',
                                    enabled=True)
        TableField.create(
            keyword='netshark_source_name_src',
            label='Source Capture Job',
            obj=self,
            field_cls=forms.ChoiceField,
            field_kwargs={'widget_attrs': {
                'class': 'form-control'
            }},
            parent_keywords=['netshark_device_src'],
            dynamic=True,
            pre_process_func=Function(netshark_source_choices,
                                      {'field': 'netshark_device_src'}))
        TableField.create(
            keyword='netshark_source_name_dst',
            label='Dest Capture Job',
            obj=self,
            field_cls=forms.ChoiceField,
            field_kwargs={'widget_attrs': {
                'class': 'form-control'
            }},
            parent_keywords=['netshark_device_dst'],
            dynamic=True,
            pre_process_func=Function(netshark_source_choices,
                                      {'field': 'netshark_device_dst'}))

        fields_add_time_selection(self,
                                  show_start=True,
                                  initial_start_time='now-1m',
                                  show_end=True,
                                  show_duration=False)

        fields_add_filterexpr(obj=self)
예제 #18
0
    def post_process_table(self, field_options):
        fields_add_device_selection(self, keyword='netshark_device_src',
                                    label='NetShark Source', module='netshark',
                                    enabled=True)
        fields_add_device_selection(self, keyword='netshark_device_dst',
                                    label='NetShark Dest', module='netshark',
                                    enabled=True)

        fields_add_device_selection(self, keyword='netshark_device_upload',
                                    label='NetShark MSA', module='netshark',
                                    enabled=True)
        TableField.create(
            keyword='netshark_source_name_src',
            label='Source Capture Job',
            obj=self,
            field_cls=forms.ChoiceField,
            field_kwargs={'widget_attrs': {'class': 'form-control'}},
            parent_keywords=['netshark_device_src'],
            dynamic=True,
            pre_process_func=Function(netshark_source_choices,
                                      {'field': 'netshark_device_src'})
        )
        TableField.create(
            keyword='netshark_source_name_dst',
            label='Dest Capture Job',
            obj=self,
            field_cls=forms.ChoiceField,
            field_kwargs={'widget_attrs': {'class': 'form-control'}},
            parent_keywords=['netshark_device_dst'],
            dynamic=True,
            pre_process_func=Function(netshark_source_choices,
                                      {'field': 'netshark_device_dst'})
        )

        fields_add_time_selection(self, show_start=True,
                                  initial_start_time='now-1m',
                                  show_end=True,
                                  show_duration=False)

        fields_add_filterexpr(obj=self)
예제 #19
0
 def post_process_table(self, field_options):
     fields_add_device_selection(self,
                                 keyword='steelhead_device',
                                 label='SteelHead',
                                 module='steelhead',
                                 enabled=True)
 def post_process_table(self, field_options):
     self.criteria_handle_func = Function(criteria_handle)
     self.save()
     fields_add_device_selection(self, keyword='netprofiler_device',
                                 label='NetProfiler', module='netprofiler',
                                 enabled=True)
예제 #21
0
 def post_process_table(self, field_options):
     fields_add_device_selection(self,
                                 keyword='scc_device',
                                 label='SCC',
                                 module='scc',
                                 enabled=True)
예제 #22
0
 def post_process_table(self, field_options):
     fields_add_device_selection(self, keyword='scc_device',
                                 label='SCC', module='scc',
                                 enabled=True)