aristotle


Namearistotle JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttps://github.com/secureworks/aristotle
SummaryScript and library for the viewing, filtering, and modifying of Suricata and Snort rulesets based on interpreted key-value pairs present in the metadata keyword within each rule.
upload_time2024-11-02 04:26:09
maintainerNone
docs_urlNone
authorDavid Wharton
requires_python>=2.7
licenseNone
keywords suricata snort metadata ruleset better ids ips nids signatures
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =========
Aristotle
=========

Aristotle is a simple Python program that allows for the filtering and modifying of
Suricata and Snort rulesets based on interpreted key-value pairs present
in the metadata keyword within each rule. It can be run as a standalone
script or utilized as a module.

.. image:: docs/_static/aristotle.png

Documentation
=============

`<https://aristotle-py.readthedocs.io/>`__

Application Overview
====================

Aristotle takes in a ruleset and can provide statistics on the included
metadata keys. If a filter string is provided, it will also be applied
against the ruleset and the filtered ruleset outputted.

Aristotle also offers the ability to intelligently process rules to extract, enrich, and add
metadata to them.  After initial filtering, rules can additionally
undergo "Post Filter Modification" which can modify them
based on user-defined criteria, to help ensure the resulting
rules in the ruleset are enabled, configured, and optimized for the target environment.

Aristotle is compatible with Python 2.7 and Python 3.x.

+------------------------------------------------------------------------------------+
| In order for Aristotle to be most useful, it should be provided a ruleset that     |
| has rules with the metadata keyword populated with appropriate key-value           |
| pairs. Aristotle assumes that the provided ruleset conforms to the                 |
| `BETTER Schema <https://better-schema.readthedocs.io/>`__.                         |
+------------------------------------------------------------------------------------+

Setup
=====

Install dependencies:

``pip install -r requirements.txt``

Or if using as a module:

``pip install aristotle``

And refer to `Aristotle as a Module <https://aristotle-py.readthedocs.io/en/latest/module.html>`__.

Usage
=====

.. code:: console

    usage: aristotle.py [-h] -r RULES [-f METADATA_FILTER]
                        [--summary [DISPLAY_MAX]] [-o OUTFILE]
                        [-s [STATS [STATS ...]]] [-i] [-c] [-n] [-e] [-t] [-g]
                        [-m] [-p PFMOD_FILE] [-q] [-d]

    Filter Suricata and Snort rulesets based on metadata keyword values.

    optional arguments:
      -h, --help            show this help message and exit
      -r RULES, --rules RULES, --ruleset RULES
                            path to a rules file, a directory containing '.rules'
                            file(s), or string containing the ruleset
      -f METADATA_FILTER, --filter METADATA_FILTER
                            Boolean filter string or path to a file containing it
      --summary [DISPLAY_MAX]
                            output a summary of the filtered ruleset to stdout,
                            limited to DISPLAY_MAX number of lines (or 16 if no
                            value given); if the option to output to a file is
                            set, the full, filtered ruleset will still be written.
      -o OUTFILE, --output OUTFILE
                            output file to write filtered ruleset to
      -s [STATS [STATS ...]], --stats [STATS [STATS ...]]
                            display ruleset statistics about specified key(s). If
                            no key(s) supplied, then summary statistics for all
                            keys will be displayed.
      -i, --enable-all-rules, --enable-all, --include-disabled
                            enable all valid rules, including those
                            disabled/commented out in the given rules file(s),
                            when applying the filter
      -c, --output-disabled-rules
                            include disabled rules in the output as commented out
                            lines.
      -n, --normalize, --better, --iso8601
                            try to convert date and cve related metadata values to
                            conform to the BETTER schema for filtering and
                            statistics. Dates are normalized to the format YYYY-
                            MM-DD and CVEs to YYYY-<num>. Also, 'sid' is removed
                            from the metadata.
      -e, --enhance         enhance metadata by adding additional key-value pairs
                            based on the rules.
      -t, --ignore-classtype, --ignore-classtype-keyword
                            don't incorporate the 'classtype' keyword and value
                            from the rule into the metadata structure for
                            filtering and reporting.
      -g, --ignore-filename
                            don't incorporate the 'filename' keyword (filename of
                            the rules file) into the metadata structure for
                            filtering and reporting.
      -m, --modify-metadata
                            modify the rule metadata keyword value on output to
                            contain the internally tracked and normalized metadata
                            data.
      -p PFMOD_FILE, --pfmod PFMOD_FILE, --pfmod-file PFMOD_FILE
                            YAML file of directives to apply actions on post-
                            filtered rules based on filter strings.
      -q, --quiet, --suppress_warnings
                            quiet; suppress warning logging
      -d, --debug           turn on debug logging

    A filter string defines the desired outcome based on Boolean logic, and uses
    the metadata key-value pairs as values in a (concrete) Boolean algebra.
    The key-value pair specifications must be surrounded by double quotes.
    Example:

    python3 aristotle/aristotle.py -r examples/example.rules --summary -n
    -f '(("priority high" AND "malware <ALL>") AND "created_at >= 2018-01-01")
    AND NOT ("protocols smtp" OR "protocols pop" OR "protocols imap") OR "sid 80181444"'

