-
Notifications
You must be signed in to change notification settings - Fork 77
Conversation
Makes sense. And the |
Yes. I plan on automating this bit here in our repos. Basically, when a commit is merged into the repo I will run |
user.ChangePasswordAtNextLogin = false | ||
nullFields = append(nullFields, "change_password_next_login") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the issue with this implementation, as when a user logs in this field would be set to false outside of terraform. However, it also provides a functionality to admins that allows them to use terraform to enforce a user to change their password on next login. I'm wondering if we can fix the bugs we've found with this and document (not a fan of red tape but not seeing many other options) the pitfalls of settings this to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would be awesome but the problem is that user password reset is asynchronous. That is, the admin trips the flag and the user, when they reset, trips it back. So in this case terraform cannot truly be the authoritative source of truth as the state can and should change outside of the terraform flow. If you do want terraform to be authoritative on passwords, you really have to track and manage the passwords entirely through terraform. Obviously this poses its own problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I don't see a logical way to provide admins with a way to flip a bit once that would allow them to enforce the "change password" logic on update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still ironing out #120 but the changes here look good.
If you'd prefer I can rebase this on master without the changes from #120 to get this merged sooner. |
@joshua-rutherford if it's no trouble, there's still a bit of thinking/ironing out on #120 to do I believe |
bea59f4
to
007549e
Compare
@DeviaVir, I have rebased on master but there is one question I have for you. Since I was basing this on #120 I did touch the update logic in creation. Do you want me to add that there because right now creating an existing GSuite user will not set the password or force a user to change their password. That may or may not be desired. |
That's for the import on creation function right? I think we'd not want to touch passwords for existing users either so it makes sense to leave that out (or take it out if it currently does do that) |
At present, if you define a resource that corresponds to a resource in GSuite already and you define the |
Yes, long as we document clearly that we only set |
fb01e53
to
c408fdd
Compare
Updated to only touch passwords on creation of new accounts and added descriptive comments to example. |
c408fdd
to
7c0d54c
Compare
7c0d54c
to
033b298
Compare
This is based on #120 so that should be merged first, but this simply makes it so the user's password and hash function are fully ignored after creation.
Expected usage is now:
or (following recommended best practices):