Querying WHOIS/Registration Data Access Protocol (RDAP) with Azure Sentinel and Azure Functions

Published Sep 29 2021 12:44 PM 2,496 Views
Microsoft

With the amazing increase in domains and top-level domains (TLD's) on the Internet, it's difficult to know just where our users are going. Newly registered domains, domain generation algorithms, and typo-squatting are all tactics used by adversaries to compromise users. Recently I was talking with a customer about Azure Sentinel and they had a question about if and how they could raise an alert when a user received an email from a newly registered domain (by their definition this was any domain that had been registered in the last thirty days).  While we don't have a built-in feature for this in Sentinel, it is possible to extend Sentinel to include this type of functionality. This blog post is about one way that such an extension could be created. 

 

Domain registration history

 

First off, we need to understand domain registrations in general. To be usable on the Internet, all domain names must be registered so they can be propagated throughout the global DNS world. This information is created with a domain registrar or their resellers who are accredited by the Internet Corporation for Assigned Names and Numbers (ICANN), a not-for-profit public-benefit corporation who defines the policies and rules around domain registration. A simplified process flow is that when a domain is requested, the registrar will check if the domain name is available for registration and if so, will then create a "WHOIS" record with the domain name registrant's information.  WHOIS is a protocol defined by the Internet Engineering Taskforce (IETF) in RFC3912. WHOIS is a TCP based connection using port 43 and responds in a human readable format. Each registrar maintains their WHOIS infrastructure, and you often must know just which registrar is authoritative for a particular domain.  To keep the telephone book analogy going it's kind of like knowing that a person named "Matt Egen" exists somewhere in a telephone book in the world, but without knowing exactly where he is, you'd have to check all the telephone books around the world to find him. While this is fine for looking up occasional data (and back in 1985 there were a lot fewer domains (as well as much fewer Top-Level Domains (TLD) like .com, .net, .org, etc.)), it’s rather difficult to automate the process as the data isn't designed to be read by a machine.  To counter this and account for not only the growing domain count but the invention of new "Generic Top Level Domains" (gTLD) like .store, .app, etc, ICANN and the Internet Engineering Task Force (IETF) came up with a new protocol called the Registration Data Access Protocol (RDAP).  RDAP is a REST API with the same information as the traditional WHOS service, except its data is returned in a standardized JSON format. This makes it rather straightforward in parsing the returned data (although it still maintains a problem in finding the correct RDAP server / source to begin with, but we can deal with that) and automating the process.

 

Extending Azure Sentinel with Azure Functions

 

Azure Sentinel offers us several tools we can use to automate tasks.  One method is to use Playbooks which are based on Azure Logic Apps and these provide an outstanding solution for creating a visual flow in your automation process.  We could have used one here (in fact, in the v1 of this solution I did exactly that), however, there is another method we can use as well:  Azure Functions. Azure Functions is a cloud service available on-demand that provides all the continually updated infrastructure and resources needed to run your applications. You focus on the pieces of code that matter most to you, and Functions handles the rest. Functions provides serverless compute for Azure. You can use Functions to build web APIs, respond to database changes, process IoT streams, manage message queues, and more.  In this case, we’re going to use an Azure Function with a timer trigger to handle our RDAP query and run it on a regular schedule.

 

Architecture and process flow

 

The example follows a straightforward flow:

 

  1. On a regular schedule the Azure Function will trigger.
  2. The Function will query the Azure Sentinel instance and call a Function which will get new domain names.  We’re using a Function in Sentinel because we want it to be flexible and maintainable outside of the Azure Function.  This means we can modify it whenever we have / want a new source of domain names.  In this example we’re using the domains returned from the DeviceEvents table which comes from the Microsoft Defender 365 data connector.  However, by using a Function it could be from any or multiple source(s) so long as it’s returned in the expected format.  By using a Function and leveraging joins, we can handle all the sources we want.
  3. Using the returned domains, we will then call the RDAP “Bootstrap” service.  This is a special list of all of the gTLDs and their requisite RDAP server endpoints.  Think of this as a phone book of phone books.
  4. After getting the correct RDAP server, we then query it and get the results in JSON notation.
  5. We take the relevant information (in this example this is just the registration date) and then call back into our Azure Sentinel instance to store the data in a custom log table.
  6. Finally there is an Analytic Rule which runs against this custom log and if it finds a domain that is younger than the set criteria, it raises an alert.

 

Required Information for this example

 

Since we’re going to be accessing data in an Azure Sentinel instance we need some information to enable that.

 

Creating the Sentinel Function

 

To retrieve the domain names that we want to resolve, we’re using a Sentinel Function. While it has a similar name to an Azure Function, it’s different. A Sentinel Function is written in the Kusto Query Language (KQL) and is a query that you save and then call later using an alias. You can use a Function in place of a table and use it like any other table. I’m not going to go too deep into the use cases or creation of Functions, but for our case we’re using it as a convenient tool so that we can maintain the query outside of our Azure Function and tune / adjust it as needed for different environments. If you like to learn more about Sentinel Functions, you can read about them here:  Functions in Azure Monitor log queries - Azure Monitor | Microsoft Docs.  For this use case, we’re going to show a straightforward example that calls into the DeviceNetworkEvents table, cleans up some of the data, checks to make sure it’s not in an exclusion list and finally that it’s not been already looked up in the last 90 days.

 

// Function Name: GetDomainsForRDAP
// ExcludedDomains is a dynamic list of domains and TLDs to not bother searching for
// either because we already trust them, or perhaps we know they don’t have an RDAP server implementation.
let ExcludedDomains = dynamic(["cn","io", "ms", "microsoft.com","somerandomsender.com"]);
// Query the DeviceNetworkEvents table for the last 1 hour
DeviceNetworkEvents
| where TimeGenerated >= ago(1h)
| where isnotempty(RemoteUrl) //only return records that have a RemoteUrl value
// A little cleanup just in case
| extend parsedDomain = case(RemoteUrl contains "//", parse_url(RemoteUrl).Host, RemoteUrl) // handle scenarios where the RemoteUrl includes protocol data (e.g. http/s, etc.)
| extend cleanDomain = split(parsedDomain,"/")[0] // throw away anything after the last “/” character
| extend splitDomain = split(cleanDomain,".") //split the domain name on the “.”
| extend Domain = tolower(strcat(splitDomain[array_length(splitDomain)-2],".",splitDomain[array_length(splitDomain)-1])) // recombine just the last two parts of the domain (the TLD and gTLD)
| extend TLD = splitDomain[array_length(splitDomain)-1]  // grab the gTLD so we can see if it’s in exclusion list along with the domain
| where TLD !in(ExcludedDomains)
| where Domain !in(ExcludedDomains)
| summarize DistinctDomain = dcount(Domain) by Domain  //De-duplicate the list
| project Domain // return just the domain
// Now join the results above to our table of already resolved domains.  We don’t want to waste cycles querying for things we already know about
//| join kind=leftanti (ResolvedDomains_CL
//| where TimeGenerated >= ago(90d)) on $left.Domain == $right.domainName_s //Uncomment these lines after the FIRST run of the Azure Function.

 

One thing you may notice in the above Sentinel Function: the last two lines are commented out.  This is because until the Azure Function runs the first time, the “ResolvedDomains_CL” custom log table doesn’t exist and this Sentinel Function will fail.  After successfully running the Azure Function one time, you should then uncomment the last two lines. 

 

The Azure Function

 

Now that we have the Sentinel Function out of the way, let’s talk about the Azure Function. As noted before, while having a similar name to a Sentinel Function, Azure Functions are completely different.  Azure Functions is a cloud service available on-demand that provides all the continually updated infrastructure and resources needed to run your applications. You focus on the pieces of code that matter most to you, and Functions handles the rest. Azure Functions can be written in an array of different stacks including .NET, Node.Js, Python, Java, and even PowerShell Core and can be hosted on either Windows or Linux infrastructure. In this case we’re using .NET as the stack, the language is C#, and the infrastructure is Windows.

 

To read data from Azure Sentinel, we need to create Azure AD application credentials with permission to the Azure Sentinel instance

 

Creating an Azure AD Application with read permissions to Azure Sentinel

 

This blog post is already getting a little long so rather than rewrite the steps to create an Azure AD Application, I’m just going to provide a link to my peer Rin Ure’s great blog post on the API’s and creating credentials: Access Azure Sentinel Log Analytics via API (Part 1) - Microsoft Tech Community  The specific permission that we want to make sure we gran to the applications is covered in the linked article under the “Give the AAD Application permissions to your (Sentinel) Log Analytics Workspace” section.  After following the steps in that article, we will have two of the settings that we will need for the RDAP Query engine:  the Client ID and the Client Secret.  We will be using these later when we configure the Azure Function.

 

Ok, so now we have what we need to read the data, but what about writing back our results? To write data to the Azure Sentinel instance, we need the Workspace ID and either the Primary or Secondary key for the workspace.

 

Getting the Workspace ID and Key for Azure Sentinel

 

Azure Sentinel uses Log Analytics as the underlying data store.  To write data to the Log Analytics workspace, we need the workspace ID and Key and can access these very simply in Azure Sentinel. In Sentinel, go to Settings...

 

 

MattEgen_0-1632321618709.png

 

Then, select “Workspace Settings” from the top of the resulting page...

 

MattEgen_1-1632321618715.png

 

And finally, select “Agents Management”

MattEgen_2-1632321618719.png

 

This will take you to a screen that will show you the Workspace ID and two keys, a primary and secondary, that can be used to send data to the workspace...

 

MattEgen_3-1632321618721.png

 

We can use either the primary or the secondary, it doesn’t matter which one we choose just remember to copy and save the Workspace ID and one of the keys as we’re going to need them in the next section.

 

Now that we have the values we need to access Azure Sentinel we are going use then in our Azure Function by storing them in Application Settings.

 

Azure Function – Application Settings

 

As an Azure Function, the example can be configured via . Application settings are encrypted at rest and transmitted over an encrypted channel. Application Settings are exposed as environment variables for access by the application at runtime. This allows us to store keys and values in the Azure Function without having to store them in code. There are two advantages to this: 1) we’re not storing secrets in the actual code itself and 2) we can change them if we need to later.

 

