Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
317 commits
Select commit Hold shift + click to select a range
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
901098b
Removed unnecessary file
c8y3 Nov 5, 2025
0b2b15f
Removed all unit tests which have not been run in a long time. Added …
c8y3 Nov 5, 2025
c099fef
Started implementation of GET /api/v2/manage/customers
c8y3 Nov 5, 2025
4ae9af9
Fixed ruff warning
c8y3 Nov 5, 2025
7eb8971
Moved method into API layer
c8y3 Nov 5, 2025
704bb07
app.datamgmt.alerts.alerts_db should not import app.blueprints.access…
c8y3 Nov 5, 2025
cc14de1
Fixed ruff warning
c8y3 Nov 5, 2025
221ea9d
Removed seemingly dead method
c8y3 Nov 5, 2025
dcc4830
Factored code somewhat
c8y3 Nov 5, 2025
76acb33
Removed cycle
c8y3 Nov 5, 2025
5244279
Use method from the business layer
c8y3 Nov 5, 2025
0f4319e
Use method from the API layer
c8y3 Nov 5, 2025
8f3bf8e
Fixed incorrect retrieval of identifier
c8y3 Nov 5, 2025
88d09a3
Import db directly from app.db rather than from app
c8y3 Nov 5, 2025
ebe8870
Deprecated GET /manage/customers/list
c8y3 Nov 5, 2025
08db0cd
Fixed deepsource warning
c8y3 Nov 5, 2025
be022b8
Fixed missing parameters
c8y3 Nov 5, 2025
6fe4364
Fixed bug when checking for permission
c8y3 Nov 5, 2025
216b57c
Started implementation of POST /api/v2/global-tasks
c8y3 Nov 7, 2025
87b0949
Fixed ruff warnings
c8y3 Nov 7, 2025
70f262c
Factored code to create an object in database
c8y3 Nov 7, 2025
005ab91
Removed unnecessary return values
c8y3 Nov 7, 2025
d7393b9
Generalized import-linter constraint somewhat
c8y3 Nov 7, 2025
1862bb7
Calling conventions
c8y3 Nov 7, 2025
5544829
Added a FIXME
c8y3 Nov 7, 2025
8fa3305
Removed unnecessary return
c8y3 Nov 7, 2025
c69dcf5
Added import constraint: Do not import the persistence layer from the…
c8y3 Nov 7, 2025
1daa99c
Deprecated POST /global/tasks/add
c8y3 Nov 7, 2025
7a1b747
Removed an import app
c8y3 Nov 7, 2025
c345e41
Removed an import app
c8y3 Nov 7, 2025
5c474c1
Removed an import app
c8y3 Nov 7, 2025
d4346fd
Started GET /api/v2/global-tasks/{identifier}
c8y3 Nov 12, 2025
b314c45
Removed unnecessary return
c8y3 Nov 12, 2025
ed4d0d5
Removed seemingly unnecessary method
c8y3 Nov 12, 2025
149d3c9
Fixed ruff warning
c8y3 Nov 12, 2025
3b57d7f
Fixed import to Client
c8y3 Nov 12, 2025
aa735c4
Removed one use of too generic method get_or_create in models
c8y3 Nov 12, 2025
002d718
Fixed ruff warning
c8y3 Nov 12, 2025
3af00d3
Added test to check Analysts group autofollow is set to false
c8y3 Nov 12, 2025
8e6f5ca
Removed some usages of get_or_create
c8y3 Nov 12, 2025
21c01f4
Removed method get_or_create
c8y3 Nov 12, 2025
6644e6c
Moved CaseStatus into app.models.cases
c8y3 Nov 12, 2025
be4a6c0
Moved ReviewStatusList into app.models.cases
c8y3 Nov 12, 2025
4479bd2
Put Client model in its own module
c8y3 Nov 12, 2025
63a55b6
Deprecated GET /global/tasks/<int:cur_id>
c8y3 Nov 12, 2025
b854cda
Moved CaseAssets out of app.models.models into app.models.assets
c8y3 Nov 12, 2025
50f88d1
Moved AnalysisStatus in app.models.assets
c8y3 Nov 12, 2025
c846f0e
Moved CaseClassification into app.models.cases
c8y3 Nov 12, 2025
b252df8
Fixed ruff warnings
c8y3 Nov 12, 2025
8430792
Started implementation of DELETE /api/v2/global-tasks/{identifier}
c8y3 Nov 14, 2025
72457f4
Made calls more uniform
c8y3 Nov 14, 2025
55e1be5
Removed TODO, added test and documented the reason why the code simpl…
c8y3 Nov 14, 2025
f6717e6
Made calls to call_modules_hook more uniform
c8y3 Nov 14, 2025
068d79d
Fixed failing test
c8y3 Nov 14, 2025
88e9e5f
Grouped all methods related to global tasks
c8y3 Nov 14, 2025
0608f9f
Moved method related to case_tasks out of dashboard_routes to group them
c8y3 Nov 14, 2025
97cc5c8
Moved code out of dashboard_db
c8y3 Nov 14, 2025
066de8d
Removed duplicated method
c8y3 Nov 14, 2025
a7c0483
Removed seemingly dead method
c8y3 Nov 14, 2025
2eb0b28
Grouped code
c8y3 Nov 14, 2025
8c167dc
Removed now unused module
c8y3 Nov 14, 2025
d6c90e0
Updated lint-import constraints to the fact that dashboard does not e…
c8y3 Nov 14, 2025
04e3c9f
Added test
c8y3 Nov 14, 2025
55d1cad
Deprecated POST /global/tasks/delete/<int:cur_id>
c8y3 Nov 14, 2025
5fa70af
Added an import constraint
c8y3 Nov 14, 2025
022dbd9
Factored code to delete in db somewhat
c8y3 Nov 14, 2025
84f7d3e
Fixed delete comment
c8y3 Nov 14, 2025
9027e9c
Put some more information in .vulture.ignore
c8y3 Nov 14, 2025
aa477fb
Fixed ruff warning
c8y3 Nov 14, 2025
8e847c8
Removed an occurence of from app import app
c8y3 Nov 14, 2025
5547959
Moved down code into the persistence layer
c8y3 Nov 14, 2025
de4607f
One import per line
c8y3 Nov 14, 2025
8391039
Removed unnecessary print in test
c8y3 Nov 14, 2025
30756fc
Removed unused parameter, as indicated by deepsource
c8y3 Nov 14, 2025
13def32
Fixed some deepsource warnings
c8y3 Nov 14, 2025
313aab0
Started implementation of PUT /api/v2/global-tasks/{identifier}
c8y3 Nov 19, 2025
833bb6e
Do not import iris_current_user from app.datamgmt.case.case_events_db
c8y3 Nov 19, 2025
c04290c
Moved methods in persistence layer
c8y3 Nov 19, 2025
40b7ecf
Factored duplicated code
c8y3 Nov 19, 2025
abdd755
Separated code from data
c8y3 Nov 19, 2025
2ba73b2
Moved EvidenceTypes model in new model file evidences.py
c8y3 Nov 19, 2025
f793d9e
Moved CaseReceivedFile in evidences.py
c8y3 Nov 19, 2025
76c1838
Do not import iris_current_user from app.datamgmt.case.case_iocs_db
c8y3 Nov 19, 2025
5648d7b
Do not import iris_current_user from app.datamgmt.case.case_notes_db
c8y3 Nov 19, 2025
3a9ae9f
Do not import iris_current_user from app.datamgmt.case.case_rfiles_db
c8y3 Nov 19, 2025
fbd2094
Do not import iris_current_user from app.datamgmt.case
c8y3 Nov 19, 2025
2c289a8
Deprecated POST /global/tasks/update/<int:cur_id>
c8y3 Nov 19, 2025
1a92dd7
Added tests for field task_close_date of global tasks
c8y3 Nov 19, 2025
ac76eb1
Removed unnecessary else
c8y3 Nov 19, 2025
952011c
Removed unnecessary else
c8y3 Nov 19, 2025
b34d05c
Added ruff rule RET505
c8y3 Nov 19, 2025
b1ffb62
Added ruff rule RET501
c8y3 Nov 19, 2025
45a738f
Removed spurious blank line
c8y3 Nov 19, 2025
ab79f5f
Fixing some ruff RET502 warnings
c8y3 Nov 19, 2025
65d0db9
Started implementation of GET /api/v2/global-tasks
c8y3 Nov 21, 2025
58900f8
Added test for field total of GET /api/v2/global-tasks
c8y3 Nov 21, 2025
e44bd0a
Deprecated GET /global/tasks/list
c8y3 Nov 21, 2025
106365d
Removed one use of iris_current_user out of the persistence layer
c8y3 Nov 21, 2025
4f48725
Extracted method
c8y3 Nov 21, 2025
9f5894b
Extracted method
c8y3 Nov 21, 2025
6d720ff
Moved up an occurence of iris_current_user
c8y3 Nov 21, 2025
f570e27
Extracted methods
c8y3 Nov 21, 2025
14b5814
No need for optional parameter
c8y3 Nov 21, 2025
ee34d5d
Renamed method
c8y3 Nov 21, 2025
33d04dd
Use method from business
c8y3 Nov 21, 2025
7e99ab0
Moved up corner case in the business layer (does not require database…
c8y3 Nov 21, 2025
b03ecd3
Extracted method
c8y3 Nov 21, 2025
f99e77e
Extracted method
c8y3 Nov 21, 2025
e589c16
Moved code up into the business layer
c8y3 Nov 21, 2025
22e0496
Code cleanup
c8y3 Nov 21, 2025
3307565
Flattened and_
c8y3 Nov 21, 2025
e557cb7
Fixed ruff warning
c8y3 Nov 21, 2025
0f05312
Removed unused parameters
c8y3 Nov 21, 2025
a9a91c2
Moved up iris_current_user
c8y3 Nov 21, 2025
4880f73
Single quotes
c8y3 Nov 21, 2025
3fb4eda
Extended existing import constraint
c8y3 Nov 21, 2025
055dc65
Following calling conventions
c8y3 Nov 21, 2025
e40674d
Moved up some imports to iris_current_user
c8y3 Nov 21, 2025
d3721f8
Added missing preamble
c8y3 Nov 21, 2025
043cac8
Moved up some imports to iris_current_user
c8y3 Nov 21, 2025
0c1c654
Enforced one more constraint to avoid importing iris_current_user fro…
c8y3 Nov 21, 2025
44df5bd
Added ruff rule E211
c8y3 Nov 21, 2025
530e4e4
Added ruff rule E226
c8y3 Nov 21, 2025
7a975d4
Added ruff rule E272
c8y3 Nov 21, 2025
100a73d
Added ruff rule E221
c8y3 Nov 21, 2025
2d23cc9
[#887][FIX] Fixed issue with notes being overwritten with stale content
ldbsi Nov 26, 2025
714ce17
[ADD] Add traefik support
ascalotoru Dec 1, 2025
fb7cbb8
Fixed path to store icon when updating asset-type
c8y3 Dec 28, 2025
c710531
Forgot to commit image
c8y3 Dec 28, 2025
91af0dd
Created directory in which icons are stored
c8y3 Dec 28, 2025
3fb2b4e
Build the ui before API tests, rather than just creating the necessar…
c8y3 Dec 28, 2025
9d5c69d
Merge branch 'issue999' into issue999_for_develop
c8y3 Dec 28, 2025
8922cb0
Factored test driver
c8y3 Dec 29, 2025
fb03cca
Fixed ruff warnings
c8y3 Dec 29, 2025
3c0e581
Removed most probably unused png files
c8y3 Dec 29, 2025
447cec5
Update source/app/blueprints/rest/v2/alerts_filters.py
whikernel Jan 11, 2026
2380d76
Update source/app/datamgmt/case/case_assets_db.py
whikernel Jan 11, 2026
e883396
Merge pull request #946 from dfir-iris/api_v2_create_alert_filter
whikernel Jan 11, 2026
0f964df
Merge branch 'develop' into api_v2_get_alert_filter
whikernel Jan 11, 2026
4e738c2
Merge pull request #947 from dfir-iris/api_v2_get_alert_filter
whikernel Jan 11, 2026
293c50b
Merge pull request #949 from dfir-iris/api_v2_update_alert_filter
whikernel Jan 11, 2026
49c9af9
Merge pull request #951 from dfir-iris/api_v2_delete_alert_filter
whikernel Jan 11, 2026
71fea07
Update source/app/datamgmt/case/case_db.py
whikernel Jan 11, 2026
add47a6
Update tests/tests_rest_customers.py
whikernel Jan 11, 2026
823c86e
Merge pull request #955 from dfir-iris/api_v2_get_customer
whikernel Jan 11, 2026
980ef8b
Merge pull request #961 from dfir-iris/api_v2_put_customer
whikernel Jan 11, 2026
fbe4998
Merge pull request #962 from dfir-iris/api_v2_delete_customer
whikernel Jan 11, 2026
da866e4
Merge pull request #965 from dfir-iris/api_v2_get_paginated_customers
whikernel Jan 11, 2026
c2e75b0
Merge pull request #969 from dfir-iris/api_v2_create_global_task
whikernel Jan 11, 2026
0aa6ae3
Merge pull request #971 from dfir-iris/api_v2_get_global_task
whikernel Jan 11, 2026
866b435
Merge pull request #975 from dfir-iris/api_v2_delete_global_task
whikernel Jan 11, 2026
2955fbc
Merge pull request #979 from dfir-iris/api_v2_update_global_task
whikernel Jan 11, 2026
020fab7
Merge pull request #981 from dfir-iris/api_v2_paginated_global_tasks
whikernel Jan 11, 2026
f54fad8
Merge pull request #987 from irontec/feature/traefik-support
whikernel Jan 11, 2026
f6ae7e1
Merge pull request #1003 from dfir-iris/issue999_for_develop
whikernel Jan 11, 2026
13b3f17
Merge pull request #985 from ldbsi/develop
whikernel Jan 11, 2026
045d098
[DEL] Removed alerts filters
whikernel Jan 12, 2026
1cc4d0d
Added support for calling from a new Svelte UI.
fatpeppapig Jan 13, 2026
bdcbb78
Merge pull request #1010 from fatpeppapig/new_ui_integration
whikernel Jan 13, 2026
bd209a3
Revert "Added support for calling from a new Svelte UI."
whikernel Jan 13, 2026
dc61ac9
Merge pull request #1012 from dfir-iris/revert-1010-new_ui_integration
whikernel Jan 13, 2026
2fabaff
[FIX] oidc user group being mandatory
whikernel Jan 15, 2026
90e3860
[ADD] Added manage server routes for authentication details
whikernel Jan 15, 2026
b053947
Added support OIDC in New UI.
fatpeppapig Jan 15, 2026
d4e474b
Merge pull request #1016 from fatpeppapig/new_ui_oidc
whikernel Jan 19, 2026
67d0f57
Added support for MFA in New UI.
fatpeppapig Jan 19, 2026
789e707
Merge pull request #1017 from fatpeppapig/new_ui_mfa
whikernel Jan 20, 2026
576c00a
Added requirement of MFA verification in JWT authentication.
fatpeppapig Jan 21, 2026
38bbaa3
Merge pull request #1018 from fatpeppapig/auth_with_mfa
whikernel Jan 21, 2026
ba6c62e
Added GET methods for user and group cases access API.
fatpeppapig Feb 9, 2026
b584742
Fixed access control for token auth in API V2.
fatpeppapig Feb 13, 2026
e6e6d79
Merge pull request #1031 from fatpeppapig/cases_access
whikernel Feb 16, 2026
6e0203c
imp: export env IRIS_AUTHENTICATION_TYPE too.
lelianthorel Feb 17, 2026
934de80
Added option to have multiple cases filters.
fatpeppapig Feb 19, 2026
d97166f
fix(postgres): typo in postgres.yaml template.
lelianthorel Feb 20, 2026
2185e58
Moved cases filters logic to api/v2 endpoints.
fatpeppapig Feb 23, 2026
40a2f6b
Added alerts filters presets.
fatpeppapig Mar 2, 2026
49738eb
Fixed ruff errors.
fatpeppapig Mar 3, 2026
164ff8f
Added quick fix for alerts endpoint.
fatpeppapig Mar 5, 2026
50e82a5
Fixed permissions on alert comments V2.
fatpeppapig Mar 11, 2026
4a7a1d9
Fixed relations rendering.
fatpeppapig Mar 20, 2026
25badc7
Fixed related-alerts endpoint permissions.
fatpeppapig Mar 23, 2026
2924a37
Added cases to related alerts.
fatpeppapig Mar 25, 2026
2c532f5
Fixed unlinking cases.
fatpeppapig Mar 27, 2026
d5894c6
Fixed updating reviewer and review status through API.
fatpeppapig Apr 1, 2026
04109e1
Fixed dim task routes auth.
fatpeppapig Apr 2, 2026
5be3485
Fixed import issues.
fatpeppapig Apr 7, 2026
551e6a9
Better pluck for AlertCaseSchema.
fatpeppapig Apr 7, 2026
f240cf8
Fixed access to related-alerts.
fatpeppapig Apr 7, 2026
8a0ad7f
Merge pull request #1036 from fatpeppapig/filters
whikernel Apr 8, 2026
beb4e84
Fixed permissions on alert comments.
fatpeppapig Apr 8, 2026
5dde43d
Merge pull request #1060 from fatpeppapig/comments
whikernel Apr 8, 2026
faa09fa
Merge pull request #1035 from lelianthorel/thorel-IMP
whikernel Apr 8, 2026
2709b45
Merge pull request #1037 from lelianthorel/fix/postgres-password-var
whikernel Apr 8, 2026
a9b194d
Added endpoints to list and search notes in V2 Rest API.
fatpeppapig Apr 13, 2026
2218a7d
Fixed case filters.
fatpeppapig Apr 17, 2026
f5d613c
[IMP] Improved search in notes
whikernel Apr 21, 2026
fe53427
Merge pull request #1062 from fatpeppapig/case_notes
whikernel Apr 21, 2026
c0d1e34
[FIX] Fixed unsafe direct access to depreceated endpoints - cf GHSA-9…
Apr 17, 2026
3efae01
[ADD] Added datastore handler for v2
Apr 22, 2026
2419b1c
[ADD] Mising v2 DS file
Apr 22, 2026
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.
34 changes: 20 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 @@ -168,11 +168,19 @@ jobs:
docker load --input ${{ runner.temp }}/iriswebapp_app.tar
- name: Check out iris
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: ui/package-lock.json
- name: Build ui to be mounted in development docker
working-directory: ui
run: |
npm ci
npm run build
- 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 +234,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 +284,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
454 changes: 454 additions & 0 deletions .vulture.ignore

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deploy/kubernetes/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.2.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.ingress.enabled }}
{{- if and .Values.ingress.enabled (not .Values.ingress.traefik.enabled) }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down
28 changes: 28 additions & 0 deletions deploy/kubernetes/charts/templates/ingress_route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.ingress.traefik.enabled }}
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: {{ .Values.ingress.name }}
{{- with .Values.ingress.customAnnotations }}
annotations:
{{- range $k, $v := . }}
{{- if not (hasPrefix "nginx.ingress.kubernetes.io" $k) }}
{{ $k }}: {{ $v }}
{{- end }}
{{- end }}
{{- end }}
spec:
entryPoints:
- {{ .Values.ingress.traefik.entryPoint | default "web" }}
routes:
{{- range $host := .Values.ingress.hosts }}
{{- range $path := $host.paths }}
- kind: Rule
match: >
Host(`{{ $host.host }}`) && PathPrefix(`{{ $path.path }}`)
services:
- name: {{ $.Values.irisapp.name }}
port: {{ $.Values.irisapp.service.port }}
{{- end }}
{{- end }}
{{- end }}
14 changes: 9 additions & 5 deletions deploy/kubernetes/charts/templates/iris_app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ spec:
{{- end }}
{{- end }}

