Makarand Tapaswi

105 papers A* 23A 4B 8Misc 3Journal 50Unranked 16
YearRankTypeTitle / Venue / Authors
2025 conf
ISBI
Aroof Aimen, Arsh Verma, Makarand Tapaswi, Narayanan C. Krishnan
2025 conf
NAACL (Short Papers)
Kawshik Manikantan, Makarand Tapaswi, Vineet Gandhi, Shubham Toshniwal
2025 conf
CVPR Workshops
Darshana Saravanan, Makarand Tapaswi, Vineet Gandhi
2025 J jnl
CoRR
Darshana Saravanan, Makarand Tapaswi, Vineet Gandhi
2025 J jnl
CoRR
Shivank Saxena, Dhruv Srivastava, Makarand Tapaswi
2025 J jnl
ACM Trans. Graph.
Shivank Saxena, Dhruv Srivastava, Makarand Tapaswi
2025 J jnl
CoRR
Eshika Khandelwal, Junyu Xie, Tengda Han, Max Bain, Arsha Nagrani, Andrew Zisserman, Gül Varol, Makarand Tapaswi
2025 J jnl
Trans. Mach. Learn. Res.
Manu Gaur, Darshan Singh S, Makarand Tapaswi
2025 J jnl
CoRR
Abhinav Raundhal, Gaurav Behera, P. J. Narayanan, Ravi Kiran Sarvadevabhatla, Makarand Tapaswi
2025 A conf
WACV
Prajneya Kumar, Eshika Khandelwal, Makarand Tapaswi, Vishnu Sreekumar
2025 Misc conf
ICASSP
Piyush Bagad, Makarand Tapaswi, Cees G. M. Snoek, Andrew Zisserman
2025 A* conf
CVPR
Darshana Saravanan, Varun Gupta, Darshan Singh S, Zeeshan Khan, Vineet Gandhi, Makarand Tapaswi
2025 A* conf
EMNLP
Divy Kala, Eshika Khandelwal, Makarand Tapaswi
2025 J jnl
CoRR
Divy Kala, Eshika Khandelwal, Makarand Tapaswi
2024 J jnl
CoRR
Aditya Kumar Singh, Dhruv Srivastava, Makarand Tapaswi
2024 A* conf
CVPR
Aditya Kumar Singh, Dhruv Srivastava, Makarand Tapaswi
2024 J jnl
CoRR
Manu Gaur, Darshan Singh S, Makarand Tapaswi
2024 J jnl
CoRR
Darshan Singh S, Zeeshan Khan, Makarand Tapaswi
2024 J jnl
CoRR
Kawshik Manikantan, Makarand Tapaswi, Vineet Gandhi, Shubham Toshniwal
2024 A* conf
CVPR
Haran Raajesh, Naveen Reddy Desanur, Zeeshan Khan, Makarand Tapaswi
2024 J jnl
CoRR
Haran Raajesh, Naveen Reddy Desanur, Zeeshan Khan, Makarand Tapaswi
2024 A* conf
EMNLP
Kawshik Sundar, Shubham Toshniwal, Makarand Tapaswi, Vineet Gandhi
2024 J jnl
CoRR
Kawshik Manikantan, Shubham Toshniwal, Makarand Tapaswi, Vineet Gandhi
2024 J jnl
CoRR
Manu Gaur, Darshan Singh S, Makarand Tapaswi
2024 conf
CVPR Workshops
Yash Khandelwal, Mayur Arvind, Sriram Kumar, Ashish Gupta, Sachin Kumar Danisetty, Piyush Bagad, Anish Madan, Mayank Lunayach, Aditya Annavajjala, Abhishek Maiti, Sansiddh Jain, Aman Dalmia, Namrata Deka, Jerome White, Jigar Doshi, Angjoo Kanazawa, Rahul Panicker, Alpan Raval, Srinivas Rana, Makarand Tapaswi
2024 J jnl
CoRR
Yash Khandelwal, Mayur Arvind, Sriram Kumar, Ashish Gupta, Sachin Kumar Danisetty, Piyush Bagad, Anish Madan, Mayank Lunayach, Aditya Annavajjala, Abhishek Maiti, Sansiddh Jain, Aman Dalmia, Namrata Deka, Jerome White, Jigar Doshi, Angjoo Kanazawa, Rahul Panicker, Alpan Raval, Srinivas Rana, Makarand Tapaswi
2024 J jnl
CoRR
Piyush Bagad, Makarand Tapaswi, Cees G. M. Snoek, Andrew Zisserman
2024 J jnl
CoRR
Darshana Saravanan, Darshan Singh S, Varun Gupta, Zeeshan Khan, Vineet Gandhi, Makarand Tapaswi
2023 J jnl
CoRR
Prajneya Kumar, Eshika Khandelwal, Makarand Tapaswi, Vishnu Sreekumar
2023 J jnl
CoRR
Aroof Aimen, Arsh Verma, Makarand Tapaswi, Narayanan C. Krishnan
2023 conf
WWW (Companion Volume)
Dhaval Taunk, Lakshya Khanna, Siri Venkata Pavan Kumar Kandru, Vasudeva Varma, Charu Sharma, Makarand Tapaswi
2023 J jnl
CoRR
Dhaval Taunk, Lakshya Khanna, Pavan Kandru, Vasudeva Varma, Charu Sharma, Makarand Tapaswi
2023 A* conf
CVPR
Dhruv Srivastava, Aditya Kumar Singh, Makarand Tapaswi
2023 J jnl
CoRR
Dhruv Srivastava, Aditya Kumar Singh, Makarand Tapaswi
2023 A* conf
CVPR
Piyush Bagad, Makarand Tapaswi, Cees G. M. Snoek
2023 J jnl
CoRR
Piyush Bagad, Makarand Tapaswi, Cees G. M. Snoek
2023 A conf
WACV
Darshan Singh S, Anchit Gupta, C. V. Jawahar, Makarand Tapaswi
2022 J jnl
CoRR
Arsh Verma, Makarand Tapaswi
2022 A* conf
NeurIPS
Zeeshan Khan, C. V. Jawahar, Makarand Tapaswi
2022 J jnl
CoRR
Zeeshan Khan, C. V. Jawahar, Makarand Tapaswi
2022 Misc conf
CoRL
Pierre-Louis Guhur, Shizhe Chen, Ricardo Garcia, Makarand Tapaswi, Ivan Laptev, Cordelia Schmid
2022 J jnl
CoRR
Pierre-Louis Guhur, Shizhe Chen, Ricardo Garcia, Makarand Tapaswi, Ivan Laptev, Cordelia Schmid
2022 A* conf
NeurIPS
Shizhe Chen, Pierre-Louis Guhur, Makarand Tapaswi, Cordelia Schmid, Ivan Laptev
2022 J jnl
CoRR
Shizhe Chen, Pierre-Louis Guhur, Makarand Tapaswi, Cordelia Schmid, Ivan Laptev
2022 A conf
IROS
Vladimír Petrík, Mohammad Nomaan Qureshi, Josef Sivic, Makarand Tapaswi
2022 J jnl
CoRR
Vladimír Petrík, Mohammad Nomaan Qureshi, Josef Sivic, Makarand Tapaswi
2022 conf
ECCV (39)
Shizhe Chen, Pierre-Louis Guhur, Makarand Tapaswi, Cordelia Schmid, Ivan Laptev
2022 J jnl
CoRR
Shizhe Chen, Pierre-Louis Guhur, Makarand Tapaswi, Cordelia Schmid, Ivan Laptev
2022 conf
ISMIR
Jaidev Shriram, Makarand Tapaswi, Vinoo Alluri
2022 J jnl
CoRR
Jaidev Shriram, Makarand Tapaswi, Vinoo Alluri
2022 A* conf
CVPR
Shizhe Chen, Pierre-Louis Guhur, Makarand Tapaswi, Cordelia Schmid, Ivan Laptev
2022 J jnl
CoRR
Shizhe Chen, Pierre-Louis Guhur, Makarand Tapaswi, Cordelia Schmid, Ivan Laptev
2022 J jnl
CoRR
Darshan Singh S, Anchit Gupta, C. V. Jawahar, Makarand Tapaswi
2021 A* conf
ICCV
Pierre-Louis Guhur, Makarand Tapaswi, Shizhe Chen, Ivan Laptev, Cordelia Schmid
2021 J jnl
CoRR
Pierre-Louis Guhur, Makarand Tapaswi, Shizhe Chen, Ivan Laptev, Cordelia Schmid
2021 J jnl
CoRR
Rahul Vigneswaran, Marc T. Law, Vineeth N. Balasubramanian, Makarand Tapaswi
2021 conf
ICVGIP
Rahul Vigneswaran, Marc T. Law, Vineeth N. Balasubramanian, Makarand Tapaswi
2021 J jnl
Comput. Vis. Image Underst.
Makarand Tapaswi, Vijay Kumar, Ivan Laptev
2020 B conf
FG
Vivek Sharma, Makarand Tapaswi, M. Saquib Sarfraz, Rainer Stiefelhagen
2020 J jnl
CoRR
Vivek Sharma, Makarand Tapaswi, M. Saquib Sarfraz, Rainer Stiefelhagen
2020 J jnl
CoRR
Vivek Sharma, Makarand Tapaswi, Rainer Stiefelhagen
2020 A* conf
CVPR
Anna Kukleva, Makarand Tapaswi, Ivan Laptev
2020 J jnl
CoRR
Anna Kukleva, Makarand Tapaswi, Ivan Laptev
2020 Misc conf
CoRL
Vladimír Petrík, Makarand Tapaswi, Ivan Laptev, Josef Sivic
2020 J jnl
CoRR
Vladimír Petrík, Makarand Tapaswi, Ivan Laptev, Josef Sivic
2020 J jnl
IEEE Trans. Biom. Behav. Identity Sci.
Vivek Sharma, Makarand Tapaswi, M. Saquib Sarfraz, Rainer Stiefelhagen
2019 A* conf
ICCV
Antoine Miech, Dimitri Zhukov, Jean-Baptiste Alayrac, Makarand Tapaswi, Ivan Laptev, Josef Sivic
2019 J jnl
CoRR
Antoine Miech, Dimitri Zhukov, Jean-Baptiste Alayrac, Makarand Tapaswi, Ivan Laptev, Josef Sivic
2019 B conf
FG
Vivek Sharma, Makarand Tapaswi, M. Saquib Sarfraz, Rainer Stiefelhagen
2019 J jnl
CoRR
Vivek Sharma, Makarand Tapaswi, M. Saquib Sarfraz, Rainer Stiefelhagen
2019 J jnl
CoRR
Atef Chaudhury, Makarand Tapaswi, Seung Wook Kim, Sanja Fidler
2019 A* conf
ICCV
Makarand Tapaswi, Marc T. Law, Sanja Fidler
2019 J jnl
CoRR
Makarand Tapaswi, Marc T. Law, Sanja Fidler
2019 conf
ICLR (Poster)
Seung Wook Kim, Makarand Tapaswi, Sanja Fidler
2018 A* conf
CVPR
Paul Vicol, Makarand Tapaswi, Lluís Castrejón, Sanja Fidler
2018 A* conf
CVPR
Yuhao Zhou, Makarand Tapaswi, Sanja Fidler
2018 J jnl
CoRR
Seung Wook Kim, Makarand Tapaswi, Sanja Fidler
2017 J jnl
CoRR
Paul Vicol, Makarand Tapaswi, Lluís Castrejón, Sanja Fidler
2017 A* conf
ICCV
Ruiyu Li, Makarand Tapaswi, Renjie Liao, Jiaya Jia, Raquel Urtasun, Sanja Fidler
2017 J jnl
CoRR
Ruiyu Li, Makarand Tapaswi, Renjie Liao, Jiaya Jia, Raquel Urtasun, Sanja Fidler
2016 A* conf
CVPR
Makarand Tapaswi, Yukun Zhu, Rainer Stiefelhagen, Antonio Torralba, Raquel Urtasun, Sanja Fidler
2016 A conf
WACV
Monica-Laura Haurilet, Makarand Tapaswi, Ziad Al-Halah, Rainer Stiefelhagen
2016 A* conf
CVPR
Ziad Al-Halah, Makarand Tapaswi, Rainer Stiefelhagen
2016 J jnl
CoRR
Ziad Al-Halah, Makarand Tapaswi, Rainer Stiefelhagen
2016 J jnl
CoRR
Manuel Martínez, Monica-Laura Haurilet, Ziad Al-Halah, Makarand Tapaswi, Rainer Stiefelhagen
2016
Makarand Tapaswi
2015 B conf
ICMR
Esam Ghaleb, Makarand Tapaswi, Ziad Al-Halah, Hazim Kemal Ekenel, Rainer Stiefelhagen
2015 J jnl
Int. J. Multim. Inf. Retr.
Makarand Tapaswi, Martin Bäuml, Rainer Stiefelhagen
2015 A* conf
CVPR
Makarand Tapaswi, Martin Bäuml, Rainer Stiefelhagen
2015 B conf
FG
Makarand Tapaswi, Martin Bäuml, Rainer Stiefelhagen
2015 conf
MediaEval
Marin Vlastelica P., Sergey Hayrapetyan, Makarand Tapaswi, Rainer Stiefelhagen
2015 J jnl
CoRR
Makarand Tapaswi, Yukun Zhu, Rainer Stiefelhagen, Antonio Torralba, Raquel Urtasun, Sanja Fidler
2014 B conf
AVSS
Martin Bäuml, Makarand Tapaswi, Rainer Stiefelhagen
2014 B conf
ICIP
Makarand Tapaswi, Cemal Cagn Corez, Martin Bäuml, Hazim Kemal Ekenel, Rainer Stiefelhagen
2014 B conf
ICMR
Makarand Tapaswi, Martin Bäuml, Rainer Stiefelhagen
2014 A* conf
CVPR
Makarand Tapaswi, Martin Bäuml, Rainer Stiefelhagen
2014 conf
ICVGIP
Makarand Tapaswi, Omkar M. Parkhi, Esa Rahtu, Eric Sommerlade, Rainer Stiefelhagen, Andrew Zisserman
2013 conf
SLAM@INTERSPEECH
Hervé Bredin, Johann Poignant, Guillaume Fortier, Makarand Tapaswi, Viet Bac Le, Anindya Roy, Claude Barras, Sophie Rosset, Achintya Kumar Sarkar, Qian Yang, Hua Gao, Alexis Mignon, Jakob Verbeek, Laurent Besacier, Georges Quénot, Hazim Kemal Ekenel, Rainer Stiefelhagen
2013 A* conf
CVPR
Martin Bäuml, Makarand Tapaswi, Rainer Stiefelhagen
2012 A* conf
CVPR
Makarand Tapaswi, Martin Bäuml, Rainer Stiefelhagen
2012 B conf
AVSS
Martin Bäuml, Makarand Tapaswi, Arne Schumann, Rainer Stiefelhagen
2012 conf
ECCV Workshops (3)
Hervé Bredin, Johann Poignant, Makarand Tapaswi, Guillaume Fortier, Viet Bac Le, Thibault Napoléon, Hua Gao, Claude Barras, Sophie Rosset, Laurent Besacier, Jakob Verbeek, Georges Quénot, Frédéric Jurie, Hazim Kemal Ekenel
2012 conf
MediaEval
Tomas Semela, Makarand Tapaswi, Hazim Kemal Ekenel, Rainer Stiefelhagen
2008 conf
ICVGIP
Amitava Das, Ohil K. Manyam, Makarand Tapaswi
2008 conf
SLT
Amitava Das, Ohil K. Manyam, Makarand Tapaswi, Veeresh Taranalli
redb/extractors/capa.py
← Index redb/extractors/capa.py python
from dataclasses import asdict
import inspect
import json
import subprocess
import magic
from magika import Magika
from typing import Any, Dict, List, Tuple
from datetime import datetime, timezone

