What's new: ALGraph
Timeline
What's new: ALGraph
This session introduces AL graph, a new tool in the AL tools package that builds call graphs of AL code. You first extract a meta model of caller and callee relationships once, then run as many queries on it as you like. The demo shows two queries: all callers of the HTTP client, and the calls from non-debuggable to debuggable methods. Results export as DGML for people to read or SARIF for agents to act on. The speaker says the team uses the tool internally to strengthen security, which matters more as agents make vulnerabilities easier to find.
Watch: https://www.youtube.com/watch?v=i0gBrA1tx50 (6:42). Area: Developer tools. Audience: developer, partner. Presenters as heard: Thaddeus (medium confidence).
Chapters
- 0:00 Introduction: what AL graph is and why it helps (2 min)
- 1:38 Query language and export formats (1 min)
- 2:19 Demo: building the meta model (1 min)
- 3:15 Demo: finding callers of the HTTP client (1 min)
- 4:24 Demo: auditing non-debuggable to debuggable calls (2 min)
- 5:58 Wrap-up and internal security use (1 min)
Features in this video
- AL graph - GA - 0:18 to 1:38, demo 2:19 to 5:58 - A graph command in the AL tool builds a static call graph across an extension and its dependencies.
- AL graph query language - GA - 1:38 to 1:56, demo 3:26 to 5:05 - A query language supports complex queries such as all callers of an object or methods touching a table.
- DGML and SARIF export - GA - 1:56 to 2:19, demo 3:26 to 4:13 - Results export as DGML for humans or SARIF for agents.
- AL graph meta model extraction - GA - 2:19 to 3:15, demo 2:41 to 3:15 - An extract subcommand builds a JSON meta model of caller-callee relationships once.
- HTTP client caller query - GA - 3:15 to 4:24, demo 3:26 to 4:13 - A query exports everything calling the HTTP client, excluding tests, as a call path tree.
- Non-debuggable boundary audit - GA - 4:24 to 5:58, demo 4:53 to 5:58 - A query finds debuggable callees of non-debuggable methods, where a breakpoint could leak content.
Quotes
- 1:10 "one big one um, that we're quite focused on is the non-debuggable to debuggable boundary." - Names the main security use case the AL team built the tool for.
- 1:24 "because, you know, you can inadvertently expose secrets that way." - Explains the risk behind crossing from non-debuggable to debuggable code.
- 2:08 "there's also the SARIF format, you know, if you're interested in something more flat uh that um agent can act on easily." - Shows the design choice of a machine-friendly output format for agents next to the human-readable one.
- 3:04 "you construct the meta model once and then you run your queries on the meta model." - Describes the core workflow: a single extraction step, then repeated queries.
- 4:24 "this query language that all the different operations you can do this is all well documented on our um MS Learn website." - Points developers to MS Learn for the query syntax.
- 4:53 "You generate the graph once and then you query it multiple times." - Repeats that the graph is reusable, so each query is cheap after the first extraction.
- 5:48 "So, even though like the main procedure is non-debuggable and this is a local procedure, you're still leaking information this way." - Shows the non-obvious leak the tool finds, even when the entry procedure is non-debuggable.
- 5:58 "we are using this quite heavily internally as well to strengthen our security posture." - States that the team uses the tool internally for security work.
- 6:12 "it's more imperative that we have the tools to find them and fix them sooner." - Gives the reason for the tool: agents make vulnerabilities easier to discover.
Documented features matched
- AL graph -> Audit AL app accessibility and debugging boundaries (high confidence, docs say GA)
- Non-debuggable boundary audit -> Audit AL app accessibility and debugging boundaries (high confidence, docs say GA)
- HTTP client caller query -> Audit AL app accessibility and debugging boundaries (medium confidence, docs say GA)
- AL graph meta model extraction -> Audit AL app accessibility and debugging boundaries (medium confidence, docs say GA)
- DGML and SARIF export -> Audit AL app accessibility and debugging boundaries (medium confidence, docs say GA)
- AL graph query language -> Audit AL app accessibility and debugging boundaries (medium confidence, docs say GA)
Cleaned transcript (auto-captions, 6:42)
What's new: ALGraph
0:05 Hello and welcome to this BC LE session on AL graph. I am Thaddeus. I am an engineer working on the team that builds a lot of this AL tooling. Um, and so this is one of the newer tools that we built in the last release. So, let's get into this. So, what is AL graph? Um, it is a new tool that's part of the AL tools package. If you have used AL tools before, um, you've probably seen that over the releases we've added more and more capabilities to it. Uh, and this is a new one. It is a tool that is focused around constructing call graphs. Um, so if you've ever wanted to know, like, you know, the structure of your code, like, who is calling who, what are your external integration points, what are your dependencies,
0:45 where are you calling into certain sensitive libraries, or what services are you exposing that other PTEs or other global apps could take a dependency on, this tool helps you answer all of those questions. It basically allows you to do auditing of your code base. So, for example, if you've ever wanted to know where in your code do you make HTTP requests, and what are the different call paths that can reach there? You know, what actions on your pages can actually end up uh, issuing a history request? Or, if you want to do security auditing, one big one um, that we're quite focused on is the non-debuggable to debuggable boundary.
1:24 Um, because, you know, you can inadvertently expose secrets that way. Um, this tool allows you to catch all of this uh, sooner, and just basically answer questions about how your code base is structured. The query language is pretty rich, uh, so you can actually uh, construct fairly complex queries. So, if you have your own sensitive objects, for example, you can say, "Okay, give me all the callers of this particular object." Or, "Give me all the different methods that interact with this specific table,
1:56 etc." And then you have multiple uh, um export formats that you can export this as DGML, which is great for humans because, you know, it's a nice graph representation, which is how we think about call graphs. But, you know, there's also the SARIF format, you know, if you're interested in something more flat uh that um agent can act on easily. So, let's get into it. Let's get into the demo and let's see how this works. The first thing you need to do before you query your um code is you actually need to build the meta model.
2:30 So, this is a one-time thing. It's basically building the representation of the different uh caller-callee relationships in your app. So, this is the command. This basically AL graph. Um actually, what I should do first is I should actually show you AL graph itself. So, give me a second. And here we go. Let's see AL graph itself. And there's a whole bunch of different front like subcommands you can use uh that allows you to do all sorts of different things. Um so, I'm going to use the extract whole uh method.
3:04 And this basically it constructs the meta model. And you only do this once. So, you construct the meta model once and then you run your queries on the meta model. Um we don't really need to worry about the internal representation. So, it's a JSON file. Um doesn't really matter. Um what is What then becomes interesting is querying it, right? So, for example, if I wanted to find out all my callers to HTTP client, I could run the following query, right? Uh so, AL graph export. Uh and then the graph is the graph that we produced previously.
3:38 And then it's, you know, I want this in DGML format, exclude all my test files. Um and I want everything that targets the HTTP client. So, let's actually run this. Right? And let's actually view the output. So, it's this one that we just generated here. Um and if we zoom in Yeah, so this is basically what it is. If I see all the different gets Well, there's only one caller to get and post, but then if we actually follow this, we can see this has three callers. And then this one has its its own caller, but this one has another caller further. And so, you can basically trace the call path.
4:13 You get the idea, right? Like this is the tree of the different caller callee relationships in your code. Now, let's do another interesting query. Let's do one that shows the your non-debuggable to debuggable boundaries. And the this query language that all the different operations you can do this is all well documented on our um MS Learn website. So, you don't have to worry about the exact like, you know, um format of this query. Just know that there is a query language you can use. Um so, this is a very similar thing. So, you'll notice that I'm using the same graph that we generated in the first step.
4:53 So, that's the idea. You generate the graph once and then you query it multiple times. Okay. Same thing. I want it from all my non-debuggables and I want to find all the callees of my non-debuggable methods. And so, I want to audit them. Let's run this. All right. And then if we go here, this is the one that was generated. Let's open this. Right. And so, this is what it looks like. So, these are the non-debuggable that it's This one calls into a platform. Built-in suggestions should be safe. This one's a bit interesting
5:26 because, you know, I've got a non-debuggable method. It's the one that's outlined by in red. And it's calling into a debuggable method. So, we can actually go and look at the uh source of this. All right. And you can see that, you know, it's a simplified example, but you can see here that, you know, if there's a breakpoint on this line, for example, you can actually read content of text. All right. So, even though like the main procedure is non-debuggable and this is a local procedure, you're still leaking information this way. It's a simplified example, but you get the idea.
5:58 And that's basically it. Um we we are using this quite heavily internally as well to strengthen our security posture. And with agents like it's becoming more and more uh relevant because it's easier for you know, these vulnerabilities to be discovered. So, it's it's more imperative that we have the tools to find them and fix them sooner. I hope you enjoyed this BCL session and I hope to meet you in other sessions or maybe in person if you ever come to a conference. Thank you.