For this Function we use the following Application Settings:

 

"SharedKey": "[LogAnalytics WorkSpace Primary or Secondary Key]",
"WorkspaceID": "[LogAnalytics Workspace ID]",
"LogName": "[The name of the custom log to store results. Recommend:ResolvedDomains]",
"tenant_id": "[AzureAD TenantID]",
"client_id": "[AzureAD Application Client ID]",
"client_secret": "[AzureAD Application Client Secret]",
"grant_type": "[Grant Type for Bearer Token]",
"resource": "[Resource URL for Bearer Token]",
“query_string”,”[The Sentinel function name to call]”

 

These values are used in the C# code that does the actual work in the Azure Function and will be populated from the Application Settings into the code at runtime. This makes it very easy for us to change settings without having to rewrite / redeploy code.  After deploying the application to an Azure Function, we configure the Application Settings on the Configuration blade...

 

MattEgen_4-1632321618734.png

 

 

For each of the settings, simply click the “New Application Setting” button and enter the name and value of the setting...

 

MattEgen_5-1632321618737.png

 

 

Now let’s look at the code and how we can deploy it to an Azure Function.

 

RDAP Query Engine C# Code

 

I’m not going to go through every line in the code, but instead leave that as an exercise for the reader.  Keep in mind this is an example and as such could probably be improved.   The code is hosted on GitHub here: Azure-Sentinel/Tools/RDAP/RDAPQuery at master · Azure/Azure-Sentinel (github.com). However, I’m going to cover the main function and the overall structure.

 

CheckDomains

MattEgen_6-1632321618745.png

 

 

CheckDomains is the initialization point for the code and is called by the Azure Function framework based on a Timer trigger (in fact CheckDomains is an alias for the interal “Run” function that Azure Functions is calling). The timer is set to fire at a set period of time (default every five minutes) and in turn makes all of the other calls to get authentication, retrieve data from Sentinel, query RDAP, and finally write the results back to Sentinel. Let’s map out this function...

[create a visio of the function?]

 

 “QueryData”

MattEgen_7-1632321618756.png

 

 

