Skip to content

Commit

Permalink
Merge branch 'white/staging' into white/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Nadares committed Sep 6, 2023
2 parents 36166e9 + 158715a commit 7ac1651
Show file tree
Hide file tree
Showing 19 changed files with 963 additions and 676 deletions.
4 changes: 2 additions & 2 deletions .gitlab/ci/testing/.pretesting-gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ bandit:
- mkdir /results
- "bandit -r ${CI_PROJECT_DIR}/faraday -o /results/output.xml -f xml --skip B101"
after_script:
- curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
- wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
- apt update
- apt-get install software-properties-common -y
- apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com focal main"
- echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list
- apt update
- apt install vault -y
- setcap cap_ipc_lock= /usr/bin/vault
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG/4.6.0/community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [FIX] Delete Cascade from KB. #7569
1 change: 1 addition & 0 deletions CHANGELOG/4.6.0/date.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sep 6th, 2023
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
New features in the latest update
=====================================

4.6.0 [Sep 6th, 2023]:
---
* [FIX] Delete Cascade from KB. #7569

4.5.1 [Jul 15th, 2023]:
---
* [FIX] Fix pillow version to 9.4.0. #7531
Expand Down
2 changes: 1 addition & 1 deletion faraday/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
See the file 'doc/LICENSE' for the license information
"""

__version__ = '4.5.1'
__version__ = '4.6.0'
__license_version__ = __version__
135 changes: 135 additions & 0 deletions faraday/migrations/versions/61ded0c8fbf6_notification_center.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
"""notification center
Revision ID: 61ded0c8fbf6
Revises: f20aa8756612
Create Date: 2023-01-11 19:24:20.511853+00:00
"""
from alembic import op
import sqlalchemy as sa

import faraday

# revision identifiers, used by Alembic.
revision = '61ded0c8fbf6'
down_revision = 'dd3181b9b3e9'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('base_notification',
sa.Column('create_date', sa.DateTime(), nullable=True),
sa.Column('update_date', sa.DateTime(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('data', faraday.server.fields.JSONType(), nullable=False),
sa.Column('processed', sa.Boolean(), nullable=True),
sa.Column('creator_id', sa.Integer(), nullable=True),
sa.Column('update_user_id', sa.Integer(), nullable=True),
sa.Column('verbose', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['creator_id'], ['faraday_user.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['update_user_id'], ['faraday_user.id'], ondelete='SET NULL'),
sa.PrimaryKeyConstraint('id')
)
op.create_table('user_notification',
sa.Column('create_date', sa.DateTime(), nullable=True),
sa.Column('update_date', sa.DateTime(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('message', sa.Text(), nullable=False),
sa.Column('extra_data', faraday.server.fields.JSONType(), nullable=True),
sa.Column('type', sa.String(), nullable=False),
sa.Column('subtype', sa.String(), nullable=False),
sa.Column('read', sa.Boolean(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('creator_id', sa.Integer(), nullable=True),
sa.Column('update_user_id', sa.Integer(), nullable=True),
sa.Column('triggered_by', faraday.server.fields.JSONType(), nullable=False),
sa.Column('links_to', faraday.server.fields.JSONType(), nullable=True),
sa.Column('event_date', sa.DateTime(), nullable=False),
sa.ForeignKeyConstraint(['creator_id'], ['faraday_user.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['update_user_id'], ['faraday_user.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['user_id'], ['faraday_user.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_user_notification_user_id'), 'user_notification', ['user_id'], unique=False)
op.create_table('user_notification_settings',
sa.Column('create_date', sa.DateTime(), nullable=True),
sa.Column('update_date', sa.DateTime(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('paused', sa.Boolean(), nullable=False),
sa.Column('slack_id', sa.String(), nullable=True),
sa.Column('no_self_notify', sa.Boolean(), nullable=False),
sa.Column('agents_enabled', sa.Boolean(), nullable=False),
sa.Column('agents_app', sa.Boolean(), nullable=False),
sa.Column('agents_email', sa.Boolean(), nullable=False),
sa.Column('agents_slack', sa.Boolean(), nullable=False),
sa.Column('cli_enabled', sa.Boolean(), nullable=False),
sa.Column('cli_app', sa.Boolean(), nullable=False),
sa.Column('cli_email', sa.Boolean(), nullable=False),
sa.Column('cli_slack', sa.Boolean(), nullable=False),
sa.Column('comments_enabled', sa.Boolean(), nullable=False),
sa.Column('comments_app', sa.Boolean(), nullable=False),
sa.Column('comments_email', sa.Boolean(), nullable=False),
sa.Column('comments_slack', sa.Boolean(), nullable=False),
sa.Column('hosts_enabled', sa.Boolean(), nullable=False),
sa.Column('hosts_app', sa.Boolean(), nullable=False),
sa.Column('hosts_email', sa.Boolean(), nullable=False),
sa.Column('hosts_slack', sa.Boolean(), nullable=False),
sa.Column('users_enabled', sa.Boolean(), nullable=False),
sa.Column('users_app', sa.Boolean(), nullable=False),
sa.Column('users_email', sa.Boolean(), nullable=False),
sa.Column('users_slack', sa.Boolean(), nullable=False),
sa.Column('reports_enabled', sa.Boolean(), nullable=False),
sa.Column('reports_app', sa.Boolean(), nullable=False),
sa.Column('reports_email', sa.Boolean(), nullable=False),
sa.Column('reports_slack', sa.Boolean(), nullable=False),
sa.Column('vulnerabilities_enabled', sa.Boolean(), nullable=False),
sa.Column('vulnerabilities_app', sa.Boolean(), nullable=False),
sa.Column('vulnerabilities_email', sa.Boolean(), nullable=False),
sa.Column('vulnerabilities_slack', sa.Boolean(), nullable=False),
sa.Column('workspaces_enabled', sa.Boolean(), nullable=False),
sa.Column('workspaces_app', sa.Boolean(), nullable=False),
sa.Column('workspaces_email', sa.Boolean(), nullable=False),
sa.Column('workspaces_slack', sa.Boolean(), nullable=False),
sa.Column('pipelines_enabled', sa.Boolean(), nullable=False),
sa.Column('pipelines_app', sa.Boolean(), nullable=False),
sa.Column('pipelines_email', sa.Boolean(), nullable=False),
sa.Column('pipelines_slack', sa.Boolean(), nullable=False),
sa.Column('executive_reports_enabled', sa.Boolean(), nullable=False),
sa.Column('executive_reports_app', sa.Boolean(), nullable=False),
sa.Column('executive_reports_email', sa.Boolean(), nullable=False),
sa.Column('executive_reports_slack', sa.Boolean(), nullable=False),
sa.Column('planner_enabled', sa.Boolean(), nullable=False),
sa.Column('planner_app', sa.Boolean(), nullable=False),
sa.Column('planner_email', sa.Boolean(), nullable=False),
sa.Column('planner_slack', sa.Boolean(), nullable=False),
sa.Column('integrations_enabled', sa.Boolean(), nullable=False),
sa.Column('integrations_app', sa.Boolean(), nullable=False),
sa.Column('integrations_email', sa.Boolean(), nullable=False),
sa.Column('integrations_slack', sa.Boolean(), nullable=False),
sa.Column('other_enabled', sa.Boolean(), nullable=False),
sa.Column('other_app', sa.Boolean(), nullable=False),
sa.Column('other_email', sa.Boolean(), nullable=False),
sa.Column('other_slack', sa.Boolean(), nullable=False),
sa.Column('adv_high_crit_vuln', sa.Boolean(), nullable=False),
sa.Column('adv_risk_score_threshold', sa.Integer(), nullable=False),
sa.Column('adv_vuln_open_days', sa.Integer(), nullable=False),
sa.Column('creator_id', sa.Integer(), nullable=True),
sa.Column('update_user_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['creator_id'], ['faraday_user.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['update_user_id'], ['faraday_user.id'], ondelete='SET NULL'),
sa.ForeignKeyConstraint(['user_id'], ['faraday_user.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('user_notification_settings')
op.drop_index(op.f('ix_user_notification_user_id'), table_name='user_notification')
op.drop_table('user_notification')
op.drop_table('base_notification')
# ### end Alembic commands ###
31 changes: 31 additions & 0 deletions faraday/migrations/versions/73854f804a8d_cascade_kb_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""cascade KB 2
Revision ID: 73854f804a8d
Revises: 61ded0c8fbf6
Create Date: 2023-08-31 17:16:51.813227+00:00
"""
from alembic import op


