Skip to content

Commit 0899d7e

Browse files
[18.0][MIG] auth_brute_force: Migration to 18.0
1 parent e5e897b commit 0899d7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1918
-1464
lines changed

auth_brute_force/README.rst

Lines changed: 95 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,72 @@
1-
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
2-
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
3-
:alt: License: AGPL-3
4-
5-
===============================================================
6-
Tracks Authentication Attempts and Prevents Brute-force Attacks
7-
===============================================================
8-
9-
This module registers each request done by users trying to authenticate into
10-
Odoo. If the authentication fails, a counter is increased for the given remote
11-
IP. After a defined number of attempts, Odoo will ban the remote IP and
12-
ignore new requests.
1+
===================================
2+
Authentication - Brute-Force Filter
3+
===================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:619f103b2ff519e702a28bfa3155d8e8984eb1bff7007dd2a9aa3d7ae1566a32
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github
20+
:target: https://github.com/OCA/server-auth/tree/18.0/auth_brute_force
21+
:alt: OCA/server-auth
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/server-auth-18-0/server-auth-18-0-auth_brute_force
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module registers each request done by users trying to authenticate
32+
into Odoo. If the authentication fails, a counter is increased for the
33+
given remote IP. After a defined number of attempts, Odoo will ban the
34+
remote IP and ignore new requests.
35+
1336
This module applies security through obscurity
14-
(https://en.wikipedia.org/wiki/Security_through_obscurity),
15-
When a user is banned, the request is now considered as an attack. So, the UI
16-
will **not** indicate to the user that his IP is banned and the regular message
17-
'Wrong login/password' is displayed.
37+
(https://en.wikipedia.org/wiki/Security_through_obscurity). When a user
38+
is banned, the request is now considered as an attack. So, the UI will
39+
**not** indicate to the user that his IP is banned and the regular
40+
message 'Wrong login/password' is displayed.
41+
42+
This module realizes a call to a web API (http://ip-api.com) to try to
43+
have extra information about remote IP.
44+
45+
**Table of contents**
1846

19-
This module realizes a call to a web API (http://ip-api.com) to try to have
20-
extra information about remote IP.
47+
.. contents::
48+
:local:
2149

2250
Configuration
2351
=============
2452

25-
You can use these configuration parameters
26-
(menu `Settings / Technical / Parameters / System Parameters`) that control
53+
You can use these configuration parameters (menu
54+
``Settings / Technical / Parameters / System Parameters``) that control
2755
this addon behavior:
2856

29-
* ``auth_brute_force.whitelist_remotes`` is a comma-separated list of
57+
- ``auth_brute_force.whitelist_remotes`` is a comma-separated list of
3058
whitelisted IPs. Failures from these remotes are ignored.
3159

32-
* ``auth_brute_force.max_by_ip`` defaults to 50, and indicates the maximum
33-
successive failures allowed for an IP. After hitting the limit, the IP gets
34-
banned.
60+
- ``auth_brute_force.max_by_ip`` defaults to 50, and indicates the
61+
maximum successive failures allowed for an IP. After hitting the
62+
limit, the IP gets banned.
3563

36-
* ``auth_brute_force.max_by_ip_user`` defaults to 10, and indicates the
64+
- ``auth_brute_force.max_by_ip_user`` defaults to 10, and indicates the
3765
maximum successive failures allowed for any IP and user combination.
3866
After hitting the limit, that user and IP combination is banned.
3967

40-
* ``auth_brute_force.check_remote`` defaults to True, and indicates if it
41-
it will check the information on http://ip-api.com
68+
- ``auth_brute_force.check_remote`` defaults to True, and indicates if
69+
it it will check the information on http://ip-api.com
4270

4371
Usage
4472
=====
@@ -50,74 +78,77 @@ Logging
5078

5179
This module generates some WARNING logs, in the following cases:
5280

53-
* When the IP limit is reached: *Authentication failed from remote 'x.x.x.x'.
54-
The remote has been banned. Login tried: xxxx.*
81+
- When the IP limit is reached: *Authentication failed from remote
82+
'x.x.x.x'. The remote has been banned. Login tried: xxxx.*
5583

56-
* When the IP+user combination limit is reached:
57-
*Authentication failed from remote 'x.x.x.x'.
58-
The remote and login combination has been banned. Login tried: xxxx.*
84+
- When the IP+user combination limit is reached: *Authentication failed
85+
from remote 'x.x.x.x'. The remote and login combination has been
86+
banned. Login tried: xxxx.*
5987

6088
Screenshot
6189
----------
6290

6391
**List of Attempts**
6492

65-
.. image:: /auth_brute_force/static/description/screenshot_attempts_list.png
66-
67-
68-
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
69-
:alt: Try me on Runbot
70-
:target: https://runbot.odoo-community.org/runbot/149/11.0
71-
72-
For further information, please visit:
73-
74-
* https://www.odoo.com/forum/help-1
93+
https://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/.https://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/.https://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/ https://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/ihttps://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/mhttps://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/ahttps://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/ghttps://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/ehttps://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/:https://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/:https://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force/
94+
https://raw.githubusercontent.com/OCA/server-auth/18.0/auth_brute_force//auth_brute_force/static/description/screenshot_attempts_list.png
7595

7696
Known issues / Roadmap
7797
======================
7898

79-
* Remove 🐒 patch for https://github.com/odoo/odoo/issues/24183 in v12.
99+
- Depending of server and / or user network configuration, the
100+
idenfication of the user can be wrong, and mainly in the following
101+
cases:
80102

81-
* Depending of server and / or user network configuration, the idenfication
82-
of the user can be wrong, and mainly in the following cases:
103+
- If the Odoo server is behind an Apache / NGinx proxy and it is not
104+
properly configured, all requests will use the same IP address.
105+
Blocking such IP could render Odoo unusable for all users! **Make
106+
sure your logs output the correct IP for werkzeug traffic before
107+
installing this addon.**
83108

84-
* If the Odoo server is behind an Apache / NGinx proxy and it is not properly
85-
configured, all requests will use the same IP address. Blocking such IP
86-
could render Odoo unusable for all users! **Make sure your logs output the
87-
correct IP for werkzeug traffic before installing this addon.**
88-
89-
* The IP metadata retrieval should use a better system. `See details here
90-
<https://github.com/OCA/server-tools/pull/1219/files#r187014504>`_.
109+
- The IP metadata retrieval should use a better system.
110+
``See details here <https://github.com/OCA/server-tools/pull/1219/files#r187014504>``\ \_.
91111

92112
Bug Tracker
93113
===========
94114

95-
Bugs are tracked on `GitHub Issues
96-
<https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
97-
check there if your issue has already been reported. If you spotted it first,
98-
help us smash it by providing detailed and welcomed feedback.
115+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/issues>`_.
116+
In case of trouble, please check there if your issue has already been reported.
117+
If you spotted it first, help us to smash it by providing a detailed and welcomed
118+
`feedback <https://github.com/OCA/server-auth/issues/new?body=module:%20auth_brute_force%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
119+
120+
Do not contact contributors directly about support or help with technical issues.
99121

100122
Credits
101123
=======
102124

125+
Authors
126+
-------
127+
128+
* Nitrokey GmbH
129+
* GRAP
130+
* Tecnativa
131+
103132
Contributors
104133
------------
105134

106-
* Sylvain LE GAL (https://twitter.com/legalsylvain)
107-
* David Vidal <david.vidal@tecnativa.com>
108-
* Jairo Llopis <jairo.llopis@tecnativa.com>
135+
- Sylvain LE GAL (https://x.com/legalsylvain)
136+
- David Vidal david.vidal@tecnativa.com
137+
- Jairo Llopis jairo.llopis@tecnativa.com
109138

110-
Maintainer
111-
----------
139+
Maintainers
140+
-----------
141+
142+
This module is maintained by the OCA.
112143

113144
.. image:: https://odoo-community.org/logo.png
114145
:alt: Odoo Community Association
115146
:target: https://odoo-community.org
116147

117-
This module is maintained by the OCA.
118-
119148
OCA, or the Odoo Community Association, is a nonprofit organization whose
120149
mission is to support the collaborative development of Odoo features and
121150
promote its widespread use.
122151

123-
To contribute to this module, please visit https://odoo-community.org.
152+
This module is part of the `OCA/server-auth <https://github.com/OCA/server-auth/tree/18.0/auth_brute_force>`_ project on GitHub.
153+
154+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

auth_brute_force/__manifest__.py

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
1-
# Copyright 2015 GRAP - Sylvain LE GAL
2-
# Copyright 2017 Tecnativa - David Vidal
3-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
41
{
5-
'name': 'Authentication - Brute-Force Filter',
6-
'version': '11.0.1.2.0',
7-
'category': 'Tools',
8-
'summary': "Track Authentication Attempts and Prevent Brute-force Attacks",
9-
'author': "GRAP, "
10-
"Tecnativa, "
11-
"Odoo Community Association (OCA)",
12-
'website': 'https://github.com/OCA/server-tools',
13-
'license': 'AGPL-3',
14-
'depends': [
15-
# If we don't depend on it, it would inhibit this addon
16-
"auth_crypt",
2+
"name": "Authentication - Brute-Force Filter",
3+
"version": "18.0.1.0.0",
4+
"category": "Tools",
5+
"summary": "Track Authentication Attempts and Prevent Brute-force Attacks",
6+
"author": "Nitrokey GmbH, GRAP, Tecnativa, Odoo Community Association (OCA)",
7+
"website": "https://github.com/OCA/server-auth",
8+
"license": "AGPL-3",
9+
"depends": ["base"],
10+
"data": [
11+
"security/ir.model.access.csv",
12+
"views/res_authentication_attempt_views.xml",
1713
],
18-
'data': [
19-
'security/ir_model_access.yml',
20-
'views/view.xml',
21-
'views/action.xml',
22-
'views/menu.xml',
23-
],
24-
'installable': True,
14+
"installable": True,
2515
}

auth_brute_force/i18n/am.po

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ msgstr ""
1919
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
2020

2121
#. module: auth_brute_force
22-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
22+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
2323
msgid "Add remote to whitelist"
2424
msgstr ""
2525

@@ -35,7 +35,7 @@ msgid "Authentication Result"
3535
msgstr ""
3636

3737
#. module: auth_brute_force
38-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
38+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
3939
#: selection:res.authentication.attempt,result:0
4040
msgid "Banned"
4141
msgstr ""
@@ -56,7 +56,7 @@ msgid "Display Name"
5656
msgstr ""
5757

5858
#. module: auth_brute_force
59-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
59+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
6060
#: selection:res.authentication.attempt,result:0
6161
msgid "Failed"
6262
msgstr ""
@@ -97,17 +97,17 @@ msgid "Remote IP metadata"
9797
msgstr ""
9898

9999
#. module: auth_brute_force
100-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
100+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
101101
msgid "Remove remote from whitelist"
102102
msgstr ""
103103

104104
#. module: auth_brute_force
105-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
105+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
106106
msgid "Set to unbanned"
107107
msgstr ""
108108

109109
#. module: auth_brute_force
110-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
110+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
111111
#: selection:res.authentication.attempt,result:0
112112
msgid "Successful"
113113
msgstr ""
@@ -118,7 +118,7 @@ msgid "Tried Login"
118118
msgstr ""
119119

120120
#. module: auth_brute_force
121-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
121+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
122122
#: selection:res.authentication.attempt,result:0
123123
msgid "Unbanned"
124124
msgstr ""
@@ -134,7 +134,7 @@ msgid "Whitelisted"
134134
msgstr ""
135135

136136
#. module: auth_brute_force
137-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
137+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
138138
msgid "Without Success"
139139
msgstr ""
140140

auth_brute_force/i18n/ar.po

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ msgstr ""
2020
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
2121

2222
#. module: auth_brute_force
23-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
23+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
2424
msgid "Add remote to whitelist"
2525
msgstr ""
2626

@@ -36,7 +36,7 @@ msgid "Authentication Result"
3636
msgstr ""
3737

3838
#. module: auth_brute_force
39-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
39+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
4040
#: selection:res.authentication.attempt,result:0
4141
msgid "Banned"
4242
msgstr ""
@@ -57,7 +57,7 @@ msgid "Display Name"
5757
msgstr "اسم العرض"
5858

5959
#. module: auth_brute_force
60-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
60+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
6161
#: selection:res.authentication.attempt,result:0
6262
msgid "Failed"
6363
msgstr ""
@@ -98,17 +98,17 @@ msgid "Remote IP metadata"
9898
msgstr ""
9999

100100
#. module: auth_brute_force
101-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
101+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
102102
msgid "Remove remote from whitelist"
103103
msgstr ""
104104

105105
#. module: auth_brute_force
106-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
106+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_form
107107
msgid "Set to unbanned"
108108
msgstr ""
109109

110110
#. module: auth_brute_force
111-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
111+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
112112
#: selection:res.authentication.attempt,result:0
113113
msgid "Successful"
114114
msgstr ""
@@ -119,7 +119,7 @@ msgid "Tried Login"
119119
msgstr ""
120120

121121
#. module: auth_brute_force
122-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
122+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
123123
#: selection:res.authentication.attempt,result:0
124124
msgid "Unbanned"
125125
msgstr ""
@@ -135,7 +135,7 @@ msgid "Whitelisted"
135135
msgstr ""
136136

137137
#. module: auth_brute_force
138-
#: model:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
138+
#: model_terms:ir.ui.view,arch_db:auth_brute_force.view_res_authentication_attempt_search
139139
msgid "Without Success"
140140
msgstr ""
141141

0 commit comments

Comments
 (0)