License
=======

Aristotle is licensed under the `Apache License, Version 2.0 <https://github.com/secureworks/aristotle/blob/master/LICENSE>`__.

Authors
=======

-  David Wharton

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/secureworks/aristotle",
    "name": "aristotle",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=2.7",
    "maintainer_email": null,
    "keywords": "suricata, snort, metadata, ruleset, BETTER, IDS, IPS, NIDS, signatures",
    "author": "David Wharton",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/45/8d/031116ed69f069e1d24338b21ed6ed1d607d68a4be22de19824dfadbb2f7/aristotle-2.1.0.tar.gz",
    "platform": null,
    "description": "=========\nAristotle\n=========\n\nAristotle is a simple Python program that allows for the filtering and modifying of\nSuricata and Snort rulesets based on interpreted key-value pairs present\nin the metadata keyword within each rule. It can be run as a standalone\nscript or utilized as a module.\n\n.. image:: docs/_static/aristotle.png\n\nDocumentation\n=============\n\n`<https://aristotle-py.readthedocs.io/>`__\n\nApplication Overview\n====================\n\nAristotle takes in a ruleset and can provide statistics on the included\nmetadata keys. If a filter string is provided, it will also be applied\nagainst the ruleset and the filtered ruleset outputted.\n\nAristotle also offers the ability to intelligently process rules to extract, enrich, and add\nmetadata to them.  After initial filtering, rules can additionally\nundergo \"Post Filter Modification\" which can modify them\nbased on user-defined criteria, to help ensure the resulting\nrules in the ruleset are enabled, configured, and optimized for the target environment.\n\nAristotle is compatible with Python 2.7 and Python 3.x.\n\n+------------------------------------------------------------------------------------+\n| In order for Aristotle to be most useful, it should be provided a ruleset that     |\n| has rules with the metadata keyword populated with appropriate key-value           |\n| pairs. Aristotle assumes that the provided ruleset conforms to the                 |\n| `BETTER Schema <https://better-schema.readthedocs.io/>`__.                         |\n+------------------------------------------------------------------------------------+\n\nSetup\n=====\n\nInstall dependencies:\n\n``pip install -r requirements.txt``\n\nOr if using as a module:\n\n``pip install aristotle``\n\nAnd refer to `Aristotle as a Module <https://aristotle-py.readthedocs.io/en/latest/module.html>`__.\n\nUsage\n=====\n\n.. code:: console\n\n    usage: aristotle.py [-h] -r RULES [-f METADATA_FILTER]\n                        [--summary [DISPLAY_MAX]] [-o OUTFILE]\n                        [-s [STATS [STATS ...]]] [-i] [-c] [-n] [-e] [-t] [-g]\n                        [-m] [-p PFMOD_FILE] [-q] [-d]\n\n    Filter Suricata and Snort rulesets based on metadata keyword values.\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -r RULES, --rules RULES, --ruleset RULES\n                            path to a rules file, a directory containing '.rules'\n                            file(s), or string containing the ruleset\n      -f METADATA_FILTER, --filter METADATA_FILTER\n                            Boolean filter string or path to a file containing it\n      --summary [DISPLAY_MAX]\n                            output a summary of the filtered ruleset to stdout,\n                            limited to DISPLAY_MAX number of lines (or 16 if no\n                            value given); if the option to output to a file is\n                            set, the full, filtered ruleset will still be written.\n      -o OUTFILE, --output OUTFILE\n                            output file to write filtered ruleset to\n      -s [STATS [STATS ...]], --stats [STATS [STATS ...]]\n                            display ruleset statistics about specified key(s). If\n                            no key(s) supplied, then summary statistics for all\n                            keys will be displayed.\n      -i, --enable-all-rules, --enable-all, --include-disabled\n                            enable all valid rules, including those\n                            disabled/commented out in the given rules file(s),\n                            when applying the filter\n      -c, --output-disabled-rules\n                            include disabled rules in the output as commented out\n                            lines.\n      -n, --normalize, --better, --iso8601\n                            try to convert date and cve related metadata values to\n                            conform to the BETTER schema for filtering and\n                            statistics. Dates are normalized to the format YYYY-\n                            MM-DD and CVEs to YYYY-<num>. Also, 'sid' is removed\n                            from the metadata.\n      -e, --enhance         enhance metadata by adding additional key-value pairs\n                            based on the rules.\n      -t, --ignore-classtype, --ignore-classtype-keyword\n                            don't incorporate the 'classtype' keyword and value\n                            from the rule into the metadata structure for\n                            filtering and reporting.\n      -g, --ignore-filename\n                            don't incorporate the 'filename' keyword (filename of\n                            the rules file) into the metadata structure for\n                            filtering and reporting.\n      -m, --modify-metadata\n                            modify the rule metadata keyword value on output to\n                            contain the internally tracked and normalized metadata\n                            data.\n      -p PFMOD_FILE, --pfmod PFMOD_FILE, --pfmod-file PFMOD_FILE\n                            YAML file of directives to apply actions on post-\n                            filtered rules based on filter strings.\n      -q, --quiet, --suppress_warnings\n                            quiet; suppress warning logging\n      -d, --debug           turn on debug logging\n\n    A filter string defines the desired outcome based on Boolean logic, and uses\n    the metadata key-value pairs as values in a (concrete) Boolean algebra.\n    The key-value pair specifications must be surrounded by double quotes.\n    Example:\n\n    python3 aristotle/aristotle.py -r examples/example.rules --summary -n\n    -f '((\"priority high\" AND \"malware <ALL>\") AND \"created_at >= 2018-01-01\")\n    AND NOT (\"protocols smtp\" OR \"protocols pop\" OR \"protocols imap\") OR \"sid 80181444\"'\n\nLicense\n=======\n\nAristotle is licensed under the `Apache License, Version 2.0 <https://github.com/secureworks/aristotle/blob/master/LICENSE>`__.\n\nAuthors\n=======\n\n-  David Wharton\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Script and library for the viewing, filtering, and modifying of Suricata and Snort rulesets based on interpreted key-value pairs present in the metadata keyword within each rule.",
    "version": "2.1.0",
    "project_urls": {
        "Documentation": "https://aristotle-py.readthedocs.io/",
        "Homepage": "https://github.com/secureworks/aristotle",
        "Source": "https://github.com/secureworks/aristotle"
    },
    "split_keywords": [
        "suricata",
        " snort",
        " metadata",
        " ruleset",
        " better",
        " ids",
        " ips",
        " nids",
        " signatures"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc122753cc2b0aa1e93c9741247b8567d96c80da4d7f1ab51d369d0957281851",
                "md5": "a18773ef47af3c712e0a231748891304",
                "sha256": "19b83ccd39c30f0c509340b16e2a6bdb5fbeeb052123e9f155fd16265c0c7891"
            },
            "downloads": -1,
            "filename": "aristotle-2.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a18773ef47af3c712e0a231748891304",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=2.7",
            "size": 28375,
            "upload_time": "2024-11-02T04:26:08",
            "upload_time_iso_8601": "2024-11-02T04:26:08.134053Z",
            "url": "https://files.pythonhosted.org/packages/bc/12/2753cc2b0aa1e93c9741247b8567d96c80da4d7f1ab51d369d0957281851/aristotle-2.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "458d031116ed69f069e1d24338b21ed6ed1d607d68a4be22de19824dfadbb2f7",
                "md5": "e7e7fcf6daf5be277dd19d2c270cc23e",
                "sha256": "d637bae94e3d85fd466be526cd823b1252ef96b80acdd9b8067ec5f0528826b8"
            },
            "downloads": -1,
            "filename": "aristotle-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e7e7fcf6daf5be277dd19d2c270cc23e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7",
            "size": 29097,
            "upload_time": "2024-11-02T04:26:09",
            "upload_time_iso_8601": "2024-11-02T04:26:09.535264Z",
            "url": "https://files.pythonhosted.org/packages/45/8d/031116ed69f069e1d24338b21ed6ed1d607d68a4be22de19824dfadbb2f7/aristotle-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-02 04:26:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "secureworks",
    "github_project": "aristotle",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "aristotle"
}
        
Elapsed time: 5.05390s