Home

Awesome

Phantasm

Phantasm is a library that has been developed for programmatic testing of Splunk Phantom playbooks. In doing so allowing for test-driven development as users develop playbooks.

It relies on the Django based REST API in Splunk Phantom to create containers, artifacts, upload files, run playbooks, run individual app actions, promote/demote a case to a container, delete a container and more. It returns the JSON response from each action, allowing the fields to be used in pytest.

Refer to demo.py to showcase the basic functionality of the library, or test_example.py file for a basic example that uses pytest to validate.

Configuration

Ensure you provide a valid ph-auth-token and phantom-url in the config.ini file.

Supported Functions

Each function is documented for further information:

    # Get information relating to the object, including classes
    print('{}').format(phantasm.__doc__)
    print(help(phantasm))

    # Get information relating to an individual function
    print('{}').format(phantasm.create_container.__doc__)
    print(help(phantasm.create_container))

Container Functions:

Artifact Functions:

Playbook Functions:

Changelog: