Carol Tenopir

76 papers Journal 57Unranked 18
YearRankTypeTitle / Venue / Authors
2023 J jnl
Learn. Publ.
David Nicholas, Cherifa Boukacem-Zeghmouri, Blanca Rodríguez-Bravo, Eti Herman, Abdullah Abrizah, David J. Clark, Galina Serbina, David Sims, Marzena Swigon, Jie Xu, Anthony Watkinson, Hamid R. Jamali, Carol Tenopir, Suzie Allard
2023 J jnl
Learn. Publ.
Eti Herman, David Nicholas, David J. Clark, Cherifa Boukacem-Zeghmouri, Blanca Rodríguez-Bravo, Abdullah Abrizah, David Sims, Anthony Watkinson, Jie Xu, Galina Serbina, Marzena Swigon, Hamid R. Jamali, Carol Tenopir, Suzie Allard
2023 J jnl
Learn. Publ.
David Nicholas, Eti Herman, David J. Clark, Cherifa Boukacem-Zeghmouri, Blanca Rodríguez-Bravo, Abdullah Abrizah, Anthony Watkinson, David Sims, Marzena Swigon, Jie Xu, Galina Serbina, Hamid R. Jamali, Carol Tenopir, Suzie Allard
2023 J jnl
Learn. Publ.
David Nicholas, Eti Herman, Cherifa Boukacem-Zeghmouri, Blanca Rodríguez-Bravo, Anthony Watkinson, Abdullah Abrizah, Marzena Swigon, Jie Xu, David Sims, Galina Serbina, David J. Clark, Hamid R. Jamali, Carol Tenopir, Suzie Allard
2022 J jnl
Learn. Publ.
David Nicholas, Eti Herman, David J. Clark, Cherifa Boukacem-Zeghmouri, Blanca Rodríguez-Bravo, Abdullah Abrizah, Anthony Watkinson, Jie Xu, David Sims, Galina Serbina, Marzena Swigon, Hamid R. Jamali, Carol Tenopir, Suzie Allard
2021 J jnl
Int. J. Digit. Curation
Robert J. Sandusky, Suzie Allard, Lynn Baird, Leah Cannon, Kevin Crowston, Amy Forrester, Bruce Grant, Rachael Hu, Robert Olendorf, Danielle Pollock, Alison Specht, Carol Tenopir, Rachel Volentine
2019 J jnl
J. Documentation
Elina Late, Carol Tenopir, Sanna Talja, Lisa Christian
2019 J jnl
Publ.
Carol Tenopir, Lisa Christian, Jordan Kaufman
2017 J jnl
Coll. Res. Libr.
Carol Tenopir, Elizabeth Dalton, Lisa Christian, Misty Jones, Mark McCabe, MacKenzie Smith, Allison Fish
2017 J jnl
Learn. Publ.
Amy Forrester, Bo-Christer Björk, Carol Tenopir
2017 J jnl
Learn. Publ.
Carol Tenopir, Suzie Allard, Lisa Christian, Robert Anderson, Suzan Ali-Saleh, David Nicholas, Anthony Watkinson, Hazel M. Woodward
2016 J jnl
J. Assoc. Inf. Sci. Technol.
Carol Tenopir
2016 J jnl
Inf. Process. Manag.
Anthony Watkinson, David Nicholas, Clare Thornley, Eti Herman, Hamid R. Jamali, Rachel Volentine, Suzie Allard, Kenneth J. Levine, Carol Tenopir
2016 conf
ASIST
Carol Tenopir, Danielle Pollock, Suzie Allard, Dane Hughes
2016 J jnl
J. Assoc. Inf. Sci. Technol.
Carol Tenopir, Kenneth J. Levine, Suzie Allard, Lisa Christian, Rachel Volentine, Reid I. Boehm, Frances Nichols, David Nicholas, Hamid R. Jamali, Eti Herman, Anthony Watkinson
2016 J jnl
Publ.
Carol Tenopir, Elizabeth Dalton, Allison Fish, Lisa Christian, Misty Jones, MacKenzie Smith
2015 J jnl
Learn. Publ.
David Nicholas, Anthony Watkinson, Hamid R. Jamali, Eti Herman, Carol Tenopir, Rachel Volentine, Suzie Allard, Kenneth J. Levine
2015 J jnl
Learn. Publ.
Carol Tenopir, Donald W. King, Lisa Christian, Rachel Volentine
2015 J jnl
Inf. Res.
Clare Thornley, Anthony Watkinson, David Nicholas, Rachel Volentine, Hamid R. Jamali, Eti Herman, Suzie Allard, Kenneth J. Levine, Carol Tenopir
2014 J jnl
J. Assoc. Inf. Sci. Technol.
Kimberly Douglass, Suzie Allard, Carol Tenopir, Lei Wu, Mike Frame
2014 conf
ASIST
Carole L. Palmer, Cheryl A. Thompson, Carol Tenopir, Suzie Allard, Matthew S. Mayernik, James Kreft
2014 conf
ASIST
Joan E. Beaudoin, Deborah H. Charbonneau, Suzie Allard, Carol Tenopir, Hsin-Liang Chen, Yin Zhang, Jian Qin, Lisa Zilinski
2014 J jnl
Learn. Publ.
David Nicholas, Anthony Watkinson, Rachel Volentine, Suzie Allard, Kenneth J. Levine, Carol Tenopir, Eti Herman
2014 J jnl
Inf. Serv. Use
Carol Tenopir
2013 J jnl
Int. J. Digit. Curation
Karon Kelly, Mary Marlino, Matthew S. Mayernik, Suzie Allard, Carol Tenopir, Carole L. Palmer, Virgil E. Varvel Jr.
2013 J jnl
Online Inf. Rev.
Carol Tenopir, Rachel Volentine, Donald W. King
2013 J jnl
Aslib Proc.
Rachel Volentine, Carol Tenopir
2012 J jnl
Learn. Publ.
Carol Tenopir, Rachel Volentine, Donald W. King
2012 J jnl
Ecol. Informatics
William K. Michener, Suzie Allard, Amber E. Budden, Robert B. Cook, Kimberly Douglass, Mike Frame, Steve Kelling, Rebecca Koskela, Carol Tenopir, David Vieglais
2011 J jnl
Learn. Publ.
Carol Tenopir, Suzie Allard, Benjamin J. Bates, Kenneth J. Levine, Donald W. King, Ben Birch, Regina Mays, Chris K. Caldwell
2011 conf
ASIST
Carol Tenopir, Carole L. Palmer, Lisa Metzer, Jeffrey R. van der Hoeven, Jim Malone
2011 J jnl
Annu. Rev. Inf. Sci. Technol.
Donald W. King, Carol Tenopir
2010 J jnl
Learn. Publ.
Kitty McClanahan, Lei Wu, Carol Tenopir, Donald W. King
2009 J jnl
J. Assoc. Inf. Sci. Technol.
Suzie Allard, Kenneth J. Levine, Carol Tenopir
2009 J jnl
Aslib Proc.
Carol Tenopir, Donald W. King, Sheri Edwards, Lei Wu
2009 J jnl
Learn. Publ.
Donald W. King, Carol Tenopir, Songphan Choemprayong, Lei Wu
2009 conf
ASIST
Robert J. Sandusky, Carole L. Palmer, Suzie Allard, Melissa H. Cragin, Patricia Cruse, Allen Renear, Carol Tenopir
2008 J jnl
Inf. Process. Manag.
Carol Tenopir, Peiling Wang, Yan Zhang, Beverly Simmons, Richard Pollard
2008 J jnl
D Lib Mag.
Carol Tenopir, Donald W. King
2008 J jnl
J. Assoc. Inf. Sci. Technol.
Robert J. Sandusky, Carol Tenopir
2008 J jnl
J. Assoc. Inf. Sci. Technol.
Concepción S. Wilson, Carol Tenopir
2008 J jnl
Libr. Trends
Carol Tenopir
2008 conf
ASIST
Michael K. Buckland, Maria Rosario Osuna Alarcon, Robert V. Williams, Joan Lussky, Malissa Ruffner, Emily Glenn, Linda C. Smith, Carol Tenopir, Diane Barlow, Trudi Bellardo Hahn
2008 J jnl
Aslib Proc.
Ian Rowlands, David Nicholas, Peter Williams, Paul Huntington, Maggie Fieldhouse, Barrie Gunter, Richard Withey, Hamid R. Jamali, Tom Dobrowolski, Carol Tenopir
2008 J jnl
Aslib Proc.
David Nicholas, Paul Huntington, Hamid R. Jamali, Ian Rowlands, Tom Dobrowolski, Carol Tenopir
2007 conf
ASIST
Robert J. Sandusky, Carol Tenopir, Margaret M. Casado
2007 conf
ASIST
José-Marie Griffiths, Donald W. King, Jeffrey Pomerantz, Carol Tenopir, George D'Elia, Sarah E. Aerni
2007 conf
ASIST
Robert J. Sandusky, Carol Tenopir, Margaret M. Casado
2006 J jnl
J. Assoc. Inf. Sci. Technol.
Paul Huntington, David Nicholas, Hamid R. Jamali M., Carol Tenopir
2006 conf
ASIST
Brenda Dervin, Karen E. Fisher, Eric M. Meyers, Charles Naumer, Marilyn Ostergren, Carol Tenopir, Kreetta Askola, LouAnn F. Blocker, Carly Hamlett, Timothy Lepczyk, Ashley McConnell, Anthony Schlagel, Kelli Y. Williams, Andrew Dillon, Lorraine Normore, Tingting Lv, Shannon Hoste, Troy Elias, Peter H. Jones, CarrieLynn D. Reinhard, Bethany Simunich, Donald O. Case, Melissa A. Gardner, Gary K. Hughes, Jennifer L. Robinette, Robert J. Trader, Granger H. Butler, Melissa D. Davis, Sarah M. Donaldson, Susan M. Finley, Betsy A. Law, Anne E. Ledford, Christina Joy Mark, Nancy R. Marshall, Krista M. McManis, Jennifer Paul, Sarah F. Pratt, Latisha M. Reynolds, Kathryn P. Sexton, Roberta D. Shannon, Sara Fowdy Strange
2006 J jnl
Inf. Serv. Use
Carol Tenopir
2006 conf
ASIST
Cecelia M. Brown, Catherine Blake, E. Ashley Rogers Brown, Carol Tenopir
2006 J jnl
D Lib Mag.
Donald W. King, Carol Tenopir, Michael Clarke
2006 conf
ASIST
Suzie Allard, Kenneth J. Levine, Carol Tenopir, Shalini R. Urs
2006 J jnl
J. Documentation
David Nicholas, Paul Huntington, Hamid R. Jamali, Carol Tenopir
2005 conf
ASIST
Anthony Debons, Chaim Zins, Claire Begthal, Glynn Harmon, Donald T. Hawkins, Thomas J. Froehlich, Charles H. Davis, Michel J. Menou, Carol Tenopir
2005 J jnl
J. Assoc. Inf. Sci. Technol.
Carol Tenopir, Donald W. King, Peter B. Boyce, Matt Grayson, Keri-Lynn Paulson
2005 conf
ASIST
K. T. L. Vaughan, Carol Tenopir, Cecelia M. Brown, Bradley M. Hemminger, Jon Jablonski
2005 J jnl
Learn. Publ.
David Nicholas, Paul Huntington, Bill Russell, Anthony Watkinson, Hamid R. Jamali, Carol Tenopir
2004 conf
ASIST
Efthimis N. Efthimiadis, David G. Hendry, Pamela A. Savage-Knepshield, Carol Tenopir, Peiling Wang
2004 conf
ASIST
Carol Tenopir, Peiling Wang, Richard Pollard, Yan Zhang, Beverly Simmons
2003 J jnl
Libr. Trends
Carol Tenopir
2003 J jnl
Aslib Proc.
Carol Tenopir
2003 J jnl
Libr. Trends
Donald W. King, Peter B. Boyce, Carol Hansen Montgomery, Carol Tenopir
2003 J jnl
D Lib Mag.
Donald W. King, Sarah E. Aerni, Carol Tenopir, Carol Hansen Montgomery
2003 J jnl
D Lib Mag.
Carol Tenopir, Matt Grayson, Yan Zhang, Mercy Ebuen, Donald W. King, Peter B. Boyce
2003 conf
ASIST
Carol Tenopir, Richard Pollard, Peiling Wang, Dan Greene, Elizabeth Kline, Julia Krummen, Rachel Kirk
2003 conf
ASIST
Wonsik Shim, Lynn Silipigni Connaway, Carol Tenopir, Peiling Wang, Dongming Zhang
2002 J jnl
Learn. Publ.
Carol Tenopir, Donald W. King
2000 J jnl
Inf. Process. Manag.
Peiling Wang, William B. Hawk, Carol Tenopir
1999 J jnl
Learn. Publ.
Donald W. King, Carol Tenopir
1996 J jnl
J. Am. Soc. Inf. Sci.
Diane Nahl, Carol Tenopir
1995 J jnl
Libr. Trends
Carol Tenopir
1990 J jnl
J. Am. Soc. Inf. Sci.
Carol Tenopir
1988 J jnl
J. Am. Soc. Inf. Sci.
Carol Tenopir
1984
Carol Tenopir
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