Skip to main content

SDK to download the Netskope Events

Project description

Netskope SDK

Neskope SDK is Python library for dealing with API's to download the Netskope events.

Installation

Use the package manager pip to install NetskopeSDK.

pip install netskopesdk

Rest sdk Usage to pull the Alert & Events

from netskope_api.iterator.netskope_iterator import NetskopeIterator
from netskope_api.iterator.const import Const
from requests.exceptions import RequestException
import time

# Construct the params dict to pass the authentication details 
params = {
        Const.NSKP_TOKEN : "<REST-API-TOKEN>",
        Const.NSKP_TENANT_HOSTNAME : "<HOSTNAME>",
        # Optional param to pass the proxy hosts.
        Const.NSKP_PROXIES : {"<PROXY-HOSTS>"},
        Const.NSKP_EVENT_TYPE : "<EVENT-TYPE>",
        Const.NSKP_ITERATOR_NAME : "<ITERATOR-NAME>",
        Const.NSKP_USER_AGENT : "<SPLUNK-TENANT-HOSTNAME>",
    }

DEFAULT_WAIT_TIME = 30
RESULT = "result"
WAIT_TIME = "wait_time"

# Create an Iterator
iterator = NetskopeIterator(params)

# Use the next() iterator to download the logs. 
# Consume the message indefinitely in a loop and ingest the data to SIEM
while True:
    response = (iterator.next())
    try:
        if response:
            data = response.json()
            if RESULT in data and len(data[RESULT]) != 0:
                # processData() 
                # sleep() the thread to avoid constant polling
                if WAIT_TIME in data:
                    time.sleep(data[WAIT_TIME])
                else:
                    time.sleep(DEFAULT_WAIT_TIME)
            else:
                print("No response received from the iterator")
                time.sleep(DEFAULT_WAIT_TIME)
    except Exception as e:
        time.sleep(DEFAULT_WAIT_TIME)
        raise RequestException(e)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netskopesdk-0.0.22.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

netskopesdk-0.0.22-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file netskopesdk-0.0.22.tar.gz.

File metadata

  • Download URL: netskopesdk-0.0.22.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for netskopesdk-0.0.22.tar.gz
Algorithm Hash digest
SHA256 00adb18cb8ca4c93100965a7158259cae8565bd7ab0e6ebf0f172d75dbb268cd
MD5 131df19e335d3fdae25f35bfce1f303b
BLAKE2b-256 cb347a0debe7db033282586bb7941be31de805436d15b60446ba98845ea06fb1

See more details on using hashes here.

Provenance

File details

Details for the file netskopesdk-0.0.22-py3-none-any.whl.

File metadata

  • Download URL: netskopesdk-0.0.22-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for netskopesdk-0.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 89663002bdeb4de7552b1bc846bb60c5301322abfd30872fff0b8dbc633abd24
MD5 d92c15934c69e8780bcc6b89a0201a01
BLAKE2b-256 af5f1692ece06eb41a68dccbf482b93fdbe8cfd0fa051c203e6b72a6e34d2345

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page