- name: IRIS_SECRET_KEY
- name: IRIS_SECRET_KEY
value: {{ .Values.irisapp.IRIS_SECRET_KEY | quote }}

- name: IRIS_SECURITY_PASSWORD_SALT
- name: IRIS_SECURITY_PASSWORD_SALT
value: {{ .Values.irisapp.IRIS_SECURITY_PASSWORD_SALT | quote }}

- name: DB_RETRY_COUNT
Expand All @@ -78,8 +78,12 @@ spec:

- name: IRIS_ADM_PASSWORD
value: {{ .Values.irisapp.IRIS_ADM_PASSWORD | quote }}

{{- if eq .Values.irisapp.IRIS_AUTHENTICATION_TYPE "oidc" }}

- name: IRIS_AUTHENTICATION_TYPE:
value: {{ .Values.irisapp.IRIS_AUTHENTICATION_TYPE | quote }}

- name: OIDC_ISSUER_URL
value: {{ .Values.irisapp.OIDC_ISSUER_URL | quote }}

Expand All @@ -104,13 +108,13 @@ spec:
- name: OIDC_MAPPING_ROLES
value: {{ .Values.irisapp.OIDC_MAPPING_ROLES | quote }}
{{- end }}

ports:
- containerPort: 8000

volumeMounts:
- mountPath: /home/iris/downloads
name: iris-downloads
name: iris-downloads
- mountPath: /home/iris/user_templates
name: user-templates
- mountPath: /home/iris/server_data
Expand Down
12 changes: 6 additions & 6 deletions deploy/kubernetes/charts/templates/postgres.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.postgres.enabled }}
---
---
# Here I have used a hostpath
# Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported.
# If you need to go with Dynamic volumes you may choose AWS EBS or EFS
Expand Down Expand Up @@ -68,13 +68,13 @@ spec:
- name: POSTGRES_USER # Setting Database username
value: {{ .Values.postgres.POSTGRES_USER | quote }}

