Skip to content

Commit

Permalink
add enfocement rules endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
SimOnPanw committed Jul 3, 2024
1 parent a0400fc commit cacd64f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,27 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install -r requirements.txt
pip install build
- name: Test API
run: |
pylint prismacloud/api
- name: Test Scripts
run: |
python -m build
pip install dist/prismacloud_api-*
# pip install dist/prismacloud_api-*
pip install dist/prismacloud_api-*.whl # Only install the wheel file
pip install -r scripts/requirements.txt
pylint scripts/*.py
1 change: 1 addition & 0 deletions prismacloud/api/pccs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ._errors import *
from ._fixes import *
from ._repositories import *
from ._rules import *
from ._scans import *
from ._suppressions import *
from ._packages import *
Expand Down
18 changes: 18 additions & 0 deletions prismacloud/api/pccs/_rules.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
""" Prisma Cloud Code Security enforcement-rules Endpoints Class """

# enforcement-rules

class SuppressionsPrismaCloudAPIPCCSMixin:
""" Prisma Cloud Code Security API Suppressions Endpoints Class """

def enforcement_rules_read(self):
return self.execute_code_security('GET', 'code/api/v1/enforcement-rules')

def enforcement_rules_update(self, rules):
return self.execute_code_security('PUT', 'code/api/v1/enforcement-rules', body_params=rules)

def enforcement_rules_exception_create(self, policy_id, rule):
return self.execute_code_security('POST', 'code/api/v1/enforcement-rules', body_params=rule)

def enforcement_rules_exception_delete(self, rule_id):
return self.execute_code_security('DELETE', 'code/api/v1/enforcement-rules/%s' % (rule_id))
2 changes: 1 addition & 1 deletion prismacloud/api/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "5.2.22"
version = "5.2.23"

0 comments on commit cacd64f

Please sign in to comment.