GithubHelp home page GithubHelp logo

sgordon46 / prismacloud-api-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paloaltonetworks/prismacloud-api-python

0.0 0.0 0.0 534 KB

Prisma Cloud utility scripts, and a Python SDK for Prisma Cloud APIs.

License: ISC License

Python 100.00%

prismacloud-api-python's Introduction

Python SDK for the Prisma Cloud APIs

This project includes a Python SDK for the Prisma Cloud APIs (CSPM, CWPP, and CCS) in the form of a Python package. It also includes reference scripts that utilize this SDK.

Major changes with Version 5.0:

  • Command-line argument and configuration file changes.

Table of Contents

Setup

Install the SDK via pip3:

pip3 install prismacloud-api

Please refer to PyPI for details.

Example Scripts

Please refer to this scripts directory for configuration, documentation, and usage.

If you prefer to use this SDK without using command-line options, consider these minimal examples:

Prisma Cloud Enterprise Edition

import os
from prismacloud.api import pc_api

# Settings for Prisma Cloud Enterprise Edition

settings = {
    "url":      "https://api.prismacloud.io/",
    "identity": "access_key",
    "secret":   "secret_key"
}

pc_api.configure(settings)

print('Prisma Cloud API Current User:')
print()
print(pc_api.current_user())
print()
print('Prisma Cloud Compute API Intelligence:')
print()
print(pc_api.statuses_intelligence())
print()

print('Prisma Cloud API Object:')
print()
print(pc_api)
print()

Prisma Cloud Compute Edition

import os
from prismacloud.api import pc_api

# Settings for Prisma Cloud Compute Edition

settings = {
    "url":      "https://console.example.com/",
    "identity": "username",
    "secret":   "password"
}

pc_api.configure(settings)

print('Prisma Cloud Compute API Intelligence:')
print()
print(pc_api.statuses_intelligence())
print()

print('Prisma Cloud API Object:')
print()
print(pc_api)
print()

Settings can also be defined as environment variables:

Environment Variables

settings = {
    "url":      os.environ.get('PC_URL'),
    "identity": os.environ.get('PC_IDENTITY'),
    "secret":   os.environ.get('PC_SECRET')
}

Support

This project has been developed by members of the Prisma Cloud CS and SE teams, it is not Supported by Palo Alto Networks. Nevertheless, the maintainers will make a best-effort to address issues, and (of course) contributors are encouraged to submit issues and pull requests.

prismacloud-api-python's People

Contributors

aneeshboreda avatar cfarquhar avatar hubbaj1 avatar jdrieger avatar jtb75 avatar lsmithpanw avatar moonman81 avatar pgunabal avatar sgordon46 avatar simonpanw avatar sullivan1337 avatar timekillerj avatar tkishel avatar turbodog avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.