Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

The Variables in "RestrictedADGroups" and "AllowedADGroups" in appsettings.json aren't being honored. #333

Closed
LeftShoeAT2ShoesDE opened this issue Sep 6, 2019 · 15 comments
Assignees
Labels
wontfix Problem, or not; this won't be fixed here at least.

Comments

@LeftShoeAT2ShoesDE
Copy link

PassCore Server

  • OS: Windows Server 2008R2
  • Provider: Active Directory
  • Settings file (without sensitive information):
    appsettings.json.txt

Describe the bug
The Variables in RestrictedADGroups and AllowedADGroups in
[IIS_ROOT]\PassCore\appsettings.json
aren't being honored. I can, without failure, change any domain-admin passwords I like (given I know the origianal PW of course), even though only the members of the AD-Group "ExternalUsers" should be allowed to update their passwords. Please analyse my settings an tell me if I missed something.

To Reproduce
Steps to reproduce the behavior:
normal use

Expected behavior
only allow users that are members of the AD-Group "ExternalUsers"

Screenshots
NOT APPLICABLE

Desktop (please complete the following information):

  • OS: Windows 10 1903, Mac OsX
  • Browser MS EDGE, Opera, safari in Mac OsX
  • Version Windows 10 1903, Mac OsX 10.14.6

Additional context
Add any other context about the problem here.

@geoperez
Copy link
Member

geoperez commented Sep 6, 2019

Your settings look fine. Let me take a look in the code.

@LeftShoeAT2ShoesDE
Copy link
Author

LeftShoeAT2ShoesDE commented Sep 6, 2019 via email

@geoperez
Copy link
Member

Are you running the Windows provider or LDAP (Linux) Provider?

@LeftShoeAT2ShoesDE
Copy link
Author

LeftShoeAT2ShoesDE commented Sep 18, 2019 via email

@Serk352 Serk352 assigned geoperez and unassigned Serk352 Sep 18, 2019
@LeftShoeAT2ShoesDE
Copy link
Author

Good day Señior Perez, any updates on this issue?

I would greatly appreciate an update.

@geoperez
Copy link
Member

Hi, we did some testing on our end, buy @Serk352 was not able to reproduce. I'm going to give a try again by myself.

@geoperez
Copy link
Member

Quick question, can you post the log file? Sometimes the AD is not returning properly the user's groups and this might bypass the groups check.

@LeftShoeAT2ShoesDE
Copy link
Author

Which log do you need and where may I locate it?

@geoperez
Copy link
Member

geoperez commented Oct 1, 2019

You may need to activate, check step 9 https://github.com/unosquare/passcore#installation-on-iis

@geoperez
Copy link
Member

geoperez commented Oct 6, 2019

Did you get the logs?

@LeftShoeAT2ShoesDE
Copy link
Author

HI sorry for the delay: here is the relevant part of the log

info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 POST http://[URL]/PassCore/api/password application/json 117
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
      Route matched with {action = "Post", controller = "Password"}. Executing action Unosquare.PassCore.Web.Controllers.PasswordController.Post (Unosquare.PassCore.Web)
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
      Executing action method Unosquare.PassCore.Web.Controllers.PasswordController.Post (Unosquare.PassCore.Web) with arguments (Unosquare.PassCore.Web.Models.ChangePasswordModel) - Validation state: Valid
info: Unosquare.PassCore.PasswordProvider.PasswordChangeProvider[0]
      PerformPasswordChange for user adm-passcore
warn: Unosquare.PassCore.PasswordProvider.PasswordChangeProvider[0]
      Using AutomaticContext
fail: Unosquare.PassCore.PasswordProvider.PasswordChangeProvider[888]
      ValidateGroups
Unosquare.PassCore.Common.ApiErrorException: Error Code: ChangeNotPermitted
**The User principal is listed as restricted**
   at Unosquare.PassCore.PasswordProvider.PasswordChangeProvider.ValidateGroups(UserPrincipal userPrincipal) in C:\Unosquare\passcore\src\Unosquare.PassCore.PasswordProvider\PasswordChangeProvider.cs:line 144
dbug: Unosquare.PassCore.PasswordProvider.PasswordChangeProvider[0]
      **The User principal password updated with setPassword**
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
      Executed action method Unosquare.PassCore.Web.Controllers.PasswordController.Post (Unosquare.PassCore.Web), returned result Microsoft.AspNetCore.Mvc.JsonResult in 1363.5664ms.
info: Microsoft.AspNetCore.Mvc.Formatters.Json.Internal.JsonResultExecutor[1]
      Executing JsonResult, writing value of type 'Unosquare.PassCore.Web.Models.ApiResult'.
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
      Executed action Unosquare.PassCore.Web.Controllers.PasswordController.Post (Unosquare.PassCore.Web) in 1480.5211ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 1499.7316ms 200 application/json; charset=utf-8

is there a setting to route the POST-Request over HTTPS?

image

@geoperez
Copy link
Member

geoperez commented Oct 8, 2019

I did some changes to the group validation check. Can you check the latest version, please?

@geoperez
Copy link
Member

geoperez commented Nov 2, 2019

Status?

@LeftShoeAT2ShoesDE
Copy link
Author

LeftShoeAT2ShoesDE commented Nov 5, 2019

Sorry, I unfortunately had more pressing issues to attend to. I'll look into updating this by Friday and will report my findings when I do.

@stale
Copy link

stale bot commented Jan 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Problem, or not; this won't be fixed here at least. label Jan 4, 2020
@stale stale bot closed this as completed Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix Problem, or not; this won't be fixed here at least.
Projects
None yet
Development

No branches or pull requests

3 participants