Skip to content

Commit

Permalink
Commit of initial MISP TA for Splunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Tricaud committed Dec 27, 2017
0 parents commit ff10cb3
Show file tree
Hide file tree
Showing 152 changed files with 75,484 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
@@ -0,0 +1,11 @@
MISP TA for Splunk
==================

This TA allows to check if objects in your MISP instance matches your data in Splunk.

This is Work In Progress. You can enjoy this version 0.0 and I am more than happy to take ideas of improvements / pull requests etc.

ChangeLog
---------
* version 0.0: initial release that downloads some attributes and creates lookups

4 changes: 4 additions & 0 deletions README/inputs.conf.spec
@@ -0,0 +1,4 @@
[input_misp://<name>]
misp_url = Please provide the URL where you access to your MISP instance
automation_key = Please provide your automation key, which you can get from your MISP instance, such as: https://misp.example.com/events/automation

3 changes: 3 additions & 0 deletions bin/certifi/__init__.py
@@ -0,0 +1,3 @@
from .core import where, old_where

__version__ = "2017.11.05"
2 changes: 2 additions & 0 deletions bin/certifi/__main__.py
@@ -0,0 +1,2 @@
from certifi import where
print(where())
4,605 changes: 4,605 additions & 0 deletions bin/certifi/cacert.pem

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions bin/certifi/core.py
@@ -0,0 +1,37 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
certifi.py
~~~~~~~~~~
This module returns the installation location of cacert.pem.
"""
import os
import warnings


class DeprecatedBundleWarning(DeprecationWarning):
"""
The weak security bundle is being deprecated. Please bother your service
provider to get them to stop using cross-signed roots.
"""


def where():
f = os.path.dirname(__file__)

return os.path.join(f, 'cacert.pem')


def old_where():
warnings.warn(
"The weak security bundle is being deprecated. It will be removed in "
"2018.",
DeprecatedBundleWarning
)
f = os.path.dirname(__file__)
return os.path.join(f, 'weak.pem')

if __name__ == '__main__':
print(where())
414 changes: 414 additions & 0 deletions bin/certifi/old_root.pem

Large diffs are not rendered by default.

5,019 changes: 5,019 additions & 0 deletions bin/certifi/weak.pem

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions bin/chardet/__init__.py
@@ -0,0 +1,82 @@
######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
######################### END LICENSE BLOCK #########################


from .universaldetector import UniversalDetector
from .enums import InputState
from .version import __version__, VERSION


__all__ = ['UniversalDetector', 'detect', 'detect_all', '__version__', 'VERSION']


def detect(byte_str):
"""
Detect the encoding of the given byte string.
:param byte_str: The byte sequence to examine.
:type byte_str: ``bytes`` or ``bytearray``
"""
if not isinstance(byte_str, bytearray):
if not isinstance(byte_str, bytes):
raise TypeError('Expected object of type bytes or bytearray, got: '
'{0}'.format(type(byte_str)))
else:
byte_str = bytearray(byte_str)
detector = UniversalDetector()
detector.feed(byte_str)
return detector.close()


def detect_all(byte_str):
"""
Detect all the possible encodings of the given byte string.
:param byte_str: The byte sequence to examine.
:type byte_str: ``bytes`` or ``bytearray``
"""
if not isinstance(byte_str, bytearray):
if not isinstance(byte_str, bytes):
raise TypeError('Expected object of type bytes or bytearray, got: '
'{0}'.format(type(byte_str)))
else:
byte_str = bytearray(byte_str)

detector = UniversalDetector()
detector.feed(byte_str)
detector.close()

if detector._input_state == InputState.HIGH_BYTE:
results = []
for prober in detector._charset_probers:
if prober.get_confidence() > detector.MINIMUM_THRESHOLD:
charset_name = prober.charset_name
lower_charset_name = prober.charset_name.lower()
# Use Windows encoding name instead of ISO-8859 if we saw any
# extra Windows-specific bytes
if lower_charset_name.startswith('iso-8859'):
if detector._has_win_bytes:
charset_name = detector.ISO_WIN_MAP.get(lower_charset_name,
charset_name)
results.append({
'encoding': charset_name,
'confidence': prober.get_confidence()
})
if len(results) > 0:
return sorted(results, key=lambda result: -result['confidence'])

return [detector.result]

0 comments on commit ff10cb3

Please sign in to comment.