# revision identifiers, used by Alembic.
revision = '73854f804a8d'
down_revision = '61ded0c8fbf6'
branch_labels = None
depends_on = None


def upgrade():
op.execute('ALTER TABLE policy_violation_template_vulnerability_association DROP CONSTRAINT policy_violation_template_vulnerability_a_vulnerability_id_fkey')
op.execute('ALTER TABLE policy_violation_template_vulnerability_association ADD CONSTRAINT policy_violation_template_vulnerability_a_vulnerability_id_fkey FOREIGN KEY (vulnerability_id) REFERENCES vulnerability_template (id) ON DELETE CASCADE')

op.execute('ALTER TABLE reference_template_vulnerability_association DROP CONSTRAINT reference_template_vulnerability_associat_vulnerability_id_fkey')
op.execute('ALTER TABLE reference_template_vulnerability_association ADD CONSTRAINT reference_template_vulnerability_associat_vulnerability_id_fkey FOREIGN KEY (vulnerability_id) REFERENCES vulnerability_template (id) ON DELETE CASCADE')


def downgrade():
op.execute('ALTER TABLE policy_violation_template_vulnerability_association DROP CONSTRAINT policy_violation_template_vulnerability_a_vulnerability_id_fkey')
op.execute('ALTER TABLE policy_violation_template_vulnerability_association ADD CONSTRAINT policy_violation_template_vulnerability_a_vulnerability_id_fkey FOREIGN KEY (vulnerability_id) REFERENCES vulnerability_template (id)')

op.execute('ALTER TABLE reference_template_vulnerability_association DROP CONSTRAINT reference_template_vulnerability_associat_vulnerability_id_fkey')
op.execute('ALTER TABLE reference_template_vulnerability_association ADD CONSTRAINT reference_template_vulnerability_associat_vulnerability_id_fkey FOREIGN KEY (vulnerability_id) REFERENCES vulnerability_template (id)')
Loading

0 comments on commit 7ac1651

Please sign in to comment.