One of the first things that CheckDomains does is call the QueryData function which is responsible for calling into Azure Sentinel and retrieving any new domains to lookup. It takes one parameter which is the actual query to execute. Since querying the data in Azure Sentinel requires us to authenticate, it first retrieves an OAUTH bearer token (via a call to “GetBearerToken()” and then uses it in the subsequent call to the Log Analytics API.  If we receive a successful status code from the call, we then deserialize the results into a QueryResults object and return it back to the CheckDomains function.

 

After calling QueryData, we run a ForEach() loop over the results, do a little cleanup (by splitting out the top-level domain (.com, .net, etc.) with a split() function) and then call BootStrapTLD.

  

BootStrapTLD()

MattEgen_8-1632321618765.png

 

 

BootStrapTLD takes the passed in top-level domain (TLD) and uses it to call the IANA bootstrap URL at https://data.iana.org/rdap/dns.json (this is hardcoded as it’s supposed to never change) which is a JSON file that has all the different TLDs mapped out with the appropriate RDAP server URL that we can call to get the detailed information about the domain.  We make a call to the JSON file and then deserialize it into a Services object. Since we deserialized the entire list, we then run a foreach loop over the returned values to check for a match with the TLD we’re searching for. When we have a match we then break out of the ForEach and return the value back to CheckDomains()

Now that we have the RDAP server that is responsible for the TLD, it’s time to call it and get the information we want.

 

QueryRDAP

MattEgen_9-1632321618772.png

 

 

This function is very straightforward as it simply calls the passed in URL, deserializes the results (if any) into an RDAPResponse object and then returns that back to CheckDomains.  CheckDomains then parses the returned object to find the “events” node and specifically one with an eventType of “registration”. If we find one, we create a new “RDAPUpdate” object which just holds the domain name we looked up along with the registration date that was returned. This object is then passed to the WriteData function which will store it into Sentinel / Log Analytics.

 

WriteData()

MattEgen_10-1632321618775.png

 

 

WriteData is possibly the simplest function in all of this code as it just takes the passed object, converts it into a JSON string, builds a signature (using the Workspace ID and keys from earlier) and then calls PostData which does the actual write to Sentinel / Log Analytics.

 

PostData()

MattEgen_11-1632321618780.png

 

And finally, PostData() calls the Log Analytics API and commits our data. 

 

So…I’ve got a bunch of domain names and their registration dates, now what?

 

Going back to our original need (alert on domains that are younger than 30 days), we can write a very simple query in the Logs blade of Sentinel to search for these:

 

ResolvedDomains_CL
| where TimeGenerated >= ago(1h)
| where registrationDate_t >= ago(30d)

And to automate this query, we could convert it into an Analytics rule to generate an Incident for an analyst to review by selecting the “New Alert” drop down and choosing “Create Azure Sentinel Alert”

 

MattEgen_12-1632321618785.png

 

Another use case could be to create an enrichment query to add registration data during an investigation.  For example, create a join() between a domain source table and the ResolvedDomains_CL table to add in the registration date for any domains seen, and then add that data to an analytic using the new Custom Details feature.

 

Next steps / further improvements

 

One thing I noticed in creating this example was that not every top-level domain has activated an RDAP server yet. Notably, a number of country TLDs are still using the traditional WHOIS infrastructure (this is why I added the ability to exclude domains and TLD’s in the GetDomainsForRDAP Sentinel Function).  As a next step for this project, I am going to look to add traditional WHOS queries (via a TCP connection to port 43) in cases where RDAP cannot find a domain / receives an error. Also, the code currently doesn’t handle raw IP addresses (either IPv4 or IPv6) and instead just does a lookup and fails. I’m looking at modifying the code to support RDAP queries for IP addresses as well, but since it’s an IP address it doesn’t have a “registration date” per se. Would love some feedback on what you think would be useful information from an IP address.  Look for this update soon.

 

Until next time, happy hunting!

 

 

 

 

 

 

 

 

 

%3CLINGO-SUB%20id%3D%22lingo-sub-2774502%22%20slang%3D%22en-US%22%3EQuerying%20WHOIS%2FRegistration%20Data%20Access%20Protocol%20(RDAP)%20with%20Azure%20Sentinel%20and%20Azure%20Functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2774502%22%20slang%3D%22en-US%22%3E%3CP%3EWith%20the%20amazing%20increase%20in%20domains%20and%20top-level%20domains%20(TLD's)%20on%20the%20Internet%2C%20it's%20difficult%20to%20know%20just%20where%20our%20users%20are%20going.%20Newly%20registered%20domains%2C%20domain%20generation%20algorithms%2C%20and%20typo-squatting%20are%20all%20tactics%20used%20by%20adversaries%20to%20compromise%20users.%20Recently%20I%20was%20talking%20with%20a%20customer%20about%20Azure%20Sentinel%20and%20they%20had%20a%20question%20about%20if%20and%20how%20they%20could%20raise%20an%20alert%20when%20a%20user%20received%20an%20email%20from%20a%20newly%20registered%20domain%20(by%20their%20definition%20this%20was%20any%20domain%20that%20had%20been%20registered%20in%20the%20last%20thirty%20days).%26nbsp%3B%20While%20we%20don't%20have%20a%20built-in%20feature%20for%20this%20in%20Sentinel%2C%20it%20is%20possible%20to%20extend%20Sentinel%20to%20include%20this%20type%20of%20functionality.%20This%20blog%20post%20is%20about%20one%20way%20that%20such%20an%20extension%20could%20be%20created.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--350599179%22%20id%3D%22toc-hId--348691497%22%3E%3CSTRONG%3EDomain%20registration%20history%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%20off%2C%20we%20need%20to%20understand%20domain%20registrations%20in%20general.%20To%20be%20usable%20on%20the%20Internet%2C%20all%20domain%20names%20must%20be%20registered%20so%20they%20can%20be%20propagated%20throughout%20the%20global%20DNS%20world.%20This%20information%20is%20created%20with%20a%20domain%20registrar%20or%20their%20resellers%20who%20are%20accredited%20by%20the%26nbsp%3BInternet%20Corporation%20for%20Assigned%20Names%20and%20Numbers%20(ICANN)%2C%26nbsp%3Ba%20not-for-profit%20public-benefit%20corporation%20who%20defines%20the%20policies%20and%20rules%20around%20domain%20registration.%20A%20simplified%20process%20flow%20is%20that%20when%20a%20domain%20is%20requested%2C%20the%20registrar%20will%20check%20if%20the%20domain%20name%20is%20available%20for%20registration%20and%20if%20so%2C%20will%20then%20create%20a%20%22WHOIS%22%20record%20with%20the%20domain%20name%20registrant's%20information.%26nbsp%3B%20WHOIS%20is%20a%20protocol%20defined%20by%20the%20Internet%20Engineering%20Taskforce%20(IETF)%20in%20%3CA%20href%3D%22https%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc3912%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ERFC3912%3C%2FA%3E.%20WHOIS%20is%20a%20TCP%20based%20connection%20using%20port%2043%20and%20responds%20in%20a%20human%20readable%20format.%20Each%20registrar%20maintains%20their%20WHOIS%20infrastructure%2C%20and%20you%20often%20must%20know%20just%20which%20registrar%20is%20authoritative%20for%20a%20particular%20domain.%26nbsp%3B%20To%20keep%20the%20telephone%20book%20analogy%20going%20it's%20kind%20of%20like%20knowing%20that%20a%20person%20named%20%22Matt%20Egen%22%20exists%20somewhere%20in%20a%20telephone%20book%20in%20the%20world%2C%20but%20without%20knowing%20exactly%26nbsp%3B%3CEM%3Ewhere%3C%2FEM%3E%20he%20is%2C%20you'd%20have%20to%20check%20all%20the%20telephone%20books%20around%20the%20world%20to%20find%20him.%20While%20this%20is%20fine%20for%20looking%20up%20occasional%20data%20(and%20back%20in%201985%20there%20were%20a%20lot%20fewer%20domains%20(as%20well%20as%20much%20fewer%20Top-Level%20Domains%20(TLD)%20like%20.com%2C%20.net%2C%20.org%2C%20etc.))%2C%20it%E2%80%99s%20rather%20difficult%20to%20automate%20the%20process%20as%20the%20data%20isn't%20designed%20to%20be%20read%20by%20a%20machine.%26nbsp%3B%20To%20counter%20this%20and%20account%20for%20not%20only%20the%20growing%20domain%20count%20but%20the%20invention%20of%20new%20%22Generic%20Top%20Level%20Domains%22%20(gTLD)%20like%20.store%2C%20.app%2C%20etc%2C%20ICANN%20and%20the%20Internet%20Engineering%20Task%20Force%20(IETF)%20came%20up%20with%20a%20new%20protocol%20called%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.icann.org%2Frdap%23%3A~%3Atext%3DRegistration%2520Data%2520Access%2520Protocol%2520%2528RDAP%2529%25201%2520RDAP%2520Overview.%2C...%25203%2520RDAP%2520Timeline.%2520...%25204%2520Resources.%2520%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ERegistration%20Data%20Access%20Protocol%3C%2FA%3E%20(RDAP).%26nbsp%3B%20RDAP%20is%20a%20REST%20API%20with%20the%20same%20information%20as%20the%20traditional%20WHOS%20service%2C%20except%20its%20data%20is%20returned%20in%20a%20standardized%20JSON%20format.%20This%20makes%20it%20rather%20straightforward%20in%20parsing%20the%20returned%20data%20(although%20it%20still%20maintains%20a%20problem%20in%20finding%20the%20correct%20RDAP%20server%20%2F%20source%20to%20begin%20with%2C%20but%20we%20can%20deal%20with%20that)%20and%20automating%20the%20process.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-2136913654%22%20id%3D%22toc-hId-2138821336%22%3E%3CSTRONG%3EExtending%20Azure%20Sentinel%20with%20Azure%20Functions%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAzure%20Sentinel%20offers%20us%20several%20tools%20we%20can%20use%20to%20automate%20tasks.%26nbsp%3B%20One%20method%20is%20to%20use%20Playbooks%20which%20are%20based%20on%20Azure%20Logic%20Apps%20and%20these%20provide%20an%20outstanding%20solution%20for%20creating%20a%20visual%20flow%20in%20your%20automation%20process.%26nbsp%3B%20We%20could%20have%20used%20one%20here%20(in%20fact%2C%20in%20the%20v1%20of%20this%20solution%20I%20did%20exactly%20that)%2C%20however%2C%20there%20is%20another%20method%20we%20can%20use%20as%20well%3A%26nbsp%3B%20Azure%20Functions.%20Azure%20Functions%20is%20a%20cloud%20service%20available%20on-demand%20that%20provides%20all%20the%20continually%20updated%20infrastructure%20and%20resources%20needed%20to%20run%20your%20applications.%20You%20focus%20on%20the%20pieces%20of%20code%20that%20matter%20most%20to%20you%2C%20and%20Functions%20handles%20the%20rest.%20Functions%20provides%20serverless%20compute%20for%20Azure.%20You%20can%20use%20Functions%20to%20build%20web%20APIs%2C%20respond%20to%20database%20changes%2C%20process%20IoT%20streams%2C%20manage%20message%20queues%2C%20and%20more.%26nbsp%3B%20In%20this%20case%2C%20we%E2%80%99re%20going%20to%20use%20an%20Azure%20Function%20with%20a%20timer%20trigger%20to%20handle%20our%20RDAP%20query%20and%20run%20it%20on%20a%20regular%20schedule.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-329459191%22%20id%3D%22toc-hId-331366873%22%3E%3CSTRONG%3EArchitecture%20and%20process%20flow%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20example%20follows%20a%20straightforward%20flow%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EOn%20a%20regular%20schedule%20the%20Azure%20Function%20will%20trigger.%3C%2FLI%3E%0A%3CLI%3EThe%20Function%20will%20query%20the%20Azure%20Sentinel%20instance%20and%20call%20a%20Function%20which%20will%20get%20new%20domain%20names.%26nbsp%3B%20We%E2%80%99re%20using%20a%20Function%20in%20Sentinel%20because%20we%20want%20it%20to%20be%20flexible%20and%20maintainable%20%3CEM%3Eoutside%3C%2FEM%3E%20of%20the%20Azure%20Function.%26nbsp%3B%20This%20means%20we%20can%20modify%20it%20whenever%20we%20have%20%2F%20want%20a%20new%20source%20of%20domain%20names.%26nbsp%3B%20In%20this%20example%20we%E2%80%99re%20using%20the%20domains%20returned%20from%20the%20DeviceEvents%20table%20which%20comes%20from%20the%20Microsoft%20Defender%20365%20data%20connector.%26nbsp%3B%20However%2C%20by%20using%20a%20Function%20it%20could%20be%20from%20%3CU%3Eany%3C%2FU%3E%20or%20multiple%20source(s)%20so%20long%20as%20it%E2%80%99s%20returned%20in%20the%20expected%20format.%26nbsp%3B%20By%20using%20a%20Function%20and%20leveraging%20joins%2C%20we%20can%20handle%20all%20the%20sources%20we%20want.%3C%2FLI%3E%0A%3CLI%3EUsing%20the%20returned%20domains%2C%20we%20will%20then%20call%20the%20RDAP%20%E2%80%9CBootstrap%E2%80%9D%20service.%26nbsp%3B%20This%20is%20a%20special%20list%20of%20all%20of%20the%20gTLDs%20and%20their%20requisite%20RDAP%20server%20endpoints.%26nbsp%3B%20Think%20of%20this%20as%20a%20phone%20book%20of%20phone%20books.%3C%2FLI%3E%0A%3CLI%3EAfter%20getting%20the%20correct%20RDAP%20server%2C%20we%20then%20query%20it%20and%20get%20the%20results%20in%20JSON%20notation.%3C%2FLI%3E%0A%3CLI%3EWe%20take%20the%20relevant%20information%20(in%20this%20example%20this%20is%20%3CU%3Ejust%3C%2FU%3E%20the%20registration%20%3CSTRONG%3Edate%3C%2FSTRONG%3E)%20and%20then%20call%20back%20into%20our%20Azure%20Sentinel%20instance%20to%20store%20the%20data%20in%20a%20custom%20log%20table.%3C%2FLI%3E%0A%3CLI%3EFinally%20there%20is%20an%20Analytic%20Rule%20which%20runs%20against%20this%20custom%20log%20and%20if%20it%20finds%20a%20domain%20that%20is%20younger%20than%20the%20set%20criteria%2C%20it%20raises%20an%20alert.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1477995272%22%20id%3D%22toc-hId--1476087590%22%3E%3CSTRONG%3ERequired%20Information%20for%20this%20example%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESince%20we%E2%80%99re%20going%20to%20be%20accessing%20data%20in%20an%20Azure%20Sentinel%20instance%20we%20need%20some%20information%20to%20enable%20that.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--787433798%22%20id%3D%22toc-hId--785526116%22%3E%3CSTRONG%3ECreating%20the%20Sentinel%20Function%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20retrieve%20the%20domain%20names%20that%20we%20want%20to%20resolve%2C%20we%E2%80%99re%20using%20a%20Sentinel%20Function.%20While%20it%20has%20a%20similar%20name%20to%20an%20Azure%20Function%2C%20it%E2%80%99s%20different.%20A%20Sentinel%20Function%20is%20written%20in%20the%20Kusto%20Query%20Language%20(KQL)%20and%20is%20a%20query%20that%20you%20save%20and%20then%20call%20later%20using%20an%20alias.%20You%20can%20use%20a%20Function%20in%20place%20of%20a%20table%20and%20use%20it%20like%20any%20other%20table.%20I%E2%80%99m%20not%20going%20to%20go%20too%20deep%20into%20the%20use%20cases%20or%20creation%20of%20Functions%2C%20but%20for%20our%20case%20we%E2%80%99re%20using%20it%20as%20a%20convenient%20tool%20so%20that%20we%20can%20maintain%20the%20query%20outside%20of%20our%20Azure%20Function%20and%20tune%20%2F%20adjust%20it%20as%20needed%20for%20different%20environments.%20If%20you%20like%20to%20learn%20more%20about%20Sentinel%20Functions%2C%20you%20can%20read%20about%20them%20here%3A%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Flogs%2Ffunctions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EFunctions%20in%20Azure%20Monitor%20log%20queries%20-%20Azure%20Monitor%20%7C%20Microsoft%20Docs%3C%2FA%3E.%26nbsp%3B%20For%20this%20use%20case%2C%20we%E2%80%99re%20going%20to%20show%20a%20straightforward%20example%20that%20calls%20into%20the%20DeviceNetworkEvents%20table%2C%20cleans%20up%20some%20of%20the%20data%2C%20checks%20to%20make%20sure%20it%E2%80%99s%20not%20in%20an%20exclusion%20list%20and%20finally%20that%20it%E2%80%99s%20not%20been%20already%20looked%20up%20in%20the%20last%2090%20days.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%2F%2F%20Function%20Name%3A%20GetDomainsForRDAP%3CBR%20%2F%3E%2F%2F%20ExcludedDomains%20is%20a%20dynamic%20list%20of%20domains%20and%20TLDs%20to%20not%20bother%20searching%20for%3CBR%20%2F%3E%2F%2F%20either%20because%20we%20already%20trust%20them%2C%20or%20perhaps%20we%20know%20they%20don%E2%80%99t%20have%20an%20RDAP%20server%20implementation.%3CBR%20%2F%3Elet%20ExcludedDomains%20%3D%20dynamic(%5B%22cn%22%2C%22io%22%2C%20%22ms%22%2C%20%22microsoft.com%22%2C%22somerandomsender.com%22%5D)%3B%3CBR%20%2F%3E%2F%2F%20Query%20the%20DeviceNetworkEvents%20table%20for%20the%20last%201%20hour%3CBR%20%2F%3EDeviceNetworkEvents%3CBR%20%2F%3E%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(1h)%3CBR%20%2F%3E%7C%20where%20isnotempty(RemoteUrl)%20%2F%2Fonly%20return%20records%20that%20have%20a%20RemoteUrl%20value%3CBR%20%2F%3E%2F%2F%20A%20little%20cleanup%20just%20in%20case%3CBR%20%2F%3E%7C%20extend%20parsedDomain%20%3D%20case(RemoteUrl%20contains%20%22%2F%2F%22%2C%20parse_url(RemoteUrl).Host%2C%20RemoteUrl)%20%2F%2F%20handle%20scenarios%20where%20the%20RemoteUrl%20includes%20protocol%20data%20(e.g.%20http%2Fs%2C%20etc.)%3CBR%20%2F%3E%7C%20extend%20cleanDomain%20%3D%20split(parsedDomain%2C%22%2F%22)%5B0%5D%20%2F%2F%20throw%20away%20anything%20after%20the%20last%20%E2%80%9C%2F%E2%80%9D%20character%3CBR%20%2F%3E%7C%20extend%20splitDomain%20%3D%20split(cleanDomain%2C%22.%22)%20%2F%2Fsplit%20the%20domain%20name%20on%20the%20%E2%80%9C.%E2%80%9D%3CBR%20%2F%3E%7C%20extend%20Domain%20%3D%20tolower(strcat(splitDomain%5Barray_length(splitDomain)-2%5D%2C%22.%22%2CsplitDomain%5Barray_length(splitDomain)-1%5D))%20%2F%2F%20recombine%20just%20the%20last%20two%20parts%20of%20the%20domain%20(the%20TLD%20and%20gTLD)%3CBR%20%2F%3E%7C%20extend%20TLD%20%3D%20splitDomain%5Barray_length(splitDomain)-1%5D%26nbsp%3B%20%2F%2F%20grab%20the%20gTLD%20so%20we%20can%20see%20if%20it%E2%80%99s%20in%20exclusion%20list%20along%20with%20the%20domain%3CBR%20%2F%3E%7C%20where%20TLD%20!in(ExcludedDomains)%3CBR%20%2F%3E%7C%20where%20Domain%20!in(ExcludedDomains)%3CBR%20%2F%3E%7C%20summarize%20DistinctDomain%20%3D%20dcount(Domain)%20by%20Domain%26nbsp%3B%20%2F%2FDe-duplicate%20the%20list%3CBR%20%2F%3E%7C%20project%20Domain%20%2F%2F%20return%20just%20the%20domain%3CBR%20%2F%3E%2F%2F%20Now%20join%20the%20results%20above%20to%20our%20table%20of%20already%20resolved%20domains.%26nbsp%3B%20We%20don%E2%80%99t%20want%20to%20waste%20cycles%20querying%20for%20things%20we%20already%20know%20about%3CBR%20%2F%3E%2F%2F%7C%20join%20kind%3Dleftanti%20(ResolvedDomains_CL%3CBR%20%2F%3E%2F%2F%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(90d))%20on%20%24left.Domain%20%3D%3D%20%24right.domainName_s%20%2F%2FUncomment%20these%20lines%20after%20the%20FIRST%20run%20of%20the%20Azure%20Function.%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20thing%20you%20may%20notice%20in%20the%20above%20Sentinel%20Function%3A%20the%20last%20two%20lines%20are%20commented%20out.%26nbsp%3B%20This%20is%20because%20until%20the%20Azure%20Function%20runs%20the%20first%20time%2C%20the%20%E2%80%9CResolvedDomains_CL%E2%80%9D%20custom%20log%20table%20doesn%E2%80%99t%20exist%20and%20this%20Sentinel%20Function%20will%20fail.%26nbsp%3B%20After%20successfully%20running%20the%20Azure%20Function%20one%20time%2C%20you%20should%20then%20uncomment%20the%20last%20two%20lines.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1700079035%22%20id%3D%22toc-hId-1701986717%22%3E%3CSTRONG%3EThe%20Azure%20Function%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20that%20we%20have%20the%20Sentinel%20Function%20out%20of%20the%20way%2C%20let%E2%80%99s%20talk%20about%20the%20Azure%20Function.%20As%20noted%20before%2C%20while%20having%20a%20similar%20name%20to%20a%20Sentinel%20Function%2C%20Azure%20Functions%20are%20completely%20different.%26nbsp%3B%20Azure%20Functions%20is%20a%20cloud%20service%20available%20on-demand%20that%20provides%20all%20the%20continually%20updated%20infrastructure%20and%20resources%20needed%20to%20run%20your%20applications.%20You%20focus%20on%20the%20pieces%20of%20code%20that%20matter%20most%20to%20you%2C%20and%20Functions%20handles%20the%20rest.%20Azure%20Functions%20can%20be%20written%20in%20an%20array%20of%20different%20stacks%20including%20.NET%2C%20Node.Js%2C%20Python%2C%20Java%2C%20and%20even%20PowerShell%20Core%20and%20can%20be%20hosted%20on%20either%20Windows%20or%20Linux%20infrastructure.%20In%20this%20case%20we%E2%80%99re%20using%20.NET%20as%20the%20stack%2C%20the%20language%20is%20C%23%2C%20and%20the%20infrastructure%20is%20Windows.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20%3CEM%3Eread%3C%2FEM%3E%20data%20from%20Azure%20Sentinel%2C%20we%20need%20to%20create%20Azure%20AD%20application%20credentials%20with%20permission%20to%20the%20Azure%20Sentinel%20instance%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--107375428%22%20id%3D%22toc-hId--105467746%22%3E%3CSTRONG%3ECreating%20an%20Azure%20AD%20Application%20with%20read%20permissions%20to%20Azure%20Sentinel%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20blog%20post%20is%20already%20getting%20a%20little%20long%20so%20rather%20than%20rewrite%20the%20steps%20to%20create%20an%20Azure%20AD%20Application%2C%20I%E2%80%99m%20just%20going%20to%20provide%20a%20link%20to%20my%20peer%20Rin%20Ure%E2%80%99s%20great%20blog%20post%20on%20the%20API%E2%80%99s%20and%20creating%20credentials%3A%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Faccess-azure-sentinel-log-analytics-via-api-part-1%2Fba-p%2F1248377%22%20target%3D%22_blank%22%3EAccess%20Azure%20Sentinel%20Log%20Analytics%20via%20API%20(Part%201)%20-%20Microsoft%20Tech%20Community%3C%2FA%3E%26nbsp%3B%20The%20specific%20permission%20that%20we%20want%20to%20make%20sure%20we%20gran%20to%20the%20applications%20is%20covered%20in%20the%20linked%20article%20under%20the%20%E2%80%9CGive%20the%20AAD%20Application%20permissions%20to%20your%20(Sentinel)%20Log%20Analytics%20Workspace%E2%80%9D%20section.%26nbsp%3B%20After%20following%20the%20steps%20in%20that%20article%2C%20we%20will%20have%20two%20of%20the%20settings%20that%20we%20will%20need%20for%20the%20RDAP%20Query%20engine%3A%26nbsp%3B%20the%20Client%20ID%20and%20the%20Client%20Secret.%26nbsp%3B%20We%20will%20be%20using%20these%20later%20when%20we%20configure%20the%20Azure%20Function.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOk%2C%20so%20now%20we%20have%20what%20we%20need%20to%20read%20the%20data%2C%20but%20what%20about%20writing%20back%20our%20results%3F%20To%20%3CEM%3Ewrite%3C%2FEM%3E%20data%20to%20the%20Azure%20Sentinel%20instance%2C%20we%20need%20the%20Workspace%20ID%20and%20either%20the%20Primary%20or%20Secondary%20key%20for%20the%20workspace.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1914829891%22%20id%3D%22toc-hId--1912922209%22%3E%3CSTRONG%3EGetting%20the%20Workspace%20ID%20and%20Key%20for%20Azure%20Sentinel%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAzure%20Sentinel%20uses%20Log%20Analytics%20as%20the%20underlying%20data%20store.%26nbsp%3B%20To%20write%20data%20to%20the%20Log%20Analytics%20workspace%2C%20we%20need%20the%20workspace%20ID%20and%20Key%20and%20can%20access%20these%20very%20simply%20in%20Azure%20Sentinel.%20In%20Sentinel%2C%20go%20to%20Settings...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_0-1632321618709.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312070i672FD0F34AB2E8FE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_0-1632321618709.png%22%20alt%3D%22MattEgen_0-1632321618709.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThen%2C%20select%20%E2%80%9CWorkspace%20Settings%E2%80%9D%20from%20the%20top%20of%20the%20resulting%20page...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_1-1632321618715.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312071i55B8F884D3CA53E9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_1-1632321618715.png%22%20alt%3D%22MattEgen_1-1632321618715.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20finally%2C%20select%20%E2%80%9CAgents%20Management%E2%80%9D%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_2-1632321618719.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312072iCC53CD604134612A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_2-1632321618719.png%22%20alt%3D%22MattEgen_2-1632321618719.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20will%20take%20you%20to%20a%20screen%20that%20will%20show%20you%20the%20Workspace%20ID%20and%20two%20keys%2C%20a%20primary%20and%20secondary%2C%20that%20can%20be%20used%20to%20send%20data%20to%20the%20workspace...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_3-1632321618721.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312073iE52DEA3DC0DF95A7%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_3-1632321618721.png%22%20alt%3D%22MattEgen_3-1632321618721.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20can%20use%20either%20the%20primary%20or%20the%20secondary%2C%20it%20doesn%E2%80%99t%20matter%20which%20one%20we%20choose%20just%20remember%20to%20copy%20and%20save%20the%20Workspace%20ID%20and%20one%20of%20the%20keys%20as%20we%E2%80%99re%20going%20to%20need%20them%20in%20the%20next%20section.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20that%20we%20have%20the%20values%20we%20need%20to%20access%20Azure%20Sentinel%20we%20are%20going%20use%20then%20in%20our%20Azure%20Function%20by%20storing%20them%20in%20Application%20Settings.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-572682942%22%20id%3D%22toc-hId-574590624%22%3E%3CSTRONG%3EAzure%20Function%20%E2%80%93%20Application%20Settings%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20an%20Azure%20Function%2C%20the%20example%20can%20be%20configured%20via%20.%20Application%20settings%20are%20encrypted%20at%20rest%20and%20transmitted%20over%20an%20encrypted%20channel.%20Application%20Settings%20are%20exposed%20as%20environment%20variables%20for%20access%20by%20the%20application%20at%20runtime.%20This%20allows%20us%20to%20store%20keys%20and%20values%20in%20the%20Azure%20Function%20without%20having%20to%20store%20them%20in%20code.%20There%20are%20two%20advantages%20to%20this%3A%201)%20we%E2%80%99re%20not%20storing%20secrets%20in%20the%20actual%20code%20itself%20and%202)%20we%20can%20change%20them%20if%20we%20need%20to%20later.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20this%20Function%20we%20use%20the%20following%20Application%20Settings%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%22SharedKey%22%3A%20%22%5BLogAnalytics%20WorkSpace%20Primary%20or%20Secondary%20Key%5D%22%2C%3CBR%20%2F%3E%22WorkspaceID%22%3A%20%22%5BLogAnalytics%20Workspace%20ID%5D%22%2C%3CBR%20%2F%3E%22LogName%22%3A%20%22%5BThe%20name%20of%20the%20custom%20log%20to%20store%20results.%20Recommend%3AResolvedDomains%5D%22%2C%3CBR%20%2F%3E%22tenant_id%22%3A%20%22%5BAzureAD%20TenantID%5D%22%2C%3CBR%20%2F%3E%22client_id%22%3A%20%22%5BAzureAD%20Application%20Client%20ID%5D%22%2C%3CBR%20%2F%3E%22client_secret%22%3A%20%22%5BAzureAD%20Application%20Client%20Secret%5D%22%2C%3CBR%20%2F%3E%22grant_type%22%3A%20%22%5BGrant%20Type%20for%20Bearer%20Token%5D%22%2C%3CBR%20%2F%3E%22resource%22%3A%20%22%5BResource%20URL%20for%20Bearer%20Token%5D%22%2C%3CBR%20%2F%3E%E2%80%9Cquery_string%E2%80%9D%2C%E2%80%9D%5BThe%20Sentinel%20function%20name%20to%20call%5D%E2%80%9D%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThese%20values%20are%20used%20in%20the%20C%23%20code%20that%20does%20the%20actual%20work%20in%20the%20Azure%20Function%20and%20will%20be%20populated%20from%20the%20Application%20Settings%20into%20the%20code%20at%20runtime.%20This%20makes%20it%20very%20easy%20for%20us%20to%20change%20settings%20without%20having%20to%20rewrite%20%2F%20redeploy%20code.%26nbsp%3B%20After%20deploying%20the%20application%20to%20an%20Azure%20Function%2C%20we%20configure%20the%20Application%20Settings%20on%20the%20Configuration%20blade...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_4-1632321618734.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312075i38139A051C77F7E2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_4-1632321618734.png%22%20alt%3D%22MattEgen_4-1632321618734.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20each%20of%20the%20settings%2C%20simply%20click%20the%20%E2%80%9CNew%20Application%20Setting%E2%80%9D%20button%20and%20enter%20the%20name%20and%20value%20of%20the%20setting...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_5-1632321618737.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312074iF3FC6BA5A987DBDC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_5-1632321618737.png%22%20alt%3D%22MattEgen_5-1632321618737.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20let%E2%80%99s%20look%20at%20the%20code%20and%20how%20we%20can%20deploy%20it%20to%20an%20Azure%20Function.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1234771521%22%20id%3D%22toc-hId--1232863839%22%3E%3CSTRONG%3ERDAP%20Query%20Engine%20C%23%20Code%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%E2%80%99m%20not%20going%20to%20go%20through%20every%20line%20in%20the%20code%2C%20but%20instead%20leave%20that%20as%20an%20exercise%20for%20the%20reader.%26nbsp%3B%20Keep%20in%20mind%20this%20is%20an%26nbsp%3B%3CEM%3Eexample%3C%2FEM%3E%20and%20as%20such%20could%20probably%20be%20improved.%26nbsp%3B%26nbsp%3B%26nbsp%3BThe%20code%20is%20hosted%20on%20GitHub%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FTools%2FRDAP%2FRDAPQuery%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure-Sentinel%2FTools%2FRDAP%2FRDAPQuery%20at%20master%20%C2%B7%20Azure%2FAzure-Sentinel%20(github.com)%3C%2FA%3E.%20However%2C%20I%E2%80%99m%20going%20to%20cover%20the%20main%20function%20and%20the%20overall%20structure.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E2%80%9C%3CSTRONG%3ECheckDomains%3C%2FSTRONG%3E%E2%80%9D%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_6-1632321618745.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312076i50482FB43848439C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_6-1632321618745.png%22%20alt%3D%22MattEgen_6-1632321618745.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECheckDomains%20is%20the%20initialization%20point%20for%20the%20code%20and%20is%20called%20by%20the%20Azure%20Function%20framework%20based%20on%20a%20Timer%20trigger%20(in%20fact%20CheckDomains%20is%20an%20alias%20for%20the%20interal%20%E2%80%9CRun%E2%80%9D%20function%20that%20Azure%20Functions%20is%20calling).%20The%20timer%20is%20set%20to%20fire%20at%20a%20set%20period%20of%20time%20(default%20every%20five%20minutes)%20and%20in%20turn%20makes%20all%20of%20the%20other%20calls%20to%20get%20authentication%2C%20retrieve%20data%20from%20Sentinel%2C%20query%20RDAP%2C%20and%20finally%20write%20the%20results%20back%20to%20Sentinel.%20Let%E2%80%99s%20map%20out%20this%20function...%3C%2FP%3E%0A%3CP%3E%5Bcreate%20a%20visio%20of%20the%20function%3F%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%E2%80%9CQueryData%E2%80%9D%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_7-1632321618756.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312078iD6D6FF0857298763%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_7-1632321618756.png%22%20alt%3D%22MattEgen_7-1632321618756.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20of%20the%20first%20things%20that%20CheckDomains%20does%20is%20call%20the%20QueryData%20function%20which%20is%20responsible%20for%20calling%20into%20Azure%20Sentinel%20and%20retrieving%20any%20new%20domains%20to%20lookup.%20It%20takes%20one%20parameter%20which%20is%20the%20actual%20query%20to%20execute.%20Since%20querying%20the%20data%20in%20Azure%20Sentinel%20requires%20us%20to%20authenticate%2C%20it%20first%20retrieves%20an%20OAUTH%20bearer%20token%20(via%20a%20call%20to%20%E2%80%9CGetBearerToken()%E2%80%9D%20and%20then%20uses%20it%20in%20the%20subsequent%20call%20to%20the%20Log%20Analytics%20API.%26nbsp%3B%20If%20we%20receive%20a%20successful%20status%20code%20from%20the%20call%2C%20we%20then%20deserialize%20the%20results%20into%20a%20QueryResults%20object%20and%20return%20it%20back%20to%20the%20CheckDomains%20function.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20calling%20QueryData%2C%20we%20run%20a%20ForEach()%20loop%20over%20the%20results%2C%20do%20a%20little%20cleanup%20(by%20splitting%20out%20the%20top-level%20domain%20(.com%2C%20.net%2C%20etc.)%20with%20a%20split()%20function)%20and%20then%20call%20BootStrapTLD.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EBootStrapTLD()%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_8-1632321618765.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312077iBB4F7BB879099A35%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_8-1632321618765.png%22%20alt%3D%22MattEgen_8-1632321618765.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBootStrapTLD%20takes%20the%20passed%20in%20top-level%20domain%20(TLD)%20and%20uses%20it%20to%20call%20the%20IANA%20bootstrap%20URL%20at%20%3CA%20href%3D%22https%3A%2F%2Fdata.iana.org%2Frdap%2Fdns.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fdata.iana.org%2Frdap%2Fdns.json%3C%2FA%3E%20(this%20is%20hardcoded%20as%20it%E2%80%99s%20supposed%20to%20never%20change)%20which%20is%20a%20JSON%20file%20that%20has%20all%20the%20different%20TLDs%20mapped%20out%20with%20the%20appropriate%20RDAP%20server%20URL%20that%20we%20can%20call%20to%20get%20the%20detailed%20information%20about%20the%20domain.%26nbsp%3B%20We%20make%20a%20call%20to%20the%20JSON%20file%20and%20then%20deserialize%20it%20into%20a%20Services%20object.%20Since%20we%20deserialized%20the%20entire%20list%2C%20we%20then%20run%20a%20foreach%20loop%20over%20the%20returned%20values%20to%20check%20for%20a%20match%20with%20the%20TLD%20we%E2%80%99re%20searching%20for.%20When%20we%20have%20a%20match%20we%20then%20break%20out%20of%20the%20ForEach%20and%20return%20the%20value%20back%20to%20CheckDomains()%3C%2FP%3E%0A%3CP%3ENow%20that%20we%20have%20the%20RDAP%20server%20that%20is%20responsible%20for%20the%20TLD%2C%20it%E2%80%99s%20time%20to%20call%20it%20and%20get%20the%20information%20we%20want.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EQueryRDAP%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_9-1632321618772.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312079iC908B23EFF5EB41D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_9-1632321618772.png%22%20alt%3D%22MattEgen_9-1632321618772.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20function%20is%20very%20straightforward%20as%20it%20simply%20calls%20the%20passed%20in%20URL%2C%20deserializes%20the%20results%20(if%20any)%20into%20an%20RDAPResponse%20object%20and%20then%20returns%20that%20back%20to%20CheckDomains.%26nbsp%3B%20CheckDomains%20then%20parses%20the%20returned%20object%20to%20find%20the%20%E2%80%9Cevents%E2%80%9D%20node%20and%20specifically%20one%20with%20an%20eventType%20of%20%E2%80%9Cregistration%E2%80%9D.%20If%20we%20find%20one%2C%20we%20create%20a%20new%20%E2%80%9CRDAPUpdate%E2%80%9D%20object%20which%20just%20holds%20the%20domain%20name%20we%20looked%20up%20along%20with%20the%20registration%20date%20that%20was%20returned.%20This%20object%20is%20then%20passed%20to%20the%20WriteData%20function%20which%20will%20store%20it%20into%20Sentinel%20%2F%20Log%20Analytics.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWriteData()%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_10-1632321618775.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312080i090E93FE50F858A1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_10-1632321618775.png%22%20alt%3D%22MattEgen_10-1632321618775.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWriteData%20is%20possibly%20the%20simplest%20function%20in%20all%20of%20this%20code%20as%20it%20just%20takes%20the%20passed%20object%2C%20converts%20it%20into%20a%20JSON%20string%2C%20builds%20a%20signature%20(using%20the%20Workspace%20ID%20and%20keys%20from%20earlier)%20and%20then%20calls%20PostData%20which%20does%20the%20actual%20write%20to%20Sentinel%20%2F%20Log%20Analytics.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EPostData()%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_11-1632321618780.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312081i23CB68C7A25A6098%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_11-1632321618780.png%22%20alt%3D%22MattEgen_11-1632321618780.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20finally%2C%20PostData()%20calls%20the%20Log%20Analytics%20API%20and%20commits%20our%20data.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESo%E2%80%A6I%E2%80%99ve%20got%20a%20bunch%20of%20domain%20names%20and%20their%20registration%20dates%2C%20now%20what%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGoing%20back%20to%20our%20original%20need%20(alert%20on%20domains%20that%20are%20younger%20than%2030%20days)%2C%20we%20can%20write%20a%20very%20simple%20query%20in%20the%20Logs%20blade%20of%20Sentinel%20to%20search%20for%20these%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EResolvedDomains_CL%3CBR%20%2F%3E%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(1h)%3CBR%20%2F%3E%7C%20where%20registrationDate_t%20%26gt%3B%3D%20ago(30d)%3C%2FPRE%3E%0A%3CP%3EAnd%20to%20automate%20this%20query%2C%20we%20could%20convert%20it%20into%20an%20Analytics%20rule%20to%20generate%20an%20Incident%20for%20an%20analyst%20to%20review%20by%20selecting%20the%20%E2%80%9CNew%20Alert%E2%80%9D%20drop%20down%20and%20choosing%20%E2%80%9CCreate%20Azure%20Sentinel%20Alert%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MattEgen_12-1632321618785.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312082i8DCFE5860C45BDFF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MattEgen_12-1632321618785.png%22%20alt%3D%22MattEgen_12-1632321618785.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnother%20use%20case%20could%20be%20to%20create%20an%20enrichment%20query%20to%20add%20registration%20data%20during%20an%20investigation.%26nbsp%3B%20For%20example%2C%20create%20a%20join()%20between%20a%20domain%20source%20table%20and%20the%20ResolvedDomains_CL%20table%20to%20add%20in%20the%20registration%20date%20for%20any%20domains%20seen%2C%20and%20then%20add%20that%20data%20to%20an%20analytic%20using%20the%20new%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fwhat-s-new-alert-enrichment-custom-details-and-entity-mapping%2Fba-p%2F2195409%22%20target%3D%22_blank%22%3ECustom%20Details%20feature%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-428495114%22%20id%3D%22toc-hId-430402796%22%3E%3CSTRONG%3ENext%20steps%20%2F%20further%20improvements%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20thing%20I%20noticed%20in%20creating%20this%20example%20was%20that%20not%20every%20top-level%20domain%20has%20activated%20an%20RDAP%20server%20yet.%20Notably%2C%20a%20number%20of%20country%20TLDs%20are%20still%20using%20the%20traditional%20WHOIS%20infrastructure%20(this%20is%20why%20I%20added%20the%20ability%20to%20exclude%20domains%20and%20TLD%E2%80%99s%20in%20the%20GetDomainsForRDAP%20Sentinel%20Function).%26nbsp%3B%20As%20a%20next%20step%20for%20this%20project%2C%20I%20am%20going%20to%20look%20to%20add%20traditional%20WHOS%20queries%20(via%20a%20TCP%20connection%20to%20port%2043)%20in%20cases%20where%20RDAP%20cannot%20find%20a%20domain%20%2F%20receives%20an%20error.%20Also%2C%20the%20code%20currently%20doesn%E2%80%99t%20handle%20raw%20IP%20addresses%20(either%20IPv4%20or%20IPv6)%20and%20instead%20just%20does%20a%20lookup%20and%20fails.%20I%E2%80%99m%20looking%20at%20modifying%20the%20code%20to%20support%20RDAP%20queries%20for%20IP%20addresses%20as%20well%2C%20but%20since%20it%E2%80%99s%20an%20IP%20address%20it%20doesn%E2%80%99t%20have%20a%20%E2%80%9Cregistration%20date%E2%80%9D%20per%20se.%20Would%20love%20some%20feedback%20on%20what%20you%20think%20would%20be%20useful%20information%20from%20an%20IP%20address.%26nbsp%3B%20Look%20for%20this%20update%20soon.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUntil%20next%20time%2C%20happy%20hunting!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2774502%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22whois.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F313721iB20CDE838898AC28%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22whois.png%22%20alt%3D%22whois.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWith%20the%20amazing%20increase%20in%20domains%20and%20top-level%20domains%20(TLD's)%20on%20the%20Internet%2C%20it's%20difficult%20to%20know%20just%20where%20our%20users%20are%20going.%26nbsp%3B%20Newly%20registered%20domains%2C%20domain%20generation%20algorithms%2C%20and%20typo-squatting%20are%20all%20tactics%20used%20by%20adversaries%20to%20compromise%20users.%26nbsp%3B%20By%20researching%20the%20domains%20our%20users%20are%20accessing%20and%20generating%20alerts%20on%20potentially%20suspicious%20activity%2C%20we%20can%20be%20more%20aware%20of%20the%20risks%20and%20hopefully%20get%20ahead%20of%20the%20problem.%26nbsp%3B%20%26nbsp%3BThis%20blog%20post%20covers%20and%20example%20of%20extending%20Azure%20Sentinel%20using%20Azure%20Functions%20to%20call%20the%20Registration%20Data%20Access%20Protocol%20(RDAP)%20to%20gather%20information%20on%20the%20domains%20that%20are%20being%20accessed%20in%20an%20environment.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2774502%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDetection%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHunting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EInvestigation%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Sep 29 2021 04:14 PM
Updated by: