Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brute force login protection / mitigation #1256

Closed
trinode opened this issue Oct 1, 2017 · 9 comments
Closed

Brute force login protection / mitigation #1256

trinode opened this issue Oct 1, 2017 · 9 comments
Labels
Milestone

Comments

@trinode
Copy link

trinode commented Oct 1, 2017

In order to protect against brute force attacks of the API / admin front-end, would it be possible to implement some mechanism that after repeated login attempts prevented you from authenticating from that IP address for either configurable period of time, or an exponential time.

For example:
5 failed attempts = 10 mins, 5 more another 10 minute period (which could be configured).
or:
After 3 failed logins, you can't log in for 1 minute, 3 more and it's 5 minutes etc.

Obviously those don't need to be the exact numbers, just something to make unauthorised parties efforts to get in be not worthwhile.

@G07cha
Copy link
Contributor

G07cha commented Oct 17, 2017

I wasn't able to find much of existing solutions for Go because it's usually handled on balancer's level, the only package that I've found called defender, it's really small and supports only ban for a fixed time. If we need something more complex, I'd like to work on it.

@deviantony
Copy link
Member

Thinking about it, I'm not sure that this should be part of Portainer. You could have a reverse-proxy in front of your Portainer instance that could limite request rate for example... or use another specialized software to do so.

cc @ncresswell

@deviantony deviantony added status/discuss and removed kind/enhancement Applied to Feature Requests labels Oct 19, 2017
@trinode
Copy link
Author

trinode commented Oct 19, 2017

I wouldn't mind how simple it was but knowing that a default install of portainer was a little more secure would be very reassuring.

In my case I'd be concerned about having to run multiple instances of a proxy for this purpose. I'm using swarm and have no need for a proxy as it (swarm) routes all the traffic for me, so this would be extra instance(s) on small VMs only for that purpose.

in the simplest case:

Login request -> failed -> log attempt to db

Login request ->
check count(*) from login_failures where failure_timepoint > now() - 5 minutes ->
if > n don't even check password, deny (show message telling user to wait)
otherwise check_password

(and also delete old login failures to keep things clean)

Basically my reason for selecting portainer was low resource use and simplicity of installation / configuration, requiring a proxy would somewhat negate that

@ncresswell
Copy link
Member

ncresswell commented Oct 19, 2017 via email

@deviantony deviantony added kind/enhancement Applied to Feature Requests and removed status/discuss labels Oct 19, 2017
@G07cha
Copy link
Contributor

G07cha commented Oct 24, 2017

Should we start with something basic as @trinode proposed or try to come up with more advanced behavior?

@deviantony
Copy link
Member

@G07cha what about starting with a simple implementation using defender?

@G07cha
Copy link
Contributor

G07cha commented Oct 24, 2017

@deviantony, sure, just wanted to confirm that

@julio-matarranz
Copy link

👍 Any updates please ?

@deviantony
Copy link
Member

No ETA on this yet.

