* feat(Findings): initial findings model
* fix(Findings): add view, serializers, migration for enums
* fix(Findings): incomplete jsonb_to_tsvector wrapper
will not run as written
* fix(Findings): use Severity and Status enums from prowler SDK
* tests(Findings): add failing view tests
* fix(Finding): add resource relationship
not returning correct data from serializer, missing links
* fix(FindingSerializer): get Scan & Resource relationships to show up
* fix(FindingFilter): add more filter fields
* fix(FindingFilter): filter on provider id
* fix(FindingSerializer): return Resource in relationship
not ResourceFindingMapping
* fix(FindingModel): update migration
* fix(FindingFilter): full text search on findings
* fix(Resources): include Findings in ResourceSerializer
* fix(FindingFilter): expand text search columns
* fix(DbUtils): docstring, not comment
* fix(BaseViews): remove TODO
comment not applicable right now
* fix(Fixtures): add more findings to fixture file
and change on_delete behavior for resource_finding_mapping
* fix(Resources): rename index to match others
* fix(Findings): update Findigns RLS to allow for full CRUD
eventually we'll let users enter a manual finding
which implies INSERT, UPDATE, DELETE
* fix(Findings): use TextChoices directly for Status enum
* fix(FindingSerializer): build a set instead of a list
* consistency in fixtures
Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>
* fix(API): update v1 spec for findings
* feat(Findings): store findings in a partitioned table
* fix(Settings): change unit of partition max age
to match unit when creating
* docs(Partitions): document how to manage partitions via manage.py
* fix(Findings): add tag for spec/docs
* fix(Findings): clean up migrations
* fix(Findings): convert scan_id and inserted_at filters into finding.id filters
* fix(Findings): add default filter for today
and set default sort order
* fix(Findings): add default filter for today
and set default sort order
* fix(Findings): update fixtures so datetime matches id
* fix(Findings): partition the ResourceFindingMapping table to match Findings
* docs(Partitions): document postgres config values more
* docs(UUIDUtils): do not use raw query strigns (typo)
* docs(Partitions): change unit in comment description
* fix(Findings): change resource_name & tags to be Finding
* docs(Partitions): change unit in partitions settings docstring
* fix(Findings): remove conflicting logic & filters
* chore: apply suggested changes
* chore: optimize imports
---------
Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>
* feat(Findings): initial findings model
* fix(Findings): add view, serializers, migration for enums
* fix(Findings): incomplete jsonb_to_tsvector wrapper
will not run as written
* fix(Findings): use Severity and Status enums from prowler SDK
* tests(Findings): add failing view tests
* fix(Finding): add resource relationship
not returning correct data from serializer, missing links
* fix(FindingSerializer): get Scan & Resource relationships to show up
* fix(FindingFilter): add more filter fields
* fix(FindingFilter): filter on provider id
* fix(FindingSerializer): return Resource in relationship
not ResourceFindingMapping
* fix(FindingModel): update migration
* fix(FindingFilter): full text search on findings
* fix(Resources): include Findings in ResourceSerializer
* fix(FindingFilter): expand text search columns
* fix(DbUtils): docstring, not comment
* fix(BaseViews): remove TODO
comment not applicable right now
* fix(Fixtures): add more findings to fixture file
and change on_delete behavior for resource_finding_mapping
* fix(Resources): rename index to match others
* fix(Findings): update Findigns RLS to allow for full CRUD
eventually we'll let users enter a manual finding
which implies INSERT, UPDATE, DELETE
* fix(Findings): use TextChoices directly for Status enum
* fix(FindingSerializer): build a set instead of a list
* consistency in fixtures
Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>
* fix(API): update v1 spec for findings
---------
Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>
* fix(Resources): add basic Resource MVC
* fix(Resources): implement many-to-many tags via through table
* fix(Resources): tsvector & migration
migration needs work, need to create a custom
django migration field to build the GENERATED ALWAYS
column.
Without it, django will complain about the ts column
not exisiting when we try to create an index.
* test(Resources): add tests for /resources views
* fix(Resources): get basic test cases to pass
need to work on tsvector column
and filtering by provider columns like alias, name
* fix(Resources): provide way to get tags as dict
not a list of ResourceTag models
* fix(Resources): annotate with return type
* fix(Resources): rename search field to not conflict with filters
* fix(Resources): filter by provider.id
* fix(Resources): remove filter and sort by provider
must use provider_id first
* fix(Resources): test adding, clearing tags
* fix(Scans): filter by provider_id
* fix(Resources): remove FIXME comments
* fix(Resources): filter and search on tags
* fix(Resources): full text search
* fix(Resources): full text search to include both resources and tags
and get rid of the distinct() query
* fix(Resources): document text search a bit more
* fix(Resources): remove TODO comments
* fix(Resources): move Resource migrations into 0001_initital
* fix(Config): revert to match main
* fix(Resources): use Django's default query builder for full text search
* Apply suggestions from code review
Mostly formatting changes
Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>
* fix(Resources): just use text search
instead of guessing at allowed split characters for each provider
* fix(Resources): remove unused tests
these cases are covered in parameterized lists
* fix(Resources): set a read-only RLS policy
* fix(Resources): rename add_tags to be upsert_or_delete_tags
* fix(Resources): include primary key on through table
django query builder doesn't like tables without primary keys
* fix(Resources): default xx_at filters to date
instead of date time
* docs(Resources): describe what a Resource is
in API docs
* chore(Resources): rename file to match others
---------
Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>
* chore(API): PRWLR-4775 change inserted and updated at filters to filter by date by default
* test(API): PRWLR-4775 replace datetime strings for date
* feat(API): PRWLR-4775 update started_at default behavior and unit tests
* chore(deps): PRWLR-4014 include prowler library in python deps
* feat(Backend,API): PRWLR-4014 add AWS provider test_connection through celery tasks
* fix(Backend,API): PRWLR-4014 fix model handling in celery tasks
* test(Tasks): PRWLR-4014 add unit tests for celery tasks
* docs(API): PRWLR-4014 update endpoint tag
* feat(Backend): PRWLR-4014 add decorator for tenant dependant Celery tasks
* chore(Backend): PRWLR-4014 remove TODOs and improve docstrings
* feat(Backend): PRWLR-4014 replace timezone.now for datetime.now(timezone.utc)
* feat(Backend): PRWLR-4014 use SET LOCAL for api.tenant_id setting
* feat(Backend, Tasks): PRWLR-4014 refactor tasks module to abstract business logic
* fix(Backend): PRWLR-4014 use set_config for RLS config and set transaction at request dispatch level
* fix(Tasks): PRWLR-4014 fix tasks tenant decorator
* feat(API): PRWLR-4368 remove TenantMiddleware in favour of transaction based setup
* feat(API): PRWLR-4368 override initial request method to perform atomic transactions on RLS viewsets
* 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
* chore(Backend): PRWLR-3989 adjust privileges for user on table tenant
* chore: PRWLR-3989 add comments on migrations