from redb.extractors.enum import Tag
from redb.models.dataclasses import CAPA
from redb.extractors.extractor import Extractor
from dotenv import load_dotenv
import os

load_dotenv(override=True)

class CAPAExtractor(Extractor):

    def __init__(
        self,
        filepath,
        log,
        exporters=None,
        index_prefix=None,
        elastic_index=None,
        known_benign=False,
        known_malicious=False,
    ):
        super().__init__(
            filepath, 
            log, 
            exporters,
            index_prefix, 
            elastic_index, 
            known_benign, 
            known_malicious
        )
        self.capa = None
        self.elastic_index = self.index_prefix + "-capa"

    def _replace_empty_keys(self, dictionary, replacement="default_empty_key"):
        """
        Replace empty keys in a dictionary with a specified replacement.

        Args:
        dictionary (dict): The input dictionary
        replacement (str): The replacement for empty keys (default: 'empty_key')

        Returns:
        dict: A new dictionary with empty keys replaced
        """
        # tmp_dict = {}
        # for k, v in dictionary.items():
        #     if k == '':
        #         tmp_dict[replacement] = dictionary[k]
        #     else:
        #         tmp_dict[k] = dictionary[k]
        # return tmp_dict
        return {(replacement if k == "" else k): v for k, v in dictionary.items()}

    def _extract_capa(self):
        self.log.debug(inspect.currentframe().f_code.co_name)
        TIMEOUT = int(os.getenv("CAPA_TIMEOUT")) # 5 minutes in seconds
        capa_command = [os.getenv("CAPA_PATH"), "-j", self.filepath] # COMMENT FOR TESTING ON MAC

        import signal

        # try:
        #     result = subprocess.run(
        #         capa_command, capture_output=True, text=True, check=True, timeout=TIMEOUT
        #     )
        # except subprocess.TimeoutExpired:
        #     self.log.error(f"The capa command timed out after {TIMEOUT} seconds")
        #     return {}
        # except subprocess.CalledProcessError as e:
        #     self.log.error(f"Error running capa: {e}")
        #     return {}

        # try:
        #     capa_output = json.loads(result.stdout)
        # except json.JSONDecodeError as e:
        #     self.log.error("Error parsing capa output: {e}")
        #     return {}

        # Create a process group for easier termination of all child processes
        try:
            # Start the process in a new process group
            process = subprocess.Popen(
                capa_command,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
                text=True,
                preexec_fn=os.setsid  # Use os.setsid() to create a new process group
            )
            
            # Implement timeout handling manually
            try:
                stdout, stderr = process.communicate(timeout=TIMEOUT)
                # Process completed within timeout
                if process.returncode != 0:
                    self.log.error(f"Error running capa, return code: {process.returncode}, stderr: {stderr}")
                    return {}
            except subprocess.TimeoutExpired:
                # Kill the entire process group on timeout
                self.log.warning(f"The capa command timed out after {TIMEOUT} seconds, terminating process group")
                
                try:
                    # Send SIGTERM to the entire process group
                    os.killpg(process.pid, signal.SIGTERM)
                    
                    # Give it a moment to terminate gracefully
                    try:
                        process.wait(timeout=3)
                    except subprocess.TimeoutExpired:
                        # If it's still running after 3 seconds, send SIGKILL
                        self.log.warning("Process didn't terminate with SIGTERM, sending SIGKILL")
                        os.killpg(process.pid, signal.SIGKILL)
                        
                    process.wait()  # Make sure process resources are fully cleaned up
                except (ProcessLookupError, OSError) as e:
                    self.log.warning(f"Error while killing process: {e}")
                    
                return {}
                
            try:
                capa_output = json.loads(stdout)
            except json.JSONDecodeError as e:
                self.log.error(f"Error parsing capa output: {e}")
                return {}

            capa_dump = {}  # dictionalry of capabilities
            capabilities = set()  # list of capabilities
            namespaces = set()  # list of namespaces
            attack_dump = {}  # dictionary of tuples [tactic](technique, technique_id)
            tactics = set()  # list of tactics
            techniques = set()  # list of techniques
            techniques_id = set()  # list of techniques_id
            mbc_dump = {}  # dictionary of tuples [objective](behavior, behavior_id)
            mbc_objectives = set()  # list of objectives
            mbc_behaviors = set()  # list of behaviors
            mbc_behaviors_id = set()  # list of behaviors_id

            if isinstance(capa_output, dict) and "rules" in capa_output:
                rules = capa_output["rules"]
                if isinstance(rules, dict):
                    for rule_name, rule_data in rules.items():
                        if isinstance(rule_data, dict) and "meta" in rule_data:
                            meta = rule_data["meta"]
                            if isinstance(meta, dict):
                                # Process capabilities
                                namespace = meta.get("namespace", "").lower()
                                # if namespace != 'lib':
                                if namespace not in capa_dump:
                                    capa_dump[namespace] = []
                                    namespaces.add(namespace)
                                capa_dump[namespace].append(rule_name)
                                capabilities.add(rule_name)

                                # Process ATTACK information
                                if "attack" in meta:
                                    for attack_entry in meta["attack"]:
                                        tactic = attack_entry.get("tactic", "")
                                        technique = attack_entry.get("technique", "")
                                        id = attack_entry.get("id", "")
                                        if tactic and technique:
                                            if tactic in attack_dump:
                                                attack_dump[tactic].append((technique, id))
                                            else:
                                                attack_dump[tactic] = [(technique, id)]
                                            tactics.add(tactic)
                                            techniques.add(technique)
                                            techniques_id.add(id)

                                # Process MBC information
                                if "mbc" in meta:
                                    for mbc_entry in meta["mbc"]:
                                        objective = mbc_entry.get("objective", "")
                                        behavior = mbc_entry.get("behavior", "")
                                        id = mbc_entry.get("id", "")
                                        if objective and behavior:
                                            if objective in mbc_dump:
                                                mbc_dump[objective].append((behavior, id))
                                            else:
                                                mbc_dump[objective] = [(behavior, id)]
                                            mbc_objectives.add(objective)
                                            mbc_behaviors.add(behavior)
                                            mbc_behaviors_id.add(id)

            # return {
            #     'capabilities_all': json.dumps(capabilities_all, indent=2),
            #     'capabilities': list(capabilities),
            #     'namespaces': list(namespaces),
            #     'attack': json.dumps(attack, indent=2),
            #     'tactics': list(tactics),
            #     'techniques': list(techniques),
            #     'techniques_id': list(techniques_id),
            #     'mbc': json.dumps(mbc, indent=2),
            #     'mbc_objectives': list(mbc_objectives),
            #     'mbc_behaviors': list(mbc_behaviors),
            #     'mbc_behaviors_id': list(mbc_behaviors_id)
            # }

            capa_dump = self._replace_empty_keys(capa_dump)
            attack_dump = self._replace_empty_keys(attack_dump)
            mbc_dump = self._replace_empty_keys(mbc_dump)
            self.capa = CAPA(
                json.dumps(capa_dump, indent=2),
                list(capabilities),
                list(namespaces),
                json.dumps(attack_dump, indent=2),
                list(tactics),
                list(techniques),
                list(techniques_id),
                json.dumps(mbc_dump, indent=2),
                list(mbc_objectives),
                list(mbc_behaviors),
                list(mbc_behaviors_id),
            )
            self.log.debug(f"CAPA dump: {self.capa})")
            
        except Exception as e:
            self.log.error(f"Unexpected error in CAPA extraction: {str(e)}")
            # Try to clean up any process if possible
            if 'process' in locals() and process.poll() is None:
                try:
                    os.killpg(process.pid, signal.SIGKILL)
                    process.wait()
                except:
                    pass
            return {}

    def prepare_export_data(self, exporter_type: str) -> Any:
        if exporter_type == "ElasticsearchExporter":
            return self.capa
        elif exporter_type == "ClickHouseExporter":
            current_time = datetime.now(timezone.utc)
            
            # Prepare data for multiple tables
            tables_data = {
                'multi_table': True,  # Flag for multi-table export
                
                # Raw data table
                'raw': {
                    'table': 'redb_capa',
                    'data': [[
                        self.sha256,
                        self.md5,
                        self.sha1,
                        current_time,
                        self.capa.capa_dump,  # capa_dump
                        self.capa.attack_dump,            # attack_dump
                        self.capa.mbc_dump                # mbc_dump
                    ]],
                    'column_names': [
                        'sha256', 'md5', 'sha1', 'analysis_date',
                        'capa_dump', 'attack_dump', 'mbc_dump'
                    ],
                    'column_type_names': [
                        'FixedString(64)', 'FixedString(32)', 'FixedString(40)',
                        'DateTime64(3, \'UTC\')',
                        'JSON', 'JSON', 'JSON'
                    ]
                },
                
                # Capabilities table
                'capabilities': {
                    'table': 'redb_capa_capabilities',
                    'data': [
                        [self.sha256, self.md5, self.sha1, current_time, namespace, capability]
                        for namespace, capabilities in json.loads(self.capa.capa_dump).items()
                        for capability in capabilities
                    ],
                    'column_names': [
                        'sha256', 'md5', 'sha1', 'analysis_date',
                        'namespace', 'capability'
                    ],
                    'column_type_names': [
                        'FixedString(64)', 'FixedString(32)', 'FixedString(40)',
                        'DateTime64(3, \'UTC\')',
                        'LowCardinality(String)', 'LowCardinality(String)'
                    ]
                },
                
                # MITRE ATT&CK table
                'attack': {
                    'table': 'redb_capa_attack',
                    'data': [
                        [self.sha256, self.md5, self.sha1, current_time, 
                         tactic, technique[0], technique[1]]  # technique[0] is the name, technique[1] is the ID
                        for tactic, techniques in json.loads(self.capa.attack_dump).items()
                        for technique in techniques
                    ],
                    'column_names': [
                        'sha256', 'md5', 'sha1', 'analysis_date',
                        'tactic', 'technique', 'technique_id'
                    ],
                    'column_type_names': [
                        'FixedString(64)', 'FixedString(32)', 'FixedString(40)',
                        'DateTime64(3, \'UTC\')',
                        'LowCardinality(String)', 'LowCardinality(String)', 
                        'LowCardinality(String)'
                    ]
                },
                
                # MBC table
                'mbc': {
                    'table': 'redb_capa_mbc',
                    'data': [
                        [self.sha256, self.md5, self.sha1, current_time,
                         objective, behavior[0], behavior[1]]  # behavior[0] is the name, behavior[1] is the ID
                        for objective, behaviors in json.loads(self.capa.mbc_dump).items()
                        for behavior in behaviors
                    ],
                    'column_names': [
                        'sha256', 'md5', 'sha1', 'analysis_date',
                        'objective', 'behavior', 'behavior_id'
                    ],
                    'column_type_names': [
                        'FixedString(64)', 'FixedString(32)', 'FixedString(40)',
                        'DateTime64(3, \'UTC\')',
                        'LowCardinality(String)', 'LowCardinality(String)',
                        'LowCardinality(String)'
                    ]
                }
            }
            
            return tables_data

    def get_clickhouse_table(self) -> str:
        return "redb_capa"  # Return the main table name

    def extract(self):
        self.log.debug(inspect.currentframe().f_code.co_name)
        try:
            self._extract_capa()
            return self.capa  # Return the extracted data instead of exporting directly
        except Exception as e:
            self.log.error(f"Error extracting CAPA: {e}")
            return None

    def tag(self):
        return Tag.CAPA.value