- name: POSTGRES_PASSWORDD # Setting Database password
- name: POSTGRES_PASSWORD # Setting Database password
value: {{ .Values.postgres.POSTGRES_PASSWORD | quote }}

- name: POSTGRES_ADMIN_USER # Setting Database admin user
- name: POSTGRES_ADMIN_USER # Setting Database admin user
value: {{ .Values.postgres.POSTGRES_ADMIN_USER | quote }}

- name: POSTGRES_ADMIN_PASSWORD # Setting Database admin password
- name: POSTGRES_ADMIN_PASSWORD # Setting Database admin password
value: {{ .Values.postgres.POSTGRES_ADMIN_PASSWORD | quote }}

- name: POSTGRES_PORT # Setting Database port
Expand Down Expand Up @@ -108,5 +108,5 @@ spec:
- port: {{ .Values.postgres.service.port }}
selector:
app: {{ .Values.postgres.app }}
---
{{- end }}
---
{{- end }}
3 changes: 3 additions & 0 deletions deploy/kubernetes/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ ingress:
enabled: true
name: iris-ingress
className: nginx
traefik:
enabled: false
entryPoint: web
enableTls: false
sslRedirect: false
customAnnotations:
Expand Down
49 changes: 44 additions & 5 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", "E211", "E221", "E225", "E226", "E272", "E23", "E24", "E3", "E4", "E7", "E9", "F", "FURB142", "FURB145", "FURB148", "PLR0402", "RET501", "RET505", "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,8 +28,8 @@ 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"]
forbidden_modules = "app.blueprints.iris_user"
source_modules = ["app.business.access_controls", "app.business.assets", "app.business.cases", "app.business.alerts"]
forbidden_modules = "app.blueprints"
allow_indirect_imports = true

[[tool.importlinter.contracts]]
Expand All @@ -36,9 +40,44 @@ forbidden_modules = "sqlalchemy"
allow_indirect_imports = true

[[tool.importlinter.contracts]]
name = "Do not import API layer from the persistence layer"
name = "Do not import API layer from the persistence layer (access_controls)"
type = "forbidden"
source_modules = "app.datamgmt"
forbidden_modules = "app.blueprints.access_controls"
allow_indirect_imports = true

[[tool.importlinter.contracts]]
name = "Do not import API layer from the persistence layer (iris_user)"
type = "forbidden"
source_modules = "app.datamgmt.dashboard"
source_modules = ["app.datamgmt.case", "app.datamgmt.datastore", "app.datamgmt.filters"]
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

[[tool.importlinter.contracts]]
name = "Do not import the persistence layer from the models"
type = "forbidden"
source_modules = "app.models.cases"
forbidden_modules = "app.datamgmt"
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)

27 changes: 12 additions & 15 deletions source/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,18 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

import collections
import json
import os
from flask import Flask, g
from flask import Flask
from flask import g
from flask import session
from flask_bcrypt import Bcrypt
from flask_caching import Cache
from flask_cors import CORS

from flask_login import LoginManager
from flask_marshmallow import Marshmallow
from flask_socketio import SocketIO, Namespace
from flask_sqlalchemy import SQLAlchemy
from functools import partial
from flask_socketio import SocketIO
from flask_socketio import Namespace

from werkzeug.middleware.proxy_fix import ProxyFix

Expand All @@ -39,6 +37,8 @@
from app.iris_engine.tasker.celery import set_celery_flask_context
from app.iris_engine.access_control.oidc_handler import get_oidc_client
from app.jinja_filters import register_jinja_filters
from app.models.authorization import ac_flag_match_mask
from app.db import db


class ReverseProxied(object):
Expand All @@ -59,12 +59,6 @@ class AlertsNamespace(Namespace):
APP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_PATH = os.path.join(APP_PATH, 'templates/')

SQLALCHEMY_ENGINE_OPTIONS = {
"json_deserializer": partial(json.loads, object_pairs_hook=collections.OrderedDict),
"pool_pre_ping": True
}

db = SQLAlchemy(engine_options=SQLALCHEMY_ENGINE_OPTIONS) # flask-sqlalchemy
bc = Bcrypt() # flask-bcrypt
ma = Marshmallow()
celery = make_celery(__name__)
Expand All @@ -75,10 +69,13 @@ def ac_current_user_has_permission(*permissions):
"""
Return True if current user has permission
"""
if 'permissions' not in session:
return False

current_user_permissions = session['permissions']
for permission in permissions:

if ('permissions' in session and
session['permissions'] & permission.value == permission.value):
if ac_flag_match_mask(current_user_permissions, permission.value):
return True

return False
Expand Down Expand Up @@ -129,7 +126,7 @@ def ac_current_user_has_manage_perms():
]}})


app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1)
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1)
#app.wsgi_app = store.wsgi_middleware(app.wsgi_app)

socket_io = SocketIO(app, cors_allowed_origins="*")
Expand Down
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 @@ -10,7 +10,7 @@

# revision identifiers, used by Alembic.
from app.alembic.alembic_utils import _table_has_column
from app.models.models import CompromiseStatus
from app.models.assets import CompromiseStatus

revision = '4ecdfcb34f7c'
down_revision = 'a929ef458490'
Expand Down
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')

Loading
Loading