Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _serverless.py to get serverless vulnerability information #165

Open
ipalvr opened this issue Feb 11, 2024 · 2 comments
Open

Add _serverless.py to get serverless vulnerability information #165

ipalvr opened this issue Feb 11, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ipalvr
Copy link
Contributor

ipalvr commented Feb 11, 2024

Is your feature request related to a problem?

I have a customer who is automating serverless vulnerability reporting and they would like to leverage a script like the one we have for hosts. Here is the path to the hosts example. prismacloud-api-python/prismacloud/api/cwpp/_hosts.py

Describe the solution you'd like

Support for serverless vulnerability reporting.

Describe alternatives you've considered

No alternatives at this point

Additional context

Customer is unable to leverage the api to automate vulnerability reporting like they do for hosts and containers.

@ipalvr ipalvr added the enhancement New feature or request label Feb 11, 2024
@tgorman1000
Copy link

tgorman1000 commented Feb 12, 2024

Create a new file. File name: _serverless.py. Store this file in prismacloud-api-python/prismacloud/api/cwpp

# Serverless
 class ServerlessPrismaCloudAPICWPPMixin:

    """ Prisma Cloud Compute Serverless Endpoints Class """

    # Get serverless function scan results
    def serverless_list_read(self, query_params=None):
        result = self.execute_compute('GET', 'api/v1/serverless', query_params=query_params, paginated=True)
        return result 

    # Download serverless function scan results   
    def serverless_download(self, query_params=None):
        result = self.execute_compute('GET', 'api/v1/serverless/download?', query_params=query_params)
        return result

    # Start serverless function scan
    def serverless_start_scan(self):
        result = self.execute_compute('POST', 'api/v1/serverless/scan')
        return result

    # Stop serverless function scan
    def serverless_stop_scan(self):
        result = self.execute_compute('POST', 'api/v1/serverless/stop')
        return result

@tgorman1000
Copy link

Add the following to the prismacloud-api-python/prismacloud/api/cwpp/init.py file:

from ._serverless import *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants