Skip to content

Commit 1485b10

Browse files
author
Diego Nadares
committed
Merge branch 'white/staging' into white/master
2 parents d07334e + c967357 commit 1485b10

40 files changed

Lines changed: 2558 additions & 821 deletions

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ disable=blacklisted-name,
282282
comparison-with-callable,
283283
unused-variable,
284284
method-cache-max-size-none,
285-
consider-using-with
285+
consider-using-with,
286+
global-statement
286287

287288

288289

AUTHORS

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ The PRIMARY AUTHORS are:
22

33
* Ciro Goyeneche
44
* Daniel Foguelman
5+
* David Kraus
56
* Diego Nadares
67
* Eric Horvat
78
* Esteban Guillardoy
@@ -11,44 +12,43 @@ The PRIMARY AUTHORS are:
1112
* Francisco Amato
1213
* Franco Linares
1314
* German Riera
15+
* Gonzalo Martínez
16+
* Ignacio Feijoo
1417
* Javier Montilva
1518
* Joaquín López Pereyra
1619
* Jorge Luis González Iznaga
1720
* Leonardo Lazzaro
1821
* Marcelo Pedraza
19-
* Manuel Jose Sotomayor Torrealba
22+
* Manuel José Sotomayor Torrealba
2023
* Mariano Marchetta
2124
* Martín Rocha
22-
* Matias Ariel Ré Medina
23-
* Matias Lang
25+
* Matías Ariel Ré Medina
26+
* Matías Lang
2427
* Micaela Ranea Sánchez
2528
* Nahuel Alonso
26-
* Nicolas Rebagliati
27-
* Sebastian Brachi
28-
* Sebastian Kulesz
29+
* Nicolás Rebagliati
30+
* Sebastián Brachi
31+
* Sebastián Kulesz
2932
* Zoe Marino
30-
* Gonzalo Martinez
31-
* Ignacio Feijo
32-
* David Kraus
3333

3434
Project contributors
3535

3636
* Alejandro Parodi
3737
* Andrés López Luksenberg
38-
* Andres Tarantini
38+
* Andrés Tarantini
3939
* Brice Samulenok
4040
* Buanzo
4141
* csk
4242
* dmknght
4343
* Elian Gidoni
4444
* Endrigo Antonini
45-
* Federico Fernandez
45+
* Federico Fernández
4646
* James Jara
47-
* Javier aguinaga
47+
* Javier Aguinaga
4848
* Juan Urbano
4949
* Korantin Auguste
5050
* logdot
51-
* Martin Tartarelli
51+
* Martín Tartarelli
5252
* Mike Zhong (go bears)
5353
* Necrose99
5454
* Roberto Focke

