Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
9a33abf
Started implementation of POST /api/v2/alerts-filters
Elise17 Oct 8, 2025
b7088fd
Fixed analysis check
Elise17 Oct 8, 2025
103ed2c
Added function _load
Elise17 Oct 8, 2025
82bfec6
Deprecated endpoint POST /filters/add in favor of POST /api/v2/alerts…
Elise17 Oct 8, 2025
5b1290e
Added test create alert when filter data is missing
Elise17 Oct 8, 2025
ea45b99
Added test test_create_alert_filter_should_return_filter_type
Elise17 Oct 8, 2025
4c5ddd6
Added test_create_alert_filter_should_return_filter_name
Elise17 Oct 8, 2025
0a0f63d
Added test_create_alert_filter_should_return_in_filter_data_alert_title
Elise17 Oct 8, 2025
af0bf2b
Started implementation of GET /api/v2/alerts-filters/{identifier}
Elise17 Oct 17, 2025
0c911fe
Fixed check analysis
Elise17 Oct 17, 2025
8559ad7
Fixed importation problem
Elise17 Oct 17, 2025
7440b09
Fixed static analysis
Elise17 Oct 17, 2025
0690eb0
Removed user in test
Elise17 Oct 17, 2025
1129b73
Added test_get_alert_filter_should_return_filter_name
Elise17 Oct 17, 2025
97a89e5
Deprecated endpoint GET /filters/{identifier}
Elise17 Oct 17, 2025
622b46a
Added test_get_alert_filter_should_return_404
Elise17 Oct 17, 2025
9a1fffd
Added test_get_alert_filter_should_return_404_when_user_has_not_creat…
Elise17 Oct 17, 2025
e4b4998
Fixed static analysis
Elise17 Oct 17, 2025
69e38c8
Started implementation of PUT /api/v2/alerts-filters/{identifier}
Elise17 Oct 21, 2025
ec809ef
Fixed static analysis
Elise17 Oct 21, 2025
f438d3b
Added test_update_alert_filter_should_return_filter_name
Elise17 Oct 21, 2025
930e94c
Added test_update_alert_filter_should_return_filter_description
Elise17 Oct 21, 2025
120bed5
Added test_update_alert_filter_should_return_filter_type
Elise17 Oct 21, 2025
48c0957
Added test_update_alert_filter_should_return_filter_data_alert_title
Elise17 Oct 21, 2025
657d441
Added test_update_alert_filter_should_return_404_when_alert_filter_is…
Elise17 Oct 21, 2025
1008f29
Removed identifietr in test_update_alert_filter_should_return_404_whe…
Elise17 Oct 21, 2025
78234ef
Deprecated endpoint POST /filters/update/{identifier}
Elise17 Oct 21, 2025
eb541cb
Started implmentation of endpoint DELETE /api/v2/alerts-filters/{iden…
Elise17 Oct 21, 2025
745739c
Added test_delete_alert_filter_should_return_404_when_alert_not_found
Elise17 Oct 21, 2025
74bf4ea
test_get_alert_filter_should_return_404_after_delete_alert_filter
Elise17 Oct 21, 2025
157d749
Deprecated endpoint DELETE /api/v2/alerts-filters/{identifier}
Elise17 Oct 21, 2025
9a5a4c7
Fixed check analysis
Elise17 Oct 21, 2025
cb3ec88
Changed indentation and added ValidationError
Elise17 Oct 21, 2025
8d345f3
Changed indentation and added ValidationError
Elise17 Oct 21, 2025
b68b34c
Added new test test_update_alert_filter_should_return_400
Elise17 Oct 21, 2025
2dbfb95
Renamed method
c8y3 Oct 6, 2025
d1986e9
Renamed method
c8y3 Oct 6, 2025
7a8cfc5
Aligned method call
c8y3 Oct 6, 2025
ddef892
Started implementation of GET /api/v2/manage/customers/{identifier}
c8y3 Oct 6, 2025
6096f3b
Moved code down into persistence layer
c8y3 Oct 8, 2025
c7c77d0
Removed unused imports
c8y3 Oct 8, 2025
115d9ae
Added tow new import constraints: do not import marshables and do not…
c8y3 Oct 8, 2025
497135d
One import per line
c8y3 Oct 8, 2025
2651462
Removed dead code
c8y3 Oct 8, 2025
358d2d1
One import per line
c8y3 Oct 8, 2025
2c041aa
Following calling conventions
c8y3 Oct 8, 2025
3a6204b
Moved code down into the business and persistence layers
c8y3 Oct 8, 2025
acd242b
Early return
c8y3 Oct 8, 2025
cef2751
Simple quotes
c8y3 Oct 8, 2025
3fe05d1
Introduced method to get a customer by its name
c8y3 Oct 8, 2025
99842fc
Ruff warning
c8y3 Oct 8, 2025
50b4982
Added method to create a customer in the business layer
c8y3 Oct 8, 2025
3282472
Added a TODO
c8y3 Oct 8, 2025
7791840
Do not import iris_current_user from app.business.cases
c8y3 Oct 8, 2025
573a842
Removed unnecessary method parameter
c8y3 Oct 8, 2025
5411f32
Parameter need not be optional
c8y3 Oct 8, 2025
c1a2036
Extracted method
c8y3 Oct 8, 2025
410cdac
Extracted method
c8y3 Oct 8, 2025
f009aba
Removed one call to iris_current_user from iris_engine
c8y3 Oct 8, 2025
e1e3691
Moved code down into models
c8y3 Oct 8, 2025
1754dbf
Moved test .env file at the top level as .env.tests.model
c8y3 Oct 22, 2025
7ceee59
Renamed method to follow conventions
c8y3 Oct 24, 2025
e73af4d
GET /api/v2/customers/{identifier} should return 404 when it doesn't …
c8y3 Oct 24, 2025
30f49e2
Renamed test
c8y3 Oct 24, 2025
31e8495
Deprecate GET /manage/customers/{client_id}
c8y3 Oct 24, 2025
f3163c8
GET /api/v2/manage/customers/{identifier} returns 403 when user has n…
c8y3 Oct 24, 2025
df5de76
Removed methods which seem to be dead
c8y3 Oct 24, 2025
d912cac
Added rule RUF100
c8y3 Oct 24, 2025
74b9866
Added ruff rule RUF029
c8y3 Oct 24, 2025
e0ba692
Added ruff rules FURB14*
c8y3 Oct 24, 2025
405e758
Added ruff rule ARG003 and ARG005
c8y3 Oct 24, 2025
0d4f59f
Added ruff rules PYI*
c8y3 Oct 24, 2025
86e556b
Fixed and added all ruff B00* rules
c8y3 Oct 24, 2025
0329817
Set ruff rules FURB142, FURB145 and FURB148 rather than RUF14* (I am …
c8y3 Oct 24, 2025
4070b55
Removed PYI rules: we do not seem to use pyi
c8y3 Oct 24, 2025
535556f
Added dead code check with vulture
c8y3 Oct 24, 2025
9cc46da
Renamed vulture ignore file so that ruff does not parse it as a pytho…
c8y3 Oct 24, 2025
3fb283a
Removed validate_asset_type from vulture ignore list to check it fail…
c8y3 Oct 24, 2025
13bb46c
Removed seemingly dead methods
c8y3 Oct 24, 2025
e89de9e
Commented seemingly dead code which is used by iris-module-interface
c8y3 Oct 24, 2025
e080126
Started implementation of PUT /api/v2/manage/customers/{identifier}
c8y3 Oct 29, 2025
b400f72
PUT /api/v2/manage/customers/{identifier} should return 400 when anot…
c8y3 Oct 29, 2025
e6625f1
Moved database code out of marshables into the persistence layer
c8y3 Oct 29, 2025
39ac885
Added some ignored files to vulture
c8y3 Oct 29, 2025
33a4a4e
Improved configuration of vulture somewhat
c8y3 Oct 29, 2025
de86e58
Improved configuration of vulture somewhat
c8y3 Oct 29, 2025
f25c442
Improved configuration of vulture somewhat
c8y3 Oct 29, 2025
de3b44e
Organized vulture ignore file a bit more
c8y3 Oct 29, 2025
c4a4881
Simplified vulture ignore file somewhat
c8y3 Oct 29, 2025
97ee448
Deprecated PUT /manage/customers/update/<int:client_id>
c8y3 Oct 29, 2025
48c1209
Removed one occurence of ElementNotFoundException (use ObjectNotFound…
c8y3 Oct 29, 2025
ee14b4a
Removed unnecessary parameter
c8y3 Oct 29, 2025
ed60317
Removed exception ElementNotFoundException
c8y3 Oct 29, 2025
c5c4dd1
Fixed some deepsource warnings
c8y3 Oct 29, 2025
2105ca1
Added E20* ruff rules, and fixed warnings
c8y3 Oct 29, 2025
e25ba98
Added ruff rule W391
c8y3 Oct 29, 2025
20b074c
Fixed ruff warnings
c8y3 Oct 29, 2025
6a55d46
Started implmentation of DELETE /api/v2/manage/customers/{identifier}
c8y3 Oct 31, 2025
2f01f79
DELETE /api/v2/manage/customers/{identifier} should return 400 when c…
c8y3 Oct 31, 2025
2c4925d
Renamed test
c8y3 Oct 31, 2025
5cbdaf1
Moved business error definitions out of business into model
c8y3 Oct 31, 2025
9ab53e4
Fixed import constraint
c8y3 Oct 31, 2025
c7c3a0f
Use annotations to define endpoints on groups
c8y3 Oct 31, 2025
20bb8d9
Fixed ruff warnings
c8y3 Oct 31, 2025
a9079a7
Added import constraint: Do not import marshmallow from the persisten…
c8y3 Oct 31, 2025
ab8c8ee
Tyring to move dependence to marshmallow up in the API layer
c8y3 Oct 31, 2025
c1fc3a2
Fixed incorrect typing
c8y3 Oct 31, 2025
2c76991
Removed an marshable import from the persistence layer
c8y3 Oct 31, 2025
197de4f
Fixed ruff warning
c8y3 Oct 31, 2025
5b308a0
Deprecated POST /manage/customers/delete/<int:client_id>
c8y3 Oct 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
24 changes: 10 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ jobs:
uses: astral-sh/ruff-action@v3
with:
args: check --output-format=github
- name: Check dependencies with import-linter
- name: Check import dependencies with import-linter
run: |
python -m venv venv
source venv/bin/activate
pip install import-linter
PYTHONPATH=source lint-imports
- name: Looking for dead code with vulture
run: |
pip install vulture
vulture

build-docker-db:
name: Build docker db
Expand Down Expand Up @@ -131,10 +133,8 @@ jobs:
uses: actions/checkout@v4
- name: Start development server
run: |
# Even though, we use --env-file option when running docker compose, this is still necessary, because the compose has a env_file attribute :(
# TODO should move basic.env file, which is in directory tests, up. It's used in several places. Maybe, rename it into dev.env
cp tests/data/basic.env .env
docker compose --file docker-compose.dev.yml --env-file tests/data/basic.env up --detach --wait
cp .env.tests.model .env
docker compose --file docker-compose.dev.yml up --detach --wait
- name: Generate GraphQL documentation
run: |
npx spectaql@^3.0.2 source/spectaql/config.yml
Expand Down Expand Up @@ -170,9 +170,7 @@ jobs:
uses: actions/checkout@v4
- name: Start development server
run: |
# Even though, we use --env-file option when running docker compose, this is still necessary, because the compose has a env_file attribute :(
# TODO should move basic.env file, which is in directory tests, up. It's used in several places. Maybe, rename it into dev.env
cp tests/data/basic.env .env
cp .env.tests.model .env
docker compose --file docker-compose.dev.yml up --detach --wait
- name: Inspect development server start failure
if: ${{ failure() || cancelled() }}
Expand Down Expand Up @@ -226,8 +224,7 @@ jobs:
- name: Check out iris
uses: actions/checkout@v4
- name: Set up .env file
# TODO should move basic.env file, which is in directory tests, up. It's used in several places. Maybe, rename it into dev.env?
run: cp tests/data/basic.env .env
run: cp .env.tests.model .env
- name: Run tests
working-directory: tests_database_migration
run: |
Expand Down Expand Up @@ -277,8 +274,7 @@ jobs:
run: npx playwright install chromium firefox
- name: Start development server
run: |
# TODO should move basic.env file, which is in directory tests, up. It's used in several places. Maybe, rename it into dev.env
cp tests/data/basic.env .env
cp .env.tests.model .env
docker compose --file docker-compose.dev.yml up --detach --wait
- name: Run end to end tests
working-directory: e2e
Expand Down
455 changes: 455 additions & 0 deletions .vulture.ignore

Large diffs are not rendered by default.

29 changes: 27 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[tool.ruff.lint]
preview = true
select = ["E101", "E225", "E23", "E24", "E3", "E4", "E7", "E9", "F", "PLR0402", "RET506", "TID252", "UP032", "W29"]
select = ["ARG003", "ARG005", "B00", "E101", "E20", "E225", "E23", "E24", "E3", "E4", "E7", "E9", "F", "FURB142", "FURB145", "FURB148", "PLR0402", "RET506", "RUF029", "RUF100", "TID252", "UP032", "W29", "W391"]
ignore = ["E402", "E711", "E712", "E721", "E722"]

[tool.vulture]
paths = ["source/app", ".vulture.ignore"]
ignore_decorators = ["@*.route", "@app.*", "@*.post", "@*.get", "@*.put", "@*.delete", "@pre_load", "@post_load"]

[tool.importlinter]
root_package = "app"
include_external_packages = true
Expand All @@ -24,7 +28,7 @@ allow_indirect_imports = true
[[tool.importlinter.contracts]]
name = "Do not import API layer from the business layer"
type = "forbidden"
source_modules = ["app.business.access_controls", "app.business.assets"]
source_modules = ["app.business.access_controls", "app.business.assets", "app.business.cases"]
forbidden_modules = "app.blueprints.iris_user"
allow_indirect_imports = true

Expand All @@ -42,3 +46,24 @@ source_modules = "app.datamgmt.dashboard"
forbidden_modules = "app.blueprints.iris_user"
allow_indirect_imports = true

[[tool.importlinter.contracts]]
name = "Do not import marshables from the persistence layer"
type = "forbidden"
source_modules = ["app.datamgmt.manage.manage_case_state_db", "app.datamgmt.manage.manage_groups_db"]
forbidden_modules = "app.schema.marshables"
allow_indirect_imports = true

[[tool.importlinter.contracts]]
name = "Do not import marshmallow from the persistence layer"
type = "forbidden"
source_modules = "app.datamgmt.client"
forbidden_modules = "marshmallow"
allow_indirect_imports = true

[[tool.importlinter.contracts]]
name = "Do not import the engine from the persistence layer"
type = "forbidden"
source_modules = "app.datamgmt.case"
forbidden_modules = "app.iris_engine"
allow_indirect_imports = true

1 change: 0 additions & 1 deletion scripts/gunicorn-cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@

def worker_exit(server, worker):
sys.exit(4)

Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ def upgrade():

def downgrade():
pass

Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,3 @@ def upgrade():
def downgrade():
op.drop_column('ioc_type', 'type_validation_regex')
op.drop_column('ioc_type', 'type_validation_expect')

Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ def upgrade():

def downgrade():
pass

Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ def downgrade():

# Drop AlertSimilarity table
op.drop_table('alert_similarity')

4 changes: 2 additions & 2 deletions source/app/blueprints/graphql/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from app.business.cases import cases_delete
from app.business.cases import cases_update
from app.business.cases import cases_get_by_identifier
from app.business.errors import BusinessProcessingError
from app.models.errors import BusinessProcessingError
from app.blueprints.graphql.permissions import permissions_check_current_user_has_some_permission
from app.blueprints.graphql.permissions import permissions_check_current_user_has_some_case_access
from app.iris_engine.module_handler.module_handler import call_deprecated_on_preload_modules_hook
Expand Down Expand Up @@ -115,7 +115,7 @@ def mutate(root, info, name, description, client_id, soc_id=None, classification
schema = CaseSchema()
case = schema.load(request_data)
case_template_id = request_data.pop('case_template_id', None)
result = cases_create(case, case_template_id)
result = cases_create(iris_current_user, case, case_template_id)
return CaseCreate(case=result)


Expand Down
1 change: 0 additions & 1 deletion source/app/blueprints/graphql/sliced_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ def __getitem__(self, index: slice) -> any:

def __len__(self) -> int:
return self._total

2 changes: 1 addition & 1 deletion source/app/blueprints/pages/case/case_ioc_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from flask import url_for

from app.business.iocs import iocs_get
from app.business.errors import ObjectNotFoundError
from app.models.errors import ObjectNotFoundError
from app.datamgmt.case.assets_type import get_assets_types
from app.datamgmt.case.case_db import get_case
from app.datamgmt.case.case_iocs_db import get_case_iocs_comments_count
Expand Down
4 changes: 3 additions & 1 deletion source/app/blueprints/pages/manage/manage_cases_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from app.blueprints.access_controls import ac_api_return_access_denied, ac_fast_check_current_user_has_case_access
from app.blueprints.access_controls import ac_requires
from app.blueprints.responses import response_error
from app.schema.marshables import CaseStateSchema

manage_cases_blueprint = Blueprint('manage_case',
__name__,
Expand Down Expand Up @@ -81,6 +82,7 @@ def _details_case(cur_id: int, caseid: int, url_redir: bool) -> Union[str, Respo

case_classifications = get_case_classifications_list()
case_states = get_case_states_list()
dumped_case_states = CaseStateSchema(many=True).dump(case_states)
user_is_server_administrator = ac_current_user_has_permission(Permissions.server_administrator)

customers = get_client_list(current_user_id=iris_current_user.id,
Expand All @@ -92,7 +94,7 @@ def _details_case(cur_id: int, caseid: int, url_redir: bool) -> Union[str, Respo
form = FlaskForm()

return render_template("modal_case_info_from_case.html", data=res, form=form, protagonists=protagonists,
case_classifications=case_classifications, case_states=case_states, customers=customers,
case_classifications=case_classifications, case_states=dumped_case_states, customers=customers,
severities=severities)


Expand Down
6 changes: 3 additions & 3 deletions source/app/blueprints/pages/manage/manage_customers_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from flask import url_for
from flask_wtf import FlaskForm

from app.datamgmt.client.client_db import get_client
from app.datamgmt.client.client_db import get_customer
from app.datamgmt.client.client_db import get_client_api
from app.datamgmt.client.client_db import get_client_contact
from app.datamgmt.client.client_db import get_client_contacts
Expand Down Expand Up @@ -92,7 +92,7 @@ def customer_edit_contact_modal(client_id, contact_id, caseid, url_redir):
if url_redir:
return redirect(url_for('manage_customers.manage_customers', cid=caseid))

contact = get_client_contact(client_id, contact_id)
contact = get_client_contact(contact_id)
if not contact:
return response_error(f"Invalid Contact ID {contact_id}")

Expand All @@ -115,7 +115,7 @@ def view_customer_modal(client_id, caseid, url_redir):
return redirect(url_for('manage_customers.manage_customers', cid=caseid))

form = AddCustomerForm()
customer = get_client(client_id)
customer = get_customer(client_id)
if not customer:
return response_error("Invalid Customer ID")

Expand Down
2 changes: 1 addition & 1 deletion source/app/blueprints/rest/activities_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
activities_rest_blueprint = Blueprint('activities_rest', __name__)


@activities_rest_blueprint.route('/activities/list', methods=['GET'])
@activities_rest_blueprint.get('/activities/list')
@ac_api_requires(Permissions.activities_read, Permissions.all_activities_read)
def list_activities():
# Get User activities from database
Expand Down
8 changes: 4 additions & 4 deletions source/app/blueprints/rest/alerts_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
from app.blueprints.responses import response_error
from app.util import add_obj_history_entry
from app.blueprints.responses import response_success
from app.business.errors import BusinessProcessingError
from app.models.errors import BusinessProcessingError
from app.business.alerts import alerts_create

alerts_rest_blueprint = Blueprint('alerts_rest', __name__)
Expand Down Expand Up @@ -439,7 +439,7 @@ def alerts_batch_update_route() -> Response:
if not user_has_client_access(iris_current_user.id, alert.alert_customer_id):
return response_error('User not entitled to update alerts for the client', status=403)

if getattr(alert, 'alert_owner_id') is None:
if alert.alert_owner_id is None:
updates['alert_owner_id'] = iris_current_user.id

if data.get('alert_owner_id') == "-1" or data.get('alert_owner_id') == -1:
Expand Down Expand Up @@ -606,7 +606,7 @@ def alerts_escalate_route(alert_id) -> Response:
if not case:
return response_error('Failed to create case from alert')

ac_set_new_case_access(None, case.case_id, case.client_id)
ac_set_new_case_access(iris_current_user, case.case_id, case.client_id)

case = call_modules_hook('on_postload_case_create', data=case)

Expand Down Expand Up @@ -884,7 +884,7 @@ def alerts_batch_escalate_route() -> Response:
if not case:
return response_error('Failed to create case from alert')

ac_set_new_case_access(None, case.case_id, case.client_id)
ac_set_new_case_access(iris_current_user, case.case_id, case.client_id)

case = call_modules_hook('on_postload_case_create', data=case)

Expand Down
2 changes: 2 additions & 0 deletions source/app/blueprints/rest/api_v2_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from app.blueprints.rest.v2.tags import tags_blueprint
from app.blueprints.rest.v2.tasks import tasks_blueprint
from app.blueprints.rest.v2.profile import profile_blueprint
from app.blueprints.rest.v2.alerts_filters import alerts_filters_blueprint


# Create root /api/v2 blueprint
Expand All @@ -50,3 +51,4 @@
rest_v2_blueprint.register_blueprint(manage_v2_blueprint)
rest_v2_blueprint.register_blueprint(tags_blueprint)
rest_v2_blueprint.register_blueprint(profile_blueprint)
rest_v2_blueprint.register_blueprint(alerts_filters_blueprint)
2 changes: 1 addition & 1 deletion source/app/blueprints/rest/case/case_assets_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from app.business.assets import assets_get
from app.business.assets import assets_update
from app.blueprints.iris_user import iris_current_user
from app.business.errors import BusinessProcessingError
from app.models.errors import BusinessProcessingError
from app.datamgmt.case.case_assets_db import get_raw_assets
from app.datamgmt.case.case_assets_db import get_linked_iocs_finfo_from_asset
from app.datamgmt.case.case_assets_db import add_comment_to_asset
Expand Down
2 changes: 1 addition & 1 deletion source/app/blueprints/rest/case/case_evidences_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from app.business.evidences import evidences_create
from app.business.evidences import evidences_delete
from app.business.evidences import evidences_update
from app.business.errors import BusinessProcessingError
from app.models.errors import BusinessProcessingError
from app.iris_engine.module_handler.module_handler import call_deprecated_on_preload_modules_hook


Expand Down
11 changes: 7 additions & 4 deletions source/app/blueprints/rest/case/case_ioc_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
from app.business.iocs import iocs_update
from app.business.iocs import iocs_delete
from app.business.iocs import iocs_get
from app.business.errors import BusinessProcessingError
from app.business.errors import ObjectNotFoundError
from app.models.errors import BusinessProcessingError
from app.models.errors import ObjectNotFoundError
from app.datamgmt.case.case_iocs_db import add_comment_to_ioc
from app.datamgmt.case.case_iocs_db import add_ioc
from app.datamgmt.case.case_iocs_db import delete_ioc_comment
Expand All @@ -51,12 +51,14 @@
from app.models.authorization import CaseAccessLevel
from app.schema.marshables import CommentSchema
from app.schema.marshables import IocSchema
from app.blueprints.access_controls import ac_requires_case_identifier, ac_fast_check_current_user_has_case_access
from app.blueprints.access_controls import ac_requires_case_identifier
from app.blueprints.access_controls import ac_fast_check_current_user_has_case_access
from app.blueprints.access_controls import ac_api_requires
from app.blueprints.access_controls import ac_api_return_access_denied
from app.blueprints.responses import response_error
from app.blueprints.responses import response_success
from app.iris_engine.module_handler.module_handler import call_deprecated_on_preload_modules_hook
from app.iris_engine.access_control.utils import ac_get_fast_user_cases_access

case_ioc_rest_blueprint = Blueprint('case_ioc_rest', __name__)

Expand All @@ -74,7 +76,8 @@ def case_list_ioc(caseid):
out = ioc._asdict()

# Get links of the IoCs seen in other cases
ial = get_ioc_links(ioc.ioc_id)
user_search_limitations = ac_get_fast_user_cases_access(iris_current_user.id)
ial = get_ioc_links(ioc.ioc_id, user_search_limitations)

out['link'] = [row._asdict() for row in ial]
# Legacy, must be changed next version
Expand Down
2 changes: 1 addition & 1 deletion source/app/blueprints/rest/case/case_notes_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from app.blueprints.rest.case_comments import case_comment_update
from app.blueprints.rest.endpoints import endpoint_deprecated
from app.blueprints.iris_user import iris_current_user
from app.business.errors import BusinessProcessingError
from app.models.errors import BusinessProcessingError
from app.business.notes import notes_create
from app.business.notes import notes_list_revisions
from app.business.notes import notes_get_revision
Expand Down
2 changes: 1 addition & 1 deletion source/app/blueprints/rest/case/case_tasks_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from app.blueprints.rest.case_comments import case_comment_update
from app.blueprints.rest.endpoints import endpoint_deprecated
from app.blueprints.iris_user import iris_current_user
from app.business.errors import BusinessProcessingError
from app.models.errors import BusinessProcessingError
from app.business.tasks import tasks_delete
from app.business.tasks import tasks_create
from app.business.tasks import tasks_get
Expand Down
2 changes: 1 addition & 1 deletion source/app/blueprints/rest/case/case_timeline_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
from app.util import add_obj_history_entry
from app.blueprints.responses import response_error
from app.blueprints.responses import response_success
from app.business.errors import BusinessProcessingError
from app.models.errors import BusinessProcessingError
from app.business.events import events_create
from app.business.events import events_update
from app.business.events import events_delete
Expand Down
2 changes: 1 addition & 1 deletion source/app/blueprints/rest/case_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from app.blueprints.responses import response_error
from app.blueprints.responses import response_success
from app.business.comments import comments_update_for_case
from app.business.errors import BusinessProcessingError
from app.models.errors import BusinessProcessingError
from app.blueprints.iris_user import iris_current_user


Expand Down
Loading
Loading