ranguli/ioccheck

View on GitHub
Update README.md #147
Joshua Murphy authored db02d921
complete00:00:14
Your first build completed successfully!

Congratulations

Your first build completed successfully!

See the Results

1
git clone
2
codeclimate validate-config
View output
codeclimate validate-config
No errors or warnings found in .codeclimate.json.
3
codeclimate prepare
View output
codeclimate prepare
4
builder pull-engines
View output
determining required images
5
structure
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
6
duplication
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
I, [2024-10-28T08:53:59.701439 #1]  INFO -- : Skipping file ./docs/source/conf.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 6
    copyright = f"{year}, ranguli"
                                 ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.716066 #1]  INFO -- : Skipping file ./ioccheck/iocs/hash.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 37
    ioc: str,
       ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.732532 #1]  INFO -- : Skipping file ./ioccheck/iocs/ip.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 34
    shodan: Shodan = None  # type: ignore
          ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.744471 #1]  INFO -- : Skipping file ./ioccheck/iocs/ioc.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 22
    twitter: Twitter = None  # type: ignore
           ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.748460 #1]  INFO -- : Skipping file ./ioccheck/reports/html_report.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 13
    def __init__(self, ioc: IOC, templates_dir: str):
                          ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.764170 #1]  INFO -- : Skipping file ./ioccheck/reports/report.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 19
    warning: str
           ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.768254 #1]  INFO -- : Skipping file ./ioccheck/ioc_types.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 15
    name: str
        ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.777269 #1]  INFO -- : Skipping file ./ioccheck/shared/__init__.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 17
    engine: str
          ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.790558 #1]  INFO -- : Skipping file ./ioccheck/services/virustotal.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 26
    def _get_api_response(self, ioc: str) -> Optional[dict]:
                                   ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.799511 #1]  INFO -- : Skipping file ./ioccheck/services/service.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 15
    name: str
        ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.813670 #1]  INFO -- : Skipping file ./ioccheck/services/shodan.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 20
    ioc: Union[IPv4Address, IPv6Address]
       ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.820494 #1]  INFO -- : Skipping file ./ioccheck/services/twitter.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 33
    def _get_api_response(self, ioc: str) -> dict:
                                   ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.826689 #1]  INFO -- : Skipping file ./ioccheck/services/malwarebazaar.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 19
    ioc: str
       ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.835502 #1]  INFO -- : Skipping file ./ioccheck/cli/printers.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 26
    self, ioc, heading: Optional[str], attr: str, delim: str, error_text: str
                      ^
SyntaxError: invalid syntax


I, [2024-10-28T08:53:59.839849 #1]  INFO -- : Skipping file ./ioccheck/cli/__init__.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 73
    cprint(f"v{version} (https://github.com/ranguli/ioccheck)\n", HEADING_COLOR)
                                                               ^
SyntaxError: invalid syntax
7
bandit
bandit engine documentation
View output
[main]	INFO	profile include tests: None
[main]	INFO	profile exclude tests: None
[main]	INFO	cli include tests: None
[main]	INFO	cli exclude tests: None
[node_visitor]	INFO	Unable to find qualified name for module: noxfile.py
8
sonar-python
sonar-python engine documentation
View output
INFO: Java 1.8.0_111-internal Oracle Corporation (64-bit)
INFO: Linux 4.4.0-1128-aws amd64
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-core-2.17.0.899.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-cli-2.1.0.566.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
INFO: Index files
INFO: 53 files indexed
ERROR: Unable to parse file: /code/ioccheck/iocs/ip.py
ERROR: Parse error at line 34 column 10:

   24: )
   25: f_handler.setFormatter(f_format)
   26: 
   27: logger.addHandler(f_handler)
   28: 
   29: 
   30: @dataclass
   31: class IPReport(IOCReport):
   32:     """Report representing threat intelligence results for an IP object"""
   33: 
  -->      shodan: Shodan = None                
   35:     twitter: Twitter = None                
   36: 
   37: 
   38: class IP(IOC):
   39:     """Type of IOC representing IP addresses
   40: 
   41:     Attributes:
   42:         hash_type: Indicates the hashing algorithm used by the hash.
   43:         ioc: Represenation of the IOC as a string
   44:         services: Supported services that can be used to investigate the IOC
   45: 
   46:     """
   47: 
   48:     def __init__(self, ioc: str

ERROR: Unable to parse file: /code/ioccheck/iocs/ioc.py
ERROR: Parse error at line 22 column 11:

   13: (MalwareBazaar, Service, Shodan, Twitter,
   14:                                VirusTotal)
   15: from ioccheck.shared import default_config_path
   16: 
   17: 
   18: @dataclass
   19: class IOCReport:
   20:     """Report class containing responses for specific services"""
   21: 
  -->      twitter: Twitter = None                
   23:     shodan: Shodan = None                
   24:     virustotal: VirusTotal = None                
   25:     malwarebazaar: MalwareBazaar = None                
   26: 
   27: 
   28: class IOC:                                                                       
   29:     """Base class for creating indicators of compromise classes
   30: 
   31:     Attributes:
   32:         ioc: The Indicator of Compromise
   33:         config_path: The filepath of the configuration file
   34:         reports: The Indicator of Compromise
   35:         services: All potential services avilable for the IOC type
   36:     """

ERROR: Unable to parse file: /code/ioccheck/reports/report.py
ERROR: Parse error at line 19 column 11:

    9: from emoji import emojize
   10: from jinja2 import Environment, FileSystemLoader
   11: 
   12: from ioccheck.iocs import IOC
   13: 
   14: 
   15: @dataclass
   16: class Icons:
   17:     """Contains icons for use in report"""
   18: 
  -->      warning: str
   20:     okay: str
   21:     clipboard: str
   22:     alert: str
   23:     virus: str
   24:     link: str
   25: 
   26: 
   27: class Report(ABC):

ERROR: Unable to parse file: /code/ioccheck/ioc_types.py
ERROR: Parse error at line 15 column 8:

    2: """Module providing custom types for ioccheck"""
    3: 
    4: from dataclasses import dataclass
    5: 
    6: 
    7: class IOCType:                                          
    8:     """Base class for representing a type of IOC"""
    9: 
   10: 
   11: @dataclass
   12: class HashType(IOCType):
   13:     """Representation of file hash"""
   14: 
  -->      name: str
   16:     regex: str
   17: 
   18:     def __str__(self) -> str:
   19:         return self.name
   20: 
   21: 
   22: SHA256 = HashType(name

ERROR: Unable to parse file: /code/ioccheck/shared/__init__.py
ERROR: Parse error at line 17 column 10:

    8: Optional
    9: 
   10: default_config_path = os.path.join(Path.home(), ".config/ioccheck/")
   11: 
   12: 
   13: @dataclass
   14: class Detection:
   15:     """Detection of a sample by an anti-virus provider"""
   16: 
  -->      engine: str
   18:     name: str
   19:     malicious: bool
   20: 
   21: 
   22: @dataclass
   23: class Behavior:
   24:     """Observed behavior of a sample from a sandbox"""
   25: 
   26:     vendor: str
   27:     behavior: str
   28: 

ERROR: Unable to parse file: /code/ioccheck/services/virustotal.py
ERROR: Parse error at line 103 column 12:

   97: except AttributeError:
   98:             return None
   99: 
  100:         @property
  101:     def tags(self) -> Set[str]:
  102:         """User-provided tags to classify samples"""
  -->          tags: Set[str] = set()
  104: 
  105:         try:
  106:             names = self.response.get("popular_threat_classification").get(
  107:                 "popular_threat_name"
  108:             )
  109: 

ERROR: Unable to parse file: /code/ioccheck/services/service.py
ERROR: Parse error at line 15 column 8:

    6: from typing import Any, List
    7: 
    8: from ioccheck import exceptions
    9: from ioccheck.shared import Credentials
   10: 
   11: 
   12: class Service(ABC):                                          
   13:     """Service base class for adding new threat intelligence services"""
   14: 
  -->      name: str
   16:     ioc: Any
   17:     reputation: Any
   18:     required_credentials: List[str]
   19: 
   20:     def __init__(self, ioc, credentials: dict):

ERROR: Unable to parse file: /code/ioccheck/services/shodan.py
ERROR: Parse error at line 20 column 7:

   11: InvalidCredentialsError
   12: from ioccheck.services.service import Service
   13: 
   14: 
   15: class Shodan(Service):
   16:     """Represents a response from the Shodan.io API"""
   17: 
   18:     name = "shodan"
   19:     url = "https://shodan.io/host/"
  -->      ioc: Union[IPv4Address, IPv6Address]
   21:     required_credentials = ["api_key"]
   22: 
   23:     def __init__(self, ioc: Union[IPv4Address, IPv6Address], credentials:

ERROR: Unable to parse file: /code/ioccheck/services/malwarebazaar.py
ERROR: Parse error at line 19 column 7:

   10: InvalidCredentialsError
   11: from ioccheck.services.service import Service
   12: 
   13: 
   14: class MalwareBazaar(Service):
   15:     """ Represents the data from a MalwareBazaar API response"""
   16: 
   17:     name = "malwarebazaar"
   18:     url = "https://mb-api.abuse.ch/api/v1/"
  -->      ioc: str
   20:     required_credentials = ["api_key"]
   21: 
   22:     def __init__(self, ioc: str, credentials: dict):
   23:         Service.__init__(self

INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.408s
INFO: Final Memory: 6M/295M
INFO: ------------------------------------------------------------------------