Skip to content

Commit

Permalink
[MRG] Merge pull request #400 from dfir-iris/develop
Browse files Browse the repository at this point in the history
[FIX] Missing license header
  • Loading branch information
whikernel authored Feb 21, 2024
2 parents a722e45 + 44c1154 commit 19f510f
Show file tree
Hide file tree
Showing 114 changed files with 88 additions and 281 deletions.
33 changes: 32 additions & 1 deletion CODESTYLE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
# Coding style

If you wish to develop in DFIR-IRIS, please make sure to read the following tips.
If you wish to develop in DFIR-IRIS, please make sure to read the following tips.

## License header

New files should be prefixed by the following license header, where `${current_year}` is replaced by the current year
(for instance 2024):
```
# IRIS Source Code
# Copyright (C) ${current_year} - DFIR-IRIS
# contact@dfir-iris.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
```

## Python coding rules

* do not prefix files with any shebang, such as:
```python
#!/usr/bin/env python3
```

## Commits
Try to follow the repository convention :
Expand Down
2 changes: 0 additions & 2 deletions scripts/gunicorn-cfg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
3 changes: 0 additions & 3 deletions source/app/blueprints/activities/activities_routes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
#
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/alerts/alerts_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2023 - DFIR-IRIS
# contact@dfir-iris.org
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/api/api_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
8 changes: 0 additions & 8 deletions source/app/blueprints/case/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand All @@ -17,9 +15,3 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

# IMPORTS ------------------------------------------------

# VARS ---------------------------------------------------

# CONTENT ------------------------------------------------
2 changes: 0 additions & 2 deletions source/app/blueprints/case/case_assets_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS) - DFIR-IRIS Team
# ir@cyberactionlab.net - contact@dfir-iris.org
Expand Down
4 changes: 1 addition & 3 deletions source/app/blueprints/case/case_comments.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# DFIR-IRIS Team
# contact@dfir-iris.org
Expand Down Expand Up @@ -56,4 +54,4 @@ def case_comment_update(comment_id, object_type, caseid):
return response_success("Comment edited", data=comment_schema.dump(comment))

except marshmallow.exceptions.ValidationError as e:
return response_error(msg="Data error", data=e.normalized_messages(), status=400)
return response_error(msg="Data error", data=e.normalized_messages(), status=400)
2 changes: 0 additions & 2 deletions source/app/blueprints/case/case_graphs_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS) - DFIR-IRIS Team
# ir@cyberactionlab.net - contact@dfir-iris.org
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/case/case_ioc_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS) - DFIR-IRIS Team
# ir@cyberactionlab.net - contact@dfir-iris.org
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/case/case_notes_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS) - DFIR-IRIS Team
# ir@cyberactionlab.net - contact@dfir-iris.org
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/case/case_rfiles_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS) - DFIR-IRIS Team
# ir@cyberactionlab.net - contact@dfir-iris.org
Expand Down
4 changes: 1 addition & 3 deletions source/app/blueprints/case/case_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS) - DFIR-IRIS Team
# ir@cyberactionlab.net - contact@dfir-iris.org
Expand Down Expand Up @@ -453,4 +451,4 @@ def case_review(caseid):

db.session.commit()

return response_success("Case review updated", data=CaseSchema().dump(case))
return response_success("Case review updated", data=CaseSchema().dump(case))
2 changes: 0 additions & 2 deletions source/app/blueprints/case/case_tasks_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS) - DFIR-IRIS Team
# ir@cyberactionlab.net - contact@dfir-iris.org
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/case/case_timeline_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS) - DFIR-IRIS Team
# ir@cyberactionlab.net - contact@dfir-iris.org
Expand Down
7 changes: 0 additions & 7 deletions source/app/blueprints/context/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand All @@ -18,8 +16,3 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

# IMPORTS ------------------------------------------------

# VARS ---------------------------------------------------

# CONTENT ------------------------------------------------
4 changes: 1 addition & 3 deletions source/app/blueprints/context/context.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down Expand Up @@ -51,7 +49,7 @@ def set_ctx():
:return: Page
"""
if not current_user.is_authenticated:
return redirect(not_authenticated_redirection_url())
return redirect(not_authenticated_redirection_url(request.full_path))

ctx = request.form.get('ctx')
ctx_h = request.form.get('ctx_h')
Expand Down
4 changes: 1 addition & 3 deletions source/app/blueprints/dashboard/dashboard_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down Expand Up @@ -79,7 +77,7 @@ def logout():
track_activity("user '{}' has been logged-out".format(current_user.user), ctx_less=True, display_in_ui=False)
logout_user()

return redirect(not_authenticated_redirection_url(request_url='/'))
return redirect(not_authenticated_redirection_url('/'))


@dashboard_blueprint.route('/dashboard/case_charts', methods=['GET'])
Expand Down
3 changes: 0 additions & 3 deletions source/app/blueprints/datastore/datastore_routes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
#
#
# IRIS Source Code
# Copyright (C) 2022 - DFIR IRIS Team
# contact@dfir-iris.org
Expand Down
4 changes: 1 addition & 3 deletions source/app/blueprints/demo_landing/demo_landing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down Expand Up @@ -56,4 +54,4 @@ def demo_landing():
iris_version=iris_version,
demo_domain=demo_domain,
demo_users=demo_users
)
)
3 changes: 0 additions & 3 deletions source/app/blueprints/dim_tasks/dim_tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python3
#
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/filters/filters_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2023 - DFIR-IRIS
# contact@dfir-iris.org
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/login/login_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_access_control.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_alerts_status_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_analysis_status_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_assets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_assets_type_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_attributes_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_case_classifications.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_case_state.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_case_templates_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_cases_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_customers_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_evidence_types_route.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_groups.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_ioc_types_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_modules_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_objects_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
4 changes: 1 addition & 3 deletions source/app/blueprints/manage/manage_severities_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down Expand Up @@ -83,4 +81,4 @@ def search_analysis_status(caseid):

# Serialize the severity and return them in a JSON response
schema = SeveritySchema(many=True)
return response_success("", data=schema.dump(severity))
return response_success("", data=schema.dump(severity))
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_srv_settings_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
4 changes: 1 addition & 3 deletions source/app/blueprints/manage/manage_tags.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# contact@dfir-iris.org
#
Expand Down Expand Up @@ -95,4 +93,4 @@ def manage_tags_suggest(caseid) -> Response:

return app.response_class(response=json.dumps(tags, cls=AlchemyEncoder),
status=200,
mimetype='application/json')
mimetype='application/json')
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_task_status_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_templates_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_tlps_routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
2 changes: 0 additions & 2 deletions source/app/blueprints/manage/manage_users.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# IRIS Source Code
# Copyright (C) 2021 - Airbus CyberSecurity (SAS)
# ir@cyberactionlab.net
Expand Down
Loading

0 comments on commit 19f510f

Please sign in to comment.