Latest / Blue Security / Offboarding employees
Transcript
- 0:06Welcome to the Blue Security Podcast, a weekly podcast for
- 0:10information security defenders where we bring you discussions
- 0:13on best practices, tools, and implementation for enterprise
- 0:16security. Now here are your house for
- 0:19today's show, Andy JA and Adam Brewer.
- 0:22Welcome to this week's episode of the Blue Security Podcast.
- 0:25I'm Andy, your host. I'm Adam, your Co host.
- 0:28So it has been a few years since I have worked the help desk and
- 0:34one of the things that we did that most organizations do at
- 0:39the help desk level is when an employee gets terminated or
- 0:43released, you have to off board them.
- 0:46And most organizations have a checklist to do that.
- 0:49But it's always good to go over and review what some of those
- 0:53recommendations might be because I found this article from friend
- 0:58of the show, a practical 365 blog, which I was on their
- 1:03podcast a few months ago. This was written by someone
- 1:07named James Yip and as well as Microsoft has a formal learn
- 1:14document that also goes through on how to remove former
- 1:18employees. And you know, taking a look at
- 1:20them, there's a couple different things.
- 1:23So I think it's always good to check your termination checklist
- 1:28and what you do compared to what others might do, what Microsoft
- 1:31might recommend. And so that's what we're going
- 1:33to talk about today. So the first thing is really
- 1:36interesting on both of the learned document and in James
- 1:43blog post, it says to go into M365 and block the user
- 1:50explicitly. I've actually never done this
- 1:54step as a first step. I've always just gone on to AD
- 1:57and disabled the users, which is like Step 3 in kind of what the
- 2:02lists go through, what they go through and they say first thing
- 2:05you knew is to go ahead and block the sign in via the M365
- 2:11admin and this will block the user from signing in any new
- 2:15sign insurance into the system. However, any existing sign
- 2:19insurance will still be there for 60 ish minutes depending on
- 2:24when it was done, which is just part of the authentication
- 2:28process. And So what you could do is go
- 2:33ahead and force all of those sessions to be logged out
- 2:37immediately. There is a Microsoft Graph
- 2:39PowerShell commandlet to do this.
- 2:41It's called Revoke MG user sign in Sessions.
- 2:45And so you can go ahead and revoke all those sessions via
- 2:48PowerShell. And then you know that not only
- 2:51are they blocked from new sign insurance, the existing sign
- 2:54insurance will be forced to log I.
- 2:55I want to make one point there. So Microsoft has been migrating
- 2:59all of its applications to something called Continuous
- 3:03Access Evaluation or CAE. And one of the benefits of that
- 3:07versus the old model where Andy mentioned in passing the 60
- 3:11minutes potential maximum lifetime, CAE can revoke access
- 3:17in near real time and so that commandlet will help with that.
- 3:20However, not everything uses Continuous Access Evaluation
- 3:24today. You may find some applications
- 3:26that don't, and 3rd party applications are out of scope
- 3:29for it because they use SAML instead of things like Open ID
- 3:33Connect. And so depending on the mix of
- 3:36applications the user uses, there is the possibility of some
- 3:40token still having some lifetime left in them that can't be
- 3:43revoked. Whether it's an access token
- 3:45that can't be revoked in kind of old school Open ID Connect,
- 3:49whether it's SAML token lifetimes that can't be revoked,
- 3:52whatever the case may be, don't. Don't be shocked if you run into
- 3:57some scenarios where a user stays in for a little bit after
- 4:01you have done both of these steps.
- 4:02The block sign in and revoke all sign in sessions with the
- 4:07PowerShell commandlet there. There's just not a magic silver
- 4:10bullet that invalidates everything in one shot.
- 4:13However, within about 60 minutes at the most, the user should be
- 4:17unable to access anything. Yeah.
- 4:19And this is on the cloud side. So the next thing that actually
- 4:24Microsoft recommends is to save the contents of the mailbox if
- 4:29needed. We're going to talk about more
- 4:31on the data itself, but if there is a need to keep the contents
- 4:39of the mailbox for specifically like litigation, you can use a
- 4:44litigation holder in place hold on the mailbox before the user
- 4:47is deleted. That way the contents will stay.
- 4:51Now if your enterprise plan, your M365 plan includes
- 4:56archiving and legal hold and litigation might be a
- 5:00possibility and you have a technically strong IT
- 5:03department, this is the best method to maintain and retain
- 5:07the contents of the mailbox. The biggest thing that you have
- 5:10to remember though is when you convert the mailbox to an
- 5:13inactive mailbox through litigation or a legal hold, I
- 5:17should say. Only administrators, compliance
- 5:20officers, records management managers can view the contents
- 5:26of that mailbox through in place ediscovery tools in Exchange
- 5:31Online. Nobody else can.
- 5:33So that's one thing to keep in mind if you need to view the
- 5:38contents. If you do it through a legal
- 5:40hold within Microsoft Purview, which is the compliance portal,
- 5:45then only the compliance administrators and and global
- 5:48admins will have access to the mailbox via the E discovery
- 5:53tools and content search within Purview.
- 5:56There are other ways. I think it's pretty well known
- 6:00that you can convert the user's mailbox into a shared mailbox.
- 6:04If you do that, then again, all the existing e-mail and
- 6:08calendars will be retained and you can assign people to it just
- 6:12like any other shared mailbox. One thing to remember with this
- 6:16is that you can at some point revert it back to a private
- 6:20mailbox if needed. However, if that mailbox is over
- 6:2550 gigabytes, then you'll need to assign a license to it.
- 6:29If it's under 50 gigs, you do not need to assign a license to
- 6:32it. And then finally, you can also
- 6:35just forward the e-mail to another employee like the
- 6:38manager or peer to monitor in case there's things that are
- 6:42ongoing if you don't want to convert it to a shared mailbox.
- 6:45As I said before, my first step was always to disable the on
- 6:50premise AD account. And if it is an on premise ID,
- 6:56you eventually will need to do this because that ID is always,
- 7:01you know, if it's a synced ID, you're going to have to disable
- 7:04it on Prem. And then of course, make sure
- 7:06that you probably do an intra connect Dirsync right to make
- 7:12sure that the synchronization is done.
- 7:15Otherwise, I mean, you could wait, but if you wait, you know,
- 7:18you might, it might be up to an hour before the Dirsync happens.
- 7:22And so you'll probably have to manually push a Dirsync which
- 7:26requires a an administrator at at at some point.
- 7:31I think it's an Exchange administrator in order to do
- 7:33that. Couple other things on the list.
- 7:35You know some people do this. They can reset the user's
- 7:38password to something random. I think that's like ACYA thing
- 7:42to make sure that the terminated employee doesn't have their
- 7:47password anymore. So you just set it to something
- 7:49random. Well, and that's another benefit
- 7:51too. When you change a user's
- 7:52password and it does synchronize to entry ID, that also
- 7:56invalidates all of their current access tokens.
- 7:59So if your your script failed, the commandlet didn't work.
- 8:03The resetting password is kind of how you described it Andy, as
- 8:07CYA, where if any of these steps failed the disabling this or
- 8:11that, it kind of is that belt and suspenders approach to it.
- 8:15So it it has a lot of useful benefits.
- 8:17You should definitely do it when it.
- 8:19Comes to the devices a lot of different options.
- 8:21If you're using Intune, you can submit a selective app or
- 8:27device, wipe, retire the device, and wipe it within Intune.
- 8:31Definitely want to do this for any you know.
- 8:34Most of the time it's mobile devices.
- 8:36I think most companies will use Intune when they at least start
- 8:40with Intune. It's iOS and Android very easily
- 8:44to easy to do to just send the wipe and reset from the portal
- 8:50and now that only will wipe the corporate data.
- 8:54It doesn't like wipe the device itself.
- 8:56So just make sure that you select that.
- 8:58You can also use an active sync wipe request as well.
- 9:02Like a lot of times if Intune is not deployed or the end user is
- 9:07using like a non Microsoft app like the Mail app built into iOS
- 9:11or say the Gmail app within Outlook to view their corporate
- 9:17e-mail, then they might be using active sync to retrieve the
- 9:21mailbox contents. And so you can perform a active
- 9:25sync wipe as well. If you're using Intune to manage
- 9:29say desktop desktop operating systems, so Windows or Mac OS,
- 9:37you can again do the wipe of the device with an Intune.
- 9:41I think where it gets a little bit more difficult is if you are
- 9:46using on premise like domain joined or hybrid domain joined
- 9:51devices. Obviously if they're within the
- 9:53office, you can just retrieve the device and have at it, you
- 9:56know, whatever you need to do with the device, either retrieve
- 10:00contents of the locally or you would just go ahead and wipe the
- 10:04device. If the user is remote, that gets
- 10:06a little bit more difficult. You can disable the computer
- 10:10object within AD, but the device needs to have line of sight to
- 10:15AD in order to get that computer disabled.
- 10:19Because by default if it's domain joined or hybrid domain
- 10:24joined, the user's credentials are cached when the user logs
- 10:27in. And I think it's what, like 30
- 10:31days or something like that before the device loses domain
- 10:35trust or could be even longer than that.
- 10:37So if they don't connect to say VPN or something like that,
- 10:41which if you disable their account, that might just
- 10:44automatically, you know, not be able to connect to VPN.
- 10:49And so now they won't be able to have line of sight, but they'll
- 10:51still be able to use their device.
- 10:54That gets a little bit kludgy. So, you know, kind of, I don't
- 10:59know what organizations do if they have remote workers, they
- 11:02just like request them to send it in, but there's no guarantee
- 11:05that they're not continuing to use the information.
- 11:08They wouldn't be able to access stuff in M365.
- 11:10But anything that they have locally, especially if they're
- 11:13not using some sort of DLP or you know, sensitivity labels
- 11:19within M365, that those contents are just free game, right?
- 11:25Let me take a couple more kicks at that dead horse you're in.
- 11:28You walk through all of these dependencies and these layers of
- 11:31dependencies. And if you turn this off, then
- 11:33this might break and you don't have line of sight.
- 11:36Just cloud join your devices. Just cloud manage your devices
- 11:40in a modern go anywhere, do anything workplace.
- 11:45You can't have these 1999 two thousand era dependencies where
- 11:51you assume that every device sits on the same corporate
- 11:54network the whole time. It's crazy.
- 11:55It's time to modernize. So here's yet another little
- 11:59shove in that direction because to your point, Andy, I mean, my
- 12:03goodness, it's you kind of have to almost draw an architecture
- 12:06diagram to figure out how your dependencies are layered and in
- 12:09what order you have to do things in.
- 12:10And it's like booting up the orbital Lander in Apollo 13 or
- 12:15whatever when they had to go through the checklist in exactly
- 12:17the right order. Otherwise it would blow the
- 12:20circuits. I mean, it's it's kind of crazy
- 12:22at this point. So cloud join your devices.
- 12:24Yeah, I just, I think obviously the, if you're using domain
- 12:29joined devices in a in a fashion that we used to do it where
- 12:33everyone would go to the office and be on the corporate Internet
- 12:35and and you can just grab the device from the user, that's
- 12:39fine. But in this day and age with
- 12:42remote workers, that's where I think it starts to really get
- 12:45difficult to ensure, right? Like you have some sort of trust
- 12:51if the user is leaving the organization and, and it's all
- 12:55good, but what happens if it's a contentious termination and
- 12:57they're remote? How are you going to get that
- 13:00device without guaranteeing some sort of data integrity without
- 13:04anything being leaked? It's very difficult unless
- 13:08you're using other things like Purview, like for example with
- 13:12Microsoft at Microsoft, because Adam and I do work for
- 13:15Microsoft. If you're listeners of the show,
- 13:18everything that we do in M365 is automatically labeled.
- 13:21And if there is sensitive information that is discovered,
- 13:24it gets labeled with a sensitive label that's higher
- 13:27confidentiality, you know, more confident or sensitive or
- 13:30whatever. And that is encrypted.
- 13:32And so if someone leaves the organization and you still have
- 13:35that data on your device, say it's domain joint, we don't
- 13:39really have that anymore, but say it is and I have that
- 13:42information. Well, as soon as I try to access
- 13:45the information, it checks the cloud for my active account.
- 13:49And if I don't have an active account and I can't authenticate
- 13:52to it anymore, guess what? I can't access that data.
- 13:55I can't access that PowerPoint, I can't access that Word
- 13:57document. So there are ways to mitigate
- 14:01the risk. But as Adam and I have discussed
- 14:03on this show, data protection and data security has almost
- 14:07always been extremely low on the totem pole.
- 14:10So if you're still using hybrid join devices, I highly doubt
- 14:15that you have a mature data protection, data security
- 14:19program where you're actually doing DLP and labeling
- 14:22documents. So that's where I'm saying like
- 14:25that is, you know, like Adam says, give you the little nudge
- 14:30to move into that cloud managed device because it's just going
- 14:32to get a lot easier. When it comes to OneDrive for
- 14:34Business, you know, let's say you are using OneDrive for
- 14:37Business. If you're using something else,
- 14:40you'll have ways to assign someone else that data.
- 14:43I know that at a previous organization we used Box and
- 14:46there is ways to essentially assign someone else to their Box
- 14:50data just like that. In Microsoft you can do
- 14:55delegation for OneDrive for Business.
- 14:56So you can authorize another user, usually like their direct
- 15:00manager or something like that, to have access to that employs
- 15:02OneDrive for Business, which allows you to recover the files.
- 15:05And then of course, you always want to remove their M365
- 15:09license if they're terminated. No need to continue to have the
- 15:13license unless for some reason you need to continue to log into
- 15:17their account. I, I do know that there are
- 15:19exceptions when you know for some reason you need to keep
- 15:22that user active, you need to continue to log in.
- 15:24But like I said here, you can delegate a OneDrive for
- 15:28Business. You can do that, you know,
- 15:29assign someone else for their SharePoint, so on and so forth.
- 15:33So once you remove the license, at some point, you can remove
- 15:37the user account. You can either delete it.
- 15:40I know some organizations don't like deleting users, but I don't
- 15:44know, I, I don't see a reason why you need to keep the account
- 15:47if they're not there anymore after a certain period of time.
- 15:49Maybe you can wait 90 days and and then remove the account.
- 15:52But I see old accounts sitting in either Active Directory or
- 15:58M365 as a risk itself. Because if the account is there,
- 16:03most of the time you haven't like removed permissions to
- 16:06everything for that account and there's some something that's
- 16:09hidden or whatever. And if an attacker comes by,
- 16:12there is a get access to the account, you know, they might
- 16:15have access that you don't know about.
- 16:17So I always think at some point you need to do a cleanup and
- 16:20remove the account completely. Yeah, agree.
- 16:22That is still a tax surface effectively.
- 16:25And even if you're doing a lot of the things we talked about,
- 16:28you're disabling it, you're changing the password built in
- 16:31suspenders approach to your point, Andy, it still may have
- 16:34latent permissions. And it's not impossible for
- 16:39attacker effectively to very silently re enable that account
- 16:43and change the password and blend right in with the
- 16:46day-to-day activities of the help desk.
- 16:49And now they have a user account that no one's really monitoring
- 16:52isn't going to really arise any suspicion unless somebody's
- 16:56really paying attention. And yeah, pretty nice, pretty
- 16:59nice weigh in to gain some lateral movement or an initial
- 17:02foothold. So I agree you don't want those
- 17:04hanging out long term. I actually got this question
- 17:06from an organization that's looking at purview sensitive
- 17:12information labels, which is, you know, what happens if I'm
- 17:16the owner of a of an encrypted document, a highly sensitive
- 17:20information document, or I've shared it with Adam and it's
- 17:26only the two of us who are collaborating on this super
- 17:28secret document and one of us gets let go.
- 17:31How do you take care of those issues?
- 17:34Because now the person who is managing the document or has
- 17:38access has left the organization.
- 17:39Well, and before you unpack like how to solve for this esoteric
- 17:43possibility, the first response you would get would be.
- 17:46Don't do that. Don't allow users to create
- 17:49custom permissions. They should instead be using a
- 17:51defined label and if it is a very small group of people who
- 17:55should have access to that sensitivity label, so be it.
- 17:58Certainly organizations have things like pre release earnings
- 18:01when they're a publicly traded company and very few people can
- 18:04see those before they're released to Wall Street.
- 18:06It's a legal compliance thing, an SEC compliance thing that you
- 18:10would still not just let your your people in your finance
- 18:13group just create custom permissions, you would have a
- 18:15label to find for them. So in general, don't do this.
- 18:18It is very recommended against letting users create custom
- 18:21permissions. But if you do, and there's like,
- 18:25to Andy's point, a a set of one or two people who can read it,
- 18:28then what do you do? There is a solution.
- 18:30Yeah, and it isn't very smooth, I should say.
- 18:36I, I've never actually done it in mass.
- 18:39But The thing is, is that it's pretty rare that, like Adam
- 18:42said, it's pretty rare that this happens.
- 18:44And it's even more rare that there's multiple things that you
- 18:48need to do all at once. So James in his article wrote
- 18:53about this, and I've also had some experience with this in the
- 18:56past. There is something called a
- 18:58super user within the Azure RMS Rights Management service.
- 19:04It's a very special user. And when you set it up, I don't
- 19:09think there's actually anyone who's assigned to that user.
- 19:12You have to actually assign specific people to that user and
- 19:16then you have to escalate to that when you need it.
- 19:19So it's something to monitor and be really controlled about it
- 19:25because again, it does have these super user rights and the
- 19:29the rights include down grading or removing the sensitivity
- 19:34label completely so you can unencrypted if you need to and
- 19:39open up the permissions. So it's essentially just a, a
- 19:42super user. It's it's a, you get to do
- 19:44whatever you want when it comes to that rights management of a
- 19:48document, any M365 content that has sensitivity labels to it,
- 19:53you can do whatever you need to do to it.
- 19:54So when you know if this ever comes up, you can make sure that
- 19:59number one have a super user assigned, which I believe you
- 20:02need a global admin in order to do that.
- 20:05And they're two different permissions.
- 20:07Just because you have global admin does not mean that you
- 20:10have super user. Azure Rights Management Service
- 20:15powers, so you got to assign someone to it and then if the
- 20:19time comes you can use that power to give access to the
- 20:25document if needed. Yeah, you should have your
- 20:28alerting set up on this, almost like it's a honeypot.
- 20:31If someone is using this, it should set off all sorts of
- 20:34flashing lights and warning bells and everything else
- 20:38because of how powerful it is. And again, if you're doing it
- 20:42right, it should be so rarely needed.
- 20:46It should almost be like a break glass account.
- 20:48Same thing. I mean it it like the honeypot.
- 20:51It should set off everything if it gets touched because it
- 20:54should not in in normal circumstances.
- 20:57So it's there, but it it's behind the glass case, it's
- 21:00breaking case of emergency. Don't use this on a day-to-day
- 21:03basis. Exactly.
- 21:06And then a couple other things to keep in mind.
- 21:09This was also from James and I thought it was really good
- 21:11stuff. As you have more things deployed
- 21:14within M365, you you accumulate more and more data.
- 21:21And so there might be some other things that you might want to
- 21:25address when you're removing user accounts.
- 21:29For example, meeting recordings. If the meeting is organized by
- 21:35the user that's getting terminated, that's usually
- 21:38stored in their OneDrive. I'm not sure a lot of people are
- 21:41actually aware of that, so you might want to consider moving
- 21:45those files before the user is disabled to like say, a
- 21:48SharePoint site. And then Teams chats are also
- 21:53stored on Microsoft's Team servers.
- 21:55And so if you want to have a copy of whoever is taking over
- 22:00that terminated users work, you might want to do like an export
- 22:05of all the references messages just in case.
- 22:09So yeah, so those are a few things to keep in mind.
- 22:11But overall I thought this was a really good overview and and
- 22:15just kind of a review because there were some things in here
- 22:18that I haven't done at previous organizations when I worked the
- 22:21help desk. And so I thought this was a
- 22:23really good to review, especially there have been new
- 22:26things that have been added over the years, new services like at,
- 22:30at previous organizations, I wasn't using teams and so, you
- 22:34know, and we didn't record meetings a lot.
- 22:36So like stuff like that, I think it's always good to take a look.
- 22:40So I, I learned a lot and hopefully you know, listening to
- 22:43this you, you might double check your employee termination
- 22:46checklist. Yeah, absolutely.
- 22:48And the Teams recordings being part of OneDrive, we covered
- 22:52OneDrive delegation and thinking about that already, that would
- 22:55be inclusive of that. And then just one other note on
- 22:58the Teams chat, I think your call out is good.
- 23:01You could use E discovery to do an export if you want to share
- 23:04it with say a new person coming on board.
- 23:08So they have that historical context.
- 23:10But just just a clarifying point and this isn't terribly
- 23:14relevant, but I think our listener and viewer base would
- 23:18find this interesting. Teams chats are actually stored
- 23:21in two different locations. So if it's like a one-on-one
- 23:24chat, or even just a group chat with me and some other people,
- 23:28and it's outside the context of a team, then those are stored in
- 23:32my Exchange mailbox. They're part of that, which
- 23:35makes sense because it's the same concept as I'm sending
- 23:39messages to other people like as Adam.
- 23:41However, if I'm conversing in a chat that's part of a team, then
- 23:47those are stored with the Teams files actually in SharePoint
- 23:51Online and in also there there's like an Exchange shared mailbox
- 23:55kind of thing under the covers too.
- 23:57And it's it's kind of split between those Ediscovery knows
- 24:01where to find it. So it's not terribly relevant to
- 24:04you, but just in case you were curious, Teams for the most part
- 24:07does a lot of its underlying storage and management and
- 24:11inherits all of that from Exchange, SharePoint and
- 24:13OneDrive, which is why it kind of shipped out-of-the-box with a
- 24:17pretty full feature set of like compliance and retention and all
- 24:20those features because it then it inherited them anyhow.
- 24:23Just I always find that interesting and like to point
- 24:26that out to folks that there isn't really like a quote UN
- 24:28quote separate Teams data store. It's actually in generally an
- 24:32Exchange or SharePoint Online all.
- 24:34Right, well, hopefully everyone learned something today.
- 24:40That's our episode. Thanks for watching and
- 24:42listening. As always, our contact
- 24:44information will be in the show notes as well as the links to
- 24:47the Learn document and James blog The Practical 3.
- 24:51If you have any questions or topics you want us to talk about
- 24:53in the future, just e-mail us or hit us up on our socials.
- 24:58Thanks. We'll talk to you guys next
- 24:59week. Thank you for listening to the
- 25:01Blue Security Podcast. Please check out the show notes,
- 25:04catch up on episodes you may have missed, and subscribe so
- 25:07you don't miss any future episodes.
- 25:09Find Andy on Twitter at a Jaw Zero and Adam at AJ Brewer.
- 25:13See you at our next episode.