Identity defense

Lessons on BloodHound CE, AD CS, and Entra: what a member count, a validity start, a client app, or a resource name does not prove.

  • 25 lessons
  • 5 h of reading
  • 3 topics

Most intrusions end with an identity: a delegated right nobody remembered, a certificate template that lets a user choose who it names, a legacy protocol that skips MFA. These lessons find those conditions in your own directory, fix them, and measure again to prove the fix.

Collect directory data under a change ticket, from an admin workstation, with the SOC told in advance.

  1. 01BloodHound CE for defenders: measure who can reach Tier ZeroCollect your lab domain with SharpHound under an approved change, load it into BloodHound Community Edition, and count the users and computers with any path to Domain Admins.13 min
  2. 02Closing an attack path in AD and proving it with a second collectionRemove an over-broad delegation found in BloodHound, re-collect the lab domain, compare the Tier Zero path count before and after, and catch a second path the first fix exposed.12 min
  3. 03BloodHound: a path diagram is a map, not an eventA BloodHound path shows relationships that were in the collected directory data. It does not show that anyone used them. Write the collection time, the edge types, and the object names.11 min
  4. 04BloodHound: a path count belongs to the zip you nameA path count is true for the collection zip that was loaded. Write the zip filename and when you ran the query. The picture does not print the zip, so a bare number cannot be compared with another day.11 min
  5. 05BloodHound: the object id is the directory objectA node’s name is a label from the collection. The object id is the directory identifier stored with it. Write the id. Do not merge two nodes because the names match.11 min
  6. 06BloodHound: a high-value mark is a tagA high-value mark on a node is a tag stored with that collection. Write the tag and the zip. It does not say the object was attacked, and it is not a change ticket.11 min
  7. 07BloodHound: a member count is this collectionA member count on a group node is how many membership edges that collection stored. It is not a live directory query you did not run. Write the count with the zip, and do not treat it as today’s group.11 min
  1. 01Auditing AD Certificate Services templates for escalation risksAudit your lab’s AD CS certificate templates for the misconfigurations known as ESC1 and ESC4, using read-only queries, Locksmith, and Certipy find, and fix them in the template settings.13 min
  2. 02AD CS: a template finding is configuration, not an intrusionA template finding lists settings a checker flagged. Copy the template name, the CA, and those settings. Do not rewrite the finding as a certificate that was issued or a sign-in that happened.11 min
  3. 03AD CS: an issued-certificate row is not a sign-inA row from the CA’s issued-certificate view shows a request id, a requester, a subject, and a not-after time. It does not show that the certificate was used to sign in.11 min
  4. 04AD CS: disposition is the request’s stateThe disposition on a CA request row is the state the CA recorded. Issued, pending, and denied are different. Write the word on the row. A pending row is not a certificate, and a denied row is not a sign-in.11 min
  5. 05AD CS: the serial number is not the request idOn an issued certificate, the serial number identifies that certificate. The request id identifies the CA request. Write both. Do not look up one with the other number.11 min
  6. 06AD CS: not-before is the validity startNot-before on an issued certificate is when that certificate’s validity starts. The request’s submission time is a different field. Write the one you have, and do not treat the validity start as the moment the request was submitted.11 min
  1. 01Entra ID sign-in logs: read one record from status to Conditional AccessRead a Microsoft Entra ID sign-in record field by field, including the error code, authentication requirement, Conditional Access result, and risk, and pull the same data with Microsoft Graph PowerShell.11 min
  2. 02Hunting password spray in Entra sign-in logs, then testing a policy in report-onlyWrite KQL over SigninLogs that separates password spray from one user’s typos, then use Conditional Access report-only results to see who a new policy would block before enforcing it.12 min
  3. 03Entra: what one sign-in row can say about user, app, and placeOne Entra sign-in row can show the account, the application, and the IP address recorded for that sign-in. The city is a lookup. The row is not a list of what the person opened.12 min
  4. 04What to write before you disable an accountA path, a template finding, or one sign-in row is not by itself a reason to disable an account. Write what the tool showed, what it did not show, who approved, and how the action is undone.12 min
  5. 05Entra: each Conditional Access policy has its own resultThe sign-in has an overall Conditional Access status, and each applied policy has its own result. Write the policy name and that result. Overall success does not mean every policy passed.12 min
  6. 06Entra: a sign-in id is one recordEach sign-in row has its own id. The same account on two ids is two records. Write the id with the time and the IP. Do not merge the rows into one event because the account matches.11 min
  7. 07Entra: the user id is not the sign-in nameuserId on a sign-in is the directory object. userPrincipalName is the name on that row. Write the object id. Do not merge two ids because the sign-in name matches, or split one id because the name changed.11 min
  8. 08Entra: the auth requirement is about this sign-inauthenticationRequirement says what this sign-in required. It does not list the methods registered on the account, and it does not replace each Conditional Access policy’s own result.12 min
  9. 09Entra: the sign-in time is not when the account was createdThe time on a sign-in row is when that record was created. The user object’s created time is a different field on a different object. Write the one you actually opened.11 min
  10. 10Entra: the risk level is not the error codestatus.errorCode is how this sign-in attempt ended. riskLevelDuringSignIn is the risk service’s label on the same record. Write both. A zero error code does not clear the risk label.12 min
  11. 11Entra: the client app is this sign-inclientAppUsed on a sign-in row is the client recorded for that sign-in. It is not every client the account has used. Write the value with the sign-in id, and do not generalize from one row.11 min
  12. 12Entra: the resource name is not the app nameappDisplayName is the application on the sign-in. resourceDisplayName is the resource, when that field is present. Write the field you have. Do not copy one name into the other.12 min