Skip to content

Commit

Permalink
Merge branch 'white/dev' into white/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Nadares committed Jul 7, 2023
2 parents fad1fff + f4aa5f1 commit b421657
Show file tree
Hide file tree
Showing 87 changed files with 1,481 additions and 2,622 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,9 @@ _install
faraday_plugins/
faraday/frontend/
.cache

## OSX files
.DS_Store

# nix build
result
12 changes: 3 additions & 9 deletions .gitlab/ci/build-ci/.prebuild-gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,11 @@ generate_build_file_master:
artifacts: true

build_nix_python3_dev:
image: nixos/nix:2.3.10
image: nixos/nix:2.16.0
stage: pre_build
tags:
- digitalocean-dev
script:
- apk update
- apk add git bash tar
- nix-env -if pynixify/nixpkgs.nix -A cachix gnugrep
- nix-env -if pynixify/nixpkgs.nix -A vault
- !reference [ .get_secrets, script ]
Expand Down Expand Up @@ -116,13 +114,11 @@ build_nix_python3_dev:
artifacts: true

build_nix_python3_staging:
image: nixos/nix:2.3.10
image: nixos/nix:2.16.0
stage: pre_build
tags:
- digitalocean-dev
script:
- apk update
- apk add git bash tar
- nix-env -if pynixify/nixpkgs.nix -A cachix gnugrep
- nix-env -if pynixify/nixpkgs.nix -A vault
- !reference [ .get_secrets, script ]
Expand Down Expand Up @@ -152,13 +148,11 @@ build_nix_python3_staging:
artifacts: true

build_nix_python3_master:
image: nixos/nix:2.3.10
image: nixos/nix:2.16.0
stage: pre_build
tags:
- digitalocean-dev
script:
- apk update
- apk add git bash tar
- nix-env -if pynixify/nixpkgs.nix -A cachix gnugrep
- nix-env -if pynixify/nixpkgs.nix -A vault
- !reference [ .get_secrets, script ]
Expand Down
4 changes: 1 addition & 3 deletions .gitlab/ci/testing/.hypothesis-nix-gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
test_hypothesis:
tags:
- hypothesis
image: nixos/nix:2.3.10
image: nixos/nix:2.16.0
stage: test
allow_failure: true
script:
- apk update
- apk add git bash
- nix-env -if pynixify/nixpkgs.nix -A vault
- !reference [ .get_secrets, script ]
- nix-env -if pynixify/nixpkgs.nix -A cachix
Expand Down
12 changes: 3 additions & 9 deletions .gitlab/ci/testing/.nix-testing-gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
pylint:
tags:
- faradaytests
image: nixos/nix:2.3.10
image: nixos/nix:2.16.0
stage: test # This should be after build_and_push_to_cachix to improve performance
script:
- apk update
- apk add git bash
- nix-env -if pynixify/nixpkgs.nix -A vault
- !reference [ .get_secrets, script ]
- nix-env -if pynixify/nixpkgs.nix -A cachix
Expand Down Expand Up @@ -34,8 +32,6 @@ pylint:
stage: test
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
script:
- apk update
- apk add git bash
- nix-env -if pynixify/nixpkgs.nix -A vault
- !reference [ .get_secrets, script ]
- nix-env -if pynixify/nixpkgs.nix -A cachix
Expand Down Expand Up @@ -70,8 +66,6 @@ pylint:
stage: test
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
script:
- apk update
- apk add git bash
- nix-env -if pynixify/nixpkgs.nix -A vault
- !reference [ .get_secrets, script ]
- nix-env -if pynixify/nixpkgs.nix -A cachix
Expand Down Expand Up @@ -101,8 +95,8 @@ pylint:

sqlite_test_nix:
extends: .sqlite_test_nix_base
image: nixos/nix:2.3.10
image: nixos/nix:2.16.0

postgresql_test_nix:
extends: .postgresql_test_nix_base
image: nixos/nix:2.3.10
image: nixos/nix:2.16.0
4 changes: 1 addition & 3 deletions .gitlab/ci/testing/.pretesting-gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,12 @@ bandit:
build_and_push_to_cachix:
tags:
- faradaytests
image: nixos/nix:2.3.10
image: nixos/nix:2.16.0
stage: pre_testing
variables:
# Note: this size has to fit both our community, professional and corporate versions
MAX_CLOSURE_SIZE_IN_MB: 850
script:
- apk update
- apk add git bash
- nix-env -if pynixify/nixpkgs.nix -A vault
- nix-env -if pynixify/nixpkgs.nix -A cachix
- nix-env -if pynixify/nixpkgs.nix -A gawk
Expand Down
9 changes: 5 additions & 4 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ disable=blacklisted-name,
map-builtin-not-iterating,
unused-import,
comparison-with-callable,
unused-variable
unused-variable,
method-cache-max-size-none,
consider-using-with



Expand Down Expand Up @@ -542,8 +544,7 @@ max-module-lines=1000
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator
# no-space-check=trailing-comma, dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
Expand Down Expand Up @@ -756,4 +757,4 @@ known-third-party=enchant

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.Exception
3 changes: 3 additions & 0 deletions CHANGELOG/4.5.0/community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* [MOD] Upgrade nixpkgs version to 23.05. Also update version of packages in requirements. #7518
* [FIX] Add missing `scope` cvss3 field. #7493
* [FIX] Improve performance in `hosts` and `hosts/filter` views. #7501
1 change: 1 addition & 0 deletions CHANGELOG/4.5.0/date.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Jul 7th, 2023
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
New features in the latest update
=====================================

4.5.0 [Jul 7th, 2023]:
---
* [MOD] Upgrade nixpkgs version to 23.05. Also update version of packages in requirements. #7518
* [FIX] Add missing `scope` cvss3 field. #7493
* [FIX] Improve performance in `hosts` and `hosts/filter` views. #7501

4.4.0 [May 29th, 2023]:
---
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.4.0'
__version__ = '4.5.0'
__license_version__ = __version__
9 changes: 3 additions & 6 deletions faraday/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from faraday_plugins.plugins.manager import PluginsManager
from flask_security.utils import hash_password

CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
CONTEXT_SETTINGS = {'help_option_names': ['-h', '--help']}


# logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -113,11 +113,8 @@ def database_schema():
def sql_shell():
conn_string = faraday.server.config.database.connection_string.strip("'")
conn_string = urlparse(conn_string)
parsed_conn_string = ("user={username} password={password} host={hostname} dbname={dbname}"
.format(username=conn_string.username,
password=conn_string.password,
hostname=conn_string.hostname,
dbname=conn_string.path[1:]))
parsed_conn_string = (f"user={conn_string.username} password={conn_string.password} host={conn_string.hostname} "
f"dbname={conn_string.path[1:]}")
pgcli = PGCli()
pgcli.connect_uri(parsed_conn_string)
pgcli.run_cli()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""Severity and service_id index in vulnerability model
Revision ID: dd3181b9b3e9
Revises: fa73865dc11c
Create Date: 2023-06-30 17:24:57.775877+00:00
"""
from alembic import op

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


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_index('ix_vulnerability_severity_serviceid', 'vulnerability', ['severity', 'service_id'], unique=False)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index('ix_vulnerability_severity_serviceid', table_name='vulnerability')
# ### end Alembic commands ###
28 changes: 28 additions & 0 deletions faraday/migrations/versions/fa73865dc11c_add_cvss3_scope_field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""add cvss3 scope field
Revision ID: fa73865dc11c
Revises: 1145efa88414
Create Date: 2023-05-29 14:30:03.033253+00:00
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'fa73865dc11c'
down_revision = '1145efa88414'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('vulnerability', sa.Column('cvss3_scope', sa.Text(), nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('vulnerability', 'cvss3_scope')
# ### end Alembic commands ###
Loading

0 comments on commit b421657

Please sign in to comment.