@deviantony deviantony modified the milestones: 1.16.x, 1.17.0 May 7, 2018
xAt0mZ pushed a commit that referenced this issue Aug 25, 2022
* feat(environment): introduce nomad [EE-1866] (#1308)

* feat(nomad): support nomad in edge stack EE-2467 (#1179)

* init commit for supporting nomad edge stack

* update job parser

* refactor edge stack update logic

* comment fix

* simplify nomad job file naming

* tag updates

* update nomad stack deployment type logic

* update deployment type logic

* feat(nomad): EE-2474 allow agent to register itself as an EdgeAgentOnNomadEnvironment

* feat(nomad) EE-2504 show nomad endpoint on homepage (#1202)

* feat(nomad) EE-2504 add nomad icon

* feat(nomad) EE-2504 show nomad endpoint on homepage

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* feat(nomad) EE-2507 nomad environment setup screen (#1203)

* feat(nomad) EE-2507 nomad environment setup screen

* EE-2533 support nomad type in edge group create (#1228)

* feat(nomad) EE-2508 snapshot nomad (#1244)

* feat(nomad) EE-2562 enable creation of edge group and stack (#1245)

* feat(nomad) BE: count nomad as an edge endpoint

* feat(nomad) FE: count nomad as an edge endpoint

* feat(nomad) FE: show button of nomad deployment type

* feat(nomad) FE: add nomad hcl form

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* feat(nomad) EE-2510 dashboard for nomad (#1256)

* feat(nomad) EE-2510 navigate to nomad.dashboard when click nomad endpiont

* feat(nomad) EE-2510 add nomad module skeleton

* feat(nomad) EE-2510 add DashboardItem component

* feat(nomad) EE-2510 add RunningStatus component

* feat(nomad) EE-2510 add react hook for loading environment

* feat(nomad) EE-2510 add react hook for loading environment ID

* feat(nomad) EE-2510 add dashboard view of nomad

* feat(nomad) EE-2510 cleanup code

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* feat(nomad): left side menu for nomad [EE-2564] (#1261)

* feat(nomad): left side menu for nomad [EE-2564]

* support NOMAD as an endpoint type

* add tests + story

* add endpoint information to applicationState

* fixes based on suggestions in azure work

* feat(nomad): add nomad job events handler EE-2515 (#1251)

* add nomad job events handler

* update subhandler logic

* init datastore for nomad handler

* move events to task level

* Feat(nomad) EE-1866/EE-2512 nomad job list view (#1301)

* feat(nomad) EE-2512 add skeleton of job list

* feat(nomad) EE-2512 add onReload callback function for PageHeader

* feat(nomad) EE-2512 add refresh button to update snapshot

* feat(nomad) EE-2512 collect more tasks and allocations information to snapshot

* feat(nomad) EE-2512 populate data from snapshot to jobs table

* feat(nomad) EE-2512 enable filter for task status column of tasks table

* feat(nomad) EE-2512 store SubmitTime as unix seconds instead of unix microseconds

* feat(nomad) EE-2512 format Created time

* feat(nomad) EE-2512 format StartedAt time

* feat(nomad) EE-2512 add actions for tasks table

* feat(nomad) EE-2512 upgrade module @fortawesome/fontawesome-free

* feat(nomad) EE-2512 add actions for jobs table

* feat(nomad) EE-2512 color task state

* feat(nomad) EE-2512 remove link from job name

* feat(nomad) EE-2512 add job actions

* feat(nomad) EE-2512 add delete job endpoint

* feat(nomad) EE-2512 add delete job method for nomad client

* feat(nomad) EE-2512 add delete job rest

* feat(nomad) EE-2512 call delete job rest

* feat(nomad) EE-2512 add loading spinner to PageHeader

* feat(nomad) EE-2512 show loading spinner when refresh jobs

* feat(nomad) EE-2512 add namespace to related nomad client interface

* feat(nomad) EE-2512 display namespace column for jobs table

* feat(nomad) EE-2512 pass namespace to endpoint when deleting a job

* feat(nomad) EE-2512 display spinner when deleting jobs

* feat(nomad) EE-2512 refresh jobs table after deleting jobs

* feat(nomad) EE-2512 cleanup code

* feat(nomad) EE-2512 set endpoint ID when entering nomad environment

* feat(nomad) EE-2512 show dash for tasks when no snapshot is available

* feat(nomad) EE-2512 update jobs view header title and desc

* feat(nomad) EE-2512 align action icons center for jobs and tasks tables

* Revert "feat(nomad) EE-2512 upgrade module @fortawesome/fontawesome-free"

This reverts commit 4318ef8167359daad1136f8d3aa369cff5509803.

* feat(nomad) EE-2512 downgrad module @fortawesome/fontawesome-free

* feat(nomad) EE-2512 add web editor form for nomad edge stack

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* feat(nomad): task events handler updates EE-2732 (#1307)

* task event handler updates

* Update api/http/handler/nomad/handler.go

* Update api/http/handler/edgestacks/edgestack_create.go

Co-authored-by: Chaim Lev-Ari <chiptus@users.noreply.github.com>

* fix typo

* feat(environments): show nomad name and icon in table [EE-2692] (#1322)

* feat(app): add nomad icon

* refactor(environments): generate endpoint type name

* feat(environments): show nomad icon

* refactor(nomad): folder structure and rq [EE-2750] (#1319)

* feat(nomad): populate cluster info [EE-2755] (#1325)

* feat(wizard): add nomad env [EE-2749] (#1320)

* feat(nomad) EE-2739 remove nomad address input box (#1337)

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* refactor(nomad): use useMutation to delete jobs (#1332)

* feat(nomad): EE-2517 support retrieving nomad task logs (#1297)

* add nomad task logs handler

* stream change

* update nomad log streaming logic

* task logs handler updates

* add offset param and cleanup

* rename tunnelAddress

* feat(nomad) EE-2754 refresh jobs and snapshot (#1329)

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* feat(nomad) EE-1866/EE-2514 nomad events view (#1311)

* feat(nomad) EE-2514 add more info to nomad task for task events

* feat(nomad) EE-2514 nomad job events view

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* feat(nomad) EE-1866/EE-2509 nomad edit edge stack (#1343)

* feat(nomad) EE-2509 save changes when editing nomad edge stack

* feat(nomad) EE-2509 rewrite EdgeStackDeploymentTypeSelector with react

* feat(nomad) EE-2509 disable invalid deployment type buttons when edge groups change

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* fix(deployment): fix copy button [EE-2780] (#1352)

* fix(deployment): fix copy button [EE-2780]

* fix displayed agent version

* feat(nomad) EE-1866/EE-2519 pass env vars to agent installation command (#1355)

* fix(wizard): remove nomad address and add copy button (#1346)

* extra checks and improvements

* feat(nomad) EE-1866/EE-2766 make nomad token optional (#1357)

Co-authored-by: Simon Meng <simon.meng@portainer.io>

Co-authored-by: Hui <arris_li@hotmail.com>
Co-authored-by: cong meng <mcpacino@gmail.com>
Co-authored-by: Simon Meng <simon.meng@portainer.io>
Co-authored-by: itsconquest <william.conquest@portainer.io>

* fix conflicts

* fix(environments): show nomad details when associated (#1353)

* refactor(nomad): make additional changes [EE-2776] (#1349)

* fix(nomad): fix nomad module file for release [EE-2789] (#1366)

* fix(nomad) EE-2794 fix validation of tunnel (#1368)

* fix(nomad) EE-2794 fix validation of tunnel

* fix(nomad) EE-2794 set tunnel to ideal only when hitting connection refused error

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* fix(edge): show kube and nomad edge devices [EE-2790] (#1373)

fix [EE-2790]

* feat(nomad-log): added nomad log (#1365)

* feat(nomad-log): decode log data

* feat(nomad-log): added nomad logs component

* feat(nomad-log): added nomad-log-viewer component

* feat(nomad-log): uploaded log link url

* feat(nomad-log): updated error message

* feat(nomad-log): update how AbortController works.

* feat(nomad-log): fixed AbortController

* feat(nomad-log): only show no logs place holder when auto refresh is off

* fix(nomd) EE-2793 nomad de-associate produces error (#1370)

* fix(nomad) EE-2793 allow users to de-associate a nomad endpoint

* fix(nomad) EE-2793 display correct platform name

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* fix(nomad) EE-2817 fix nil reference (#1383)

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* fix(nomad) EE-2804 allow authenticated users to get events and logs (#1377)

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* fix(app): remove link from nav tabs [EE-2795] (#1372)

* feat(nomad/jobs): remove delete button [EE-2805] (#1375)

* fix(wizard): add env vars field to nomad [EE-2792] (#1371)

* fix(nomad): use font icon instead of png [EE-2799] (#1374)

* fix(nomad) EE-2758 update text of agent buttons (#1390)

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* fix(nomad) EE-2806 fix browse button (#1378)

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* feat(nomad-log): close API connection when component is destroyed (#1387)

* Fix(nomad) EE-2823 nomad misc fixes (#1397)

* fix(nomad) EE-2823 replace text 'jobs' with 'nomad jobs'

* fix(nomad) EE-2823 make job actions column un-sortable

* fix(nomad) EE-2823 click job action to expand the sub row of tasks

* fix(nomad) EE-2823 update nomad logo with transparent bakcgorund

* fix(nomad) EE-2823 display tooltip for Nomad Authentication Toggle

* fix(nomad) EE-2823 add warning of not support https

* fix(nomad) EE-2823 add the icon of nomad edge stack button

* fix(nomad) EE-2823 display pending status in yellow color

* fix(nomad) EE-2823 add space after the power button icons

Co-authored-by: Simon Meng <simon.meng@portainer.io>

* fix(edge): show nomad envs on edge groups [EE-2819] (#1388)

* fix(nomad): fix display of edge polling interval for release [EE-2827] (#1392)

* fix(edge): allow use of dynamic groups with nomad [EE-2839] (#1398)

fixes [EE-2839]

* fix(progress-bar): removed overrided css of angular-loading-bar (#1402)

* fix(edge/stacks): redirect to correct edit type [EE-2831] (#1403)

* prettier changes

* fix(home): load nomad env

* fix(env): rename getDashboardRoute

* refator: remove empty returns

* feat(home): show nomad icon and stats

* refacotr(env): remove PlatformNames

* refactor(home): remove unused files

* fix(edge): calculate is unassociated correctly

* refactor(edge): remove unused functions

* fix(environment): show platform type

* refactor(wizard): remove unused prop

* refactor: remove named returns

* feat(nomad) EE-1866 fix go.mod

* feat(nomad) EE-1866 add nomad command generator fucntion

* feat(nomad) EE-1866 fix download URL for nomad agent script

* fix(app): hide copied text

* feat(edge): add nomad scripts

* refactor(edge): use one place for all scripts

* rename script element to appease TS

* fix: nomad script

* fix: nomad script format

Co-authored-by: Dmitry Salakhov <to@dimasalakhov.com>
Co-authored-by: Hui <arris_li@hotmail.com>
Co-authored-by: Simon Meng <simon.meng@portainer.io>
Co-authored-by: itsconquest <william.conquest@portainer.io>
Co-authored-by: Chaim Lev-Ari <chiptus@users.noreply.github.com>
Co-authored-by: fhanportainer <79428273+fhanportainer@users.noreply.github.com>
Co-authored-by: Chaim Lev-Ari <chiptus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants