-
Notifications
You must be signed in to change notification settings - Fork 20
PS: Add .NET and PowerShell SDK type models. #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Where's the python script? Also that second link in your PR description doesn't work for me. Asking about the script btw because I would like to get it automated/running regularly so that we these model.yml files do not become stale. |
Uh, good point. Happy to add this script somewhere. Do you have any preference for where to put it? Maybe a
You need to join the |
|
I've added the Python script as well as a new folder with some instructions on how to run it. Does that look good to you @dilanbhalla? Happy to move this somewhere else if you prefer! |
|
Chatting offline about this, but I honestly don't know how to read these codeql models. It might be nice to have an example pulled out (or a few) and explain what it is providing? I've not really used/developed these before so it's hard for me to take in what new capabilities now exist and the limits on those capabilities. |
|
Happy to provide more context on this in a call at some point (and even write stuff down in a more permanent place). What I can quickly say is: What is a data extension?You can read about data extensions in general here (and there is a separate document for other languages which provide models-as-data support since that's the killer feature for data extensions). In our case, we can read a data extension such as:
What does this mean?They don't really have any meaning per se. Instead, we assign them meaning by the way we use the
At the moment
And thus, the analysis is now able to know that the return value of Why is this useful?Having type information is very useful when working with flow sources. For example, it's pretty clear that reading data from an UDP connection is a source of user input. So this method call returns user-controlled data: https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.udpclient.receive?view=net-9.0#system-net-sockets-udpclient-receive(system-net-ipendpoint@) But in order to know that we're calling that method we need to know that the qualifier of the call is an |
|
Thanks @MathiasVP, appreciate you adding the script! I can set up a workflow for that now so this data stays synced, appreciate it. Approving. |
Turns out all the .NET methods are documented in a nice and parsable XML format here, and the PowerShell SDK is similarly documented here. With the help of Copilot I managed to write a Python script to extract all the methods and store them as data extensions so that they can be consumed by models-as-data to provide type information.