Files
falco/integrations/kubernetes-response-engine/playbooks/phantom.py
Néstor Salceda 8d60d374f7 Add an integration with Phantom (#411)
* Add a Phantom Client which creates containers in Phantom server

* Add a playbook for creating events in Phantom using a Falco alert

* Add a flag for configuring SSL checking

* Add a deployable playbook with Kubeless for integrating with Phantom

* Add a README for Phantom integration

* Use named argument as real parameters.

Just cosmetic for clarification

* Call to lower() before checking for case insensitive comparison

* Add the playbook which creates a container in Phantom

I lose it when rebase the branch :P
2018-10-15 13:37:37 -07:00

26 lines
573 B
Python

import sys
import os.path
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__))))
import os
import playbooks
from playbooks import infrastructure
def _to_bool(value):
return value.lower() in ('yes', 'true', '1')
playbook = playbooks.CreateContainerInPhantom(
infrastructure.PhantomClient(
os.environ['PHANTOM_USER'],
os.environ['PHANTOM_PASSWORD'],
os.environ['PHANTOM_BASE_URL'],
verify_ssl=_to_bool(os.environ.get('VERIFY_SSL', 'True'))
)
)
def handler(event, context):
playbook.run(event['data'])