CHANGELOG/5.1.0/community.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* [MOD] Modify analytics type enum. #7615
2+
* [ADD] Performance improved in `assets` views making several vulnerabilities stats statics in asset's model. #7634
3+
* [FIX] Fix references. #7648
4+
* [ADD] Now `custom fields` are available for filtering vulnerabilities. Also add `date` type for custom fields. #7625
5+
* [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

CHANGELOG/5.1.0/date.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Feb 8th, 2024

RELEASE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
New features in the latest update
22
=====================================
33

4+
5.1.0 [Feb 8th, 2024]:
5+
---
6+
* [ADD] Performance improved in `assets` views making several vulnerabilities stats statics in asset's model. #7634
7+
* [ADD] Now `custom fields` are available for filtering vulnerabilities. Also add `date` type for custom fields. #7625
8+
* [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
9+
* [MOD] Modify analytics type enum. #7615
10+
* [FIX] Fix references. #7648
11+
412
5.0.1 [Jan 2nd, 2024]:
513
---
614
* [MOD] Code refactor.

docker/server.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ api_token_expiration = 604800
66
session_timeout = 24
77
delete_report_after_process = true
88
#celery_enabled = false
9-
#celery_broker_url = localhost
10-
#celery_backend_url = localhost
9+
celery_broker_url = redis
10+
celery_backend_url = redis
1111
#redis_session_storage = XXX
1212

1313
[storage]

faraday/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
See the file 'doc/LICENSE' for the license information
55
"""
66

7-
__version__ = '5.0.1'
7+
__version__ = '5.1.0'
88
__license_version__ = __version__

faraday/manage.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
from sqlalchemy.exc import ProgrammingError, OperationalError
2222

2323
import faraday.server.config
24-
from faraday.server.app import get_app
24+
from faraday.server.app import get_app, create_app
25+
from faraday.server.commands.sync_hosts_stats import _sync_hosts_stats
2526
from faraday.server.config import FARADAY_BASE
2627
from faraday.server.commands.initdb import InitDB
2728
from faraday.server.commands.faraday_schema_display import DatabaseSchema
@@ -304,6 +305,13 @@ def move_references(all_workspaces, workspace_name):
304305
_move_references(all_workspaces=all_workspaces, workspace_name=workspace_name)
305306

306307

308+
@click.command(help="Synchronize vulnerability severity stats in asset")
309+
def sync_hosts_stats():
310+
app = create_app()
311+
with app.app_context():
312+
_sync_hosts_stats()
313+
314+
307315
cli.add_command(show_urls)
308316
cli.add_command(initdb)
309317
cli.add_command(database_schema)
@@ -321,6 +329,7 @@ def move_references(all_workspaces, workspace_name):
321329
cli.add_command(import_vulnerability_templates)
322330
cli.add_command(settings)
323331
cli.add_command(move_references)
332+
cli.add_command(sync_hosts_stats)
324333

325334

326335
if __name__ == '__main__':
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""add fields to KB
2+
3+
Revision ID: 257f6d0ad43f
4+
Revises: b87b1de2f348
5+
Create Date: 2023-11-10 21:47:36.973846+00:00
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = '257f6d0ad43f'
14+
down_revision = 'b87b1de2f348'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
op.add_column('vulnerability_template',
21+
sa.Column('cve', sa.Text(), default='', server_default='', nullable=True))
22+
op.add_column('vulnerability_template',
23+
sa.Column('_cvss2_vector_string', sa.Text(), default='', server_default='', nullable=True))
24+
op.add_column('vulnerability_template',
25+
sa.Column('_cvss3_vector_string', sa.Text(), default='', server_default='', nullable=True))
26+
27+
28+
def downgrade():
29+
op.drop_column('vulnerability_template', 'cve')
30+
op.drop_column('vulnerability_template', '_cvss2_vector_string')
31+
op.drop_column('vulnerability_template', '_cvss3_vector_string')
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""Add host stats static columns
2+
3+
Revision ID: 51e533d41312
4+
Revises: 257f6d0ad43f
5+
Create Date: 2024-01-12 20:12:43.408035+00:00
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
# revision identifiers, used by Alembic.
12+
revision = '51e533d41312'
13+
down_revision = '257f6d0ad43f'
14+
branch_labels = None
15+
depends_on = None
16+
17+
18+
def upgrade():
19+
# ### commands auto generated by Alembic - please adjust! ###
20+
op.add_column('host', sa.Column('vulnerability_critical_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True))
21+
op.add_column('host', sa.Column('vulnerability_high_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True))
22+
op.add_column('host', sa.Column('vulnerability_medium_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True))
23+
op.add_column('host', sa.Column('vulnerability_low_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True))
24+
op.add_column('host', sa.Column('vulnerability_info_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True))
25+
op.add_column('host', sa.Column('vulnerability_unclassified_generic_count', sa.Integer(), server_default=sa.text('0'), nullable=True))
26+
# ### end Alembic commands ###
27+
28+
29+
def downgrade():
30+
# ### commands auto generated by Alembic - please adjust! ###
31+
op.drop_column('host', 'vulnerability_unclassified_generic_count')
32+
op.drop_column('host', 'vulnerability_info_generic_count')
33+
op.drop_column('host', 'vulnerability_low_generic_count')
34+
op.drop_column('host', 'vulnerability_medium_generic_count')
35+
op.drop_column('host', 'vulnerability_high_generic_count')
36+
op.drop_column('host', 'vulnerability_critical_generic_count')
37+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)