Víctor Fernández Poyatos 4371ad1535 feat/PRWLR-3999 Implement providers endpoints (#21)
* feat(Backend): PRWLR-3989 add RLS to postgresql db and base models

* feat(API): PRWLR-3989 add TenantMiddleware

* chore(API, Backend): PRWLR-3989 create new db user without RLS bypass on migrations

* chore(Backend): PRWLR-3989 fix RLS bypasser for POST requests

* fix(Backend): PRWLR-3989 fix user permissions when migrating new models

* chore(Backend): PRWLR-3989 add testing view for RLS manual tests

* feat(API): PRWLR-3989 add tenant_id to API logging

* chore(API, Backend): PRWLR-3989 add TODOs

* test(API): PRWLR-3989 add new middleware unit tests

* chore(API): PRWLR-3989 refactor RLS code

* fix(tests): PRWLR-3989 fix testing db connector

* chore: PRWLR-3989 add references to JIRA tickets

* fix: PRWLR-3989 remove bypass logic and fix serializers

* fix: PRWLR-3989 improve drop SQL query for RLS models

* feat(Backend): PRWLR-3989 add specific permissions on each model

* fix(Backend): PRWLR-3989 fix database routing and grant select perms

* fix(test): PRWLR-3989 fix routing issues with unit tests

* chore: PRWLR-3989 remove references to JIRA tickets

* feat(Backend): PRWLR-3999 add Provider model

* feat: PRWLR-3999 add providers view logic

* fix: PRWLR-3999 fix unique index fields

* feat(API): PRWLR-3999 add custom exception handlers

* feat(API): PRWLR-3999 add /providers/{provider_id}/connection endpoint

* test(API): PRWLR-3999 add base unit tests for providers

* fix(API, Backend): PRWLR-3999 fix bugs after rebase

* chore(API, docker): PRWLR-3999 add dev feats for demo

* feat(API): PRWLR-3999 add drf-spectacular-jsonapi and improve docs

* test(API): PRWLR-3999 add providers unit tests

* chore(Backend): PRWLR-3989 adjust privileges for user on table tenant

* chore: PRWLR-3999 rename model custom validation error

* chore: PRWLR-3999 remove Test references

* chore: PRWLR-3999 update API v1 spec

* fix: PRWLR-3999 apply requested changes to filter and models

* feat: PRWLR-3999 add validation to PATCH /providers payload

* fix: PRWLR-3999 fix providers enum description

* chore: add more providers fixtures

* fix: PRWLR-3999 make providers.alias optional
2024-08-06 12:39:08 -04:00
2024-07-01 10:42:55 -04:00

Prowler SaaS and Prowler Open Source are as dynamic and adaptable as the environment theyre meant to protect. Trusted by the leaders in security.

Learn more at prowler.com

Prowler community on Slack
Join our Prowler community!

Description

Prowler is an Open Source security tool to perform AWS, Azure, Google Cloud and Kubernetes security best practices assessments, audits, incident response, continuous monitoring, hardening and forensics readiness, and also remediations! We have Prowler CLI (Command Line Interface) that we call Prowler Open Source and a service on top of it that we call Prowler SaaS.

This repository contains the REST API and Task Runner components for Prowler, which facilitate a complete backend that interacts with the Prowler SDK and is used by the Prowler UI.

Production deployment

Install all dependencies with Poetry

poetry install
poetry shell

Run the Django server with Gunicorn

cd src/backend
gunicorn -c backend/guniconf.py backend.wsgi:application

By default, the Gunicorn server will try to use as many workers as your machine can handle. You can manually change that in the src/backend/backend/guniconf.py file.

💻 Development guide

Local deployment

This method requires installing a Python virtual environment and keep dependencies updated.

Clone the repository

# HTTPS
git clone https://github.com/prowler-cloud/restful-api.git

# SSH
git clone git@github.com:prowler-cloud/restful-api.git

Install the Python dependencies

You must have Poetry installed

poetry install
poetry shell

Run the Django development server

cd backend
python manage.py runserver

You can access the server in http://localhost:8000. All changes in the code will be automatically reloaded in the server.

Docker deployment

This method requires docker and docker compose.

Clone the repository

# HTTPS
git clone https://github.com/prowler-cloud/restful-api.git

# SSH
git clone git@github.com:prowler-cloud/restful-api.git

Build the base image

docker compose --profile dev build

Run the development service

docker compose --profile dev up

You can access the server in http://localhost:8080. All changes in the code will be automatically reloaded in the server.

NOTE: notice how the port is different. When developing using docker, the port will be 8080 to prevent conflicts.

S
Description
Prowler is an Open Source Security tool for AWS, Azure, GCP and Kubernetes to do security assessments, audits, incident response, compliance, continuous monitoring, hardening and forensics readiness. Includes CIS, NIST 800, NIST CSF, CISA, FedRAMP, PCI-DSS, GDPR, HIPAA, FFIEC, SOC2, GXP, Well-Architected Security, ENS and more
Readme Apache-2.0 342 MiB
Languages
Python 83.4%
TypeScript 15.9%
Shell 0.3%
HCL 0.2%