-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'white/staging' into white/master
- Loading branch information
Showing
40 changed files
with
2,558 additions
and
821 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* [MOD] Modify analytics type enum. #7615 | ||
* [ADD] Performance improved in `assets` views making several vulnerabilities stats statics in asset's model. #7634 | ||
* [FIX] Fix references. #7648 | ||
* [ADD] Now `custom fields` are available for filtering vulnerabilities. Also add `date` type for custom fields. #7625 | ||
* [MOD] We changed the order in which we set the path constant of `faraday_home` in order to fix a bug with faraday_manage when is installed by deb/rpm. #7653 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Feb 8th, 2024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
faraday/migrations/versions/257f6d0ad43f_add_fields_to_kb.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""add fields to KB | ||
Revision ID: 257f6d0ad43f | ||
Revises: b87b1de2f348 | ||
Create Date: 2023-11-10 21:47:36.973846+00:00 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '257f6d0ad43f' | ||
down_revision = 'b87b1de2f348' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.add_column('vulnerability_template', | ||
sa.Column('cve', sa.Text(), default='', server_default='', nullable=True)) | ||
op.add_column('vulnerability_template', | ||
sa.Column('_cvss2_vector_string', sa.Text(), default='', server_default='', nullable=True)) | ||
op.add_column('vulnerability_template', | ||
sa.Column('_cvss3_vector_string', sa.Text(), default='', server_default='', nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column('vulnerability_template', 'cve') | ||
op.drop_column('vulnerability_template', '_cvss2_vector_string') | ||
op.drop_column('vulnerability_template', '_cvss3_vector_string') |
37 changes: 37 additions & 0 deletions
37
faraday/migrations/versions/51e533d41312_add_host_stats_static_columns.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""Add host stats static columns | ||
Revision ID: 51e533d41312 | ||
Revises: 257f6d0ad43f | ||
Create Date: 2024-01-12 20:12:43.408035+00:00 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '51e533d41312' | ||
down_revision = '257f6d0ad43f' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('host', sa.Column('vulnerability_critical_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True)) | ||
op.add_column('host', sa.Column('vulnerability_high_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True)) | ||
op.add_column('host', sa.Column('vulnerability_medium_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True)) | ||
op.add_column('host', sa.Column('vulnerability_low_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True)) | ||
op.add_column('host', sa.Column('vulnerability_info_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True)) | ||
op.add_column('host', sa.Column('vulnerability_unclassified_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('host', 'vulnerability_unclassified_generic_count') | ||
op.drop_column('host', 'vulnerability_info_generic_count') | ||
op.drop_column('host', 'vulnerability_low_generic_count') | ||
op.drop_column('host', 'vulnerability_medium_generic_count') | ||
op.drop_column('host', 'vulnerability_high_generic_count') | ||
op.drop_column('host', 'vulnerability_critical_generic_count') | ||
# ### end Alembic commands ### |
87 changes: 87 additions & 0 deletions
87
faraday/migrations/versions/b87b1de2f348_add_delete_workspace_missing_cascades.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
"""add delete workspace missing cascades | ||
Revision ID: b87b1de2f348 | ||
Revises: d0a6105fdef1 | ||
Create Date: 2023-10-18 19:30:09.640602+00:00 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'b87b1de2f348' | ||
down_revision = 'd0a6105fdef1' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.execute('alter table workspace_permission_association drop constraint workspace_permission_association_workspace_id_fkey;') | ||
op.execute('alter table workspace_permission_association add constraint workspace_permission_association_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE;') | ||
op.execute('alter table severities_histogram drop constraint severities_histogram_workspace_id_fkey;') | ||
op.execute('alter table severities_histogram add constraint severities_histogram_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE;') | ||
op.execute('alter table reference drop constraint reference_workspace_id_fkey;') | ||
op.execute('alter table reference add constraint reference_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE;') | ||
op.execute('alter table policy_violation drop constraint policy_violation_workspace_id_fkey;') | ||
op.execute('alter table policy_violation add constraint policy_violation_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE;') | ||
op.execute('alter table command_object drop constraint command_object_workspace_id_fkey;') | ||
op.execute('alter table command_object add constraint command_object_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) ON DELETE CASCADE;') | ||
|
||
op.execute('alter table vulnerability_hit_count drop constraint vulnerability_hit_count_workspace_id_fkey;') | ||
op.execute('alter table vulnerability_hit_count add constraint vulnerability_hit_count_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) on delete CASCADE;') | ||
op.execute('alter table reference_vulnerability_association drop constraint reference_vulnerability_association_reference_id_fkey;') | ||
op.execute('alter table reference_vulnerability_association add constraint reference_vulnerability_association_reference_id_fkey FOREIGN KEY (reference_id) REFERENCES reference(id) on delete CASCADE;') | ||
op.execute('alter table websocket_notification drop constraint websocket_notification_id_fkey;') | ||
op.execute('alter table websocket_notification add constraint websocket_notification_id_fkey FOREIGN KEY (id) REFERENCES notification_base(id) on delete CASCADE;') | ||
op.execute('alter table notification_base drop constraint notification_base_notification_event_id_fkey;') | ||
op.execute('alter table notification_base add constraint notification_base_notification_event_id_fkey FOREIGN KEY (notification_event_id) REFERENCES notification_event(id) on delete CASCADE;') | ||
op.execute('alter table notification_event drop constraint notification_event_workspace_id_fkey;') | ||
op.execute('alter table notification_event add constraint notification_event_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) on delete CASCADE;') | ||
op.execute('alter table comment drop constraint comment_workspace_id_fkey;') | ||
op.execute('alter table comment add constraint comment_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) on delete CASCADE;') | ||
op.execute('alter table scope drop constraint scope_workspace_id_fkey;') | ||
op.execute('alter table scope add constraint scope_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) on delete CASCADE;') | ||
|
||
op.execute('alter table executive_report drop constraint executive_report_workspace_id_fkey;') | ||
op.execute('alter table executive_report add constraint executive_report_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) on delete CASCADE;') | ||
op.execute('alter table pipeline drop constraint pipeline_workspace_id_fkey;') | ||
op.execute('alter table pipeline add constraint pipeline_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) on delete SET NULL;') | ||
op.execute('alter table agents_schedule_workspace_table drop constraint agents_schedule_workspace_table_workspace_id_fkey;') | ||
op.execute('alter table agents_schedule_workspace_table add constraint agents_schedule_workspace_table_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id) on delete CASCADE;') | ||
|
||
|
||
# workspace_permission_association, policy_violation, websocket_notification | ||
|
||
|
||
def downgrade(): | ||
# perform downgrade of the previews actions | ||
op.execute('alter table workspace_permission_association drop constraint workspace_permission_association_workspace_id_fkey;') | ||
op.execute('alter table workspace_permission_association add constraint workspace_permission_association_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table severities_histogram drop constraint severities_histogram_workspace_id_fkey;') | ||
op.execute('alter table severities_histogram add constraint severities_histogram_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table reference drop constraint reference_workspace_id_fkey;') | ||
op.execute('alter table reference add constraint reference_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table policy_violation drop constraint policy_violation_workspace_id_fkey;') | ||
op.execute('alter table policy_violation add constraint policy_violation_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table command_object drop constraint command_object_workspace_id_fkey;') | ||
op.execute('alter table command_object add constraint command_object_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table vulnerability_hit_count drop constraint vulnerability_hit_count_workspace_id_fkey;') | ||
op.execute('alter table vulnerability_hit_count add constraint vulnerability_hit_count_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table reference_vulnerability_association drop constraint reference_vulnerability_association_reference_id_fkey;') | ||
op.execute('alter table reference_vulnerability_association add constraint reference_vulnerability_association_reference_id_fkey FOREIGN KEY (reference_id) REFERENCES reference(id);') | ||
op.execute('alter table websocket_notification drop constraint websocket_notification_id_fkey;') | ||
op.execute('alter table websocket_notification add constraint websocket_notification_id_fkey FOREIGN KEY (id) REFERENCES notification_base(id);') | ||
op.execute('alter table notification_base drop constraint notification_base_notification_event_id_fkey;') | ||
op.execute('alter table notification_base add constraint notification_base_notification_event_id_fkey FOREIGN KEY (notification_event_id) REFERENCES notification_event(id);') | ||
op.execute('alter table notification_event drop constraint notification_event_workspace_id_fkey;') | ||
op.execute('alter table notification_event add constraint notification_event_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table comment drop constraint comment_workspace_id_fkey;') | ||
op.execute('alter table comment add constraint comment_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table scope drop constraint scope_workspace_id_fkey;') | ||
op.execute('alter table scope add constraint scope_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table executive_report drop constraint executive_report_workspace_id_fkey;') | ||
op.execute('alter table executive_report add constraint executive_report_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table pipeline drop constraint pipeline_workspace_id_fkey;') | ||
op.execute('alter table pipeline add constraint pipeline_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') | ||
op.execute('alter table agents_schedule_workspace_table drop constraint agents_schedule_workspace_table_workspace_id_fkey;') | ||
op.execute('alter table agents_schedule_workspace_table add constraint agents_schedule_workspace_table_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspace(id);') |
26 changes: 26 additions & 0 deletions
26
faraday/migrations/versions/d0a6105fdef1_modify_analytics_type_enum.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""modify analytics type enum | ||
Revision ID: d0a6105fdef1 | ||
Revises: 443a136bb5f2 | ||
Create Date: 2023-11-14 20:48:56.645881+00:00 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'd0a6105fdef1' | ||
down_revision = '443a136bb5f2' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# add entry "vulnerabilities_by_risk_score" to enum "analytics_types" | ||
with op.get_context().autocommit_block(): | ||
op.execute("ALTER TYPE analytics_types ADD VALUE IF NOT EXISTS 'vulnerabilities_by_risk_score'") | ||
|
||
|
||
def downgrade(): | ||
# CANT REMOVE ENUM VALUES, NOT SUPPORTED BY POSTGRES | ||
pass |
Oops, something went wrong.