Skip to content
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

Added Support for: /security/attackSimulation/simulations/{simulationId}/report/simulationUsers Endpoint #1078

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Inbethath
Copy link

Added preliminary support for the:
/security/attackSimulation/simulations/{simulationId}/report/simulationUsers

Endpoint following the project style + Microsoft's documentation.

Not sure how open this repo is to contributions but here's a teeny tiny bit.

Please let me know if I've followed the project structure correctly - reverse engineering it has been a bit of a thing.

@Inbethath Inbethath requested a review from a team as a code owner January 23, 2025 20:25
@Inbethath
Copy link
Author

@microsoft-github-policy-service agree

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!
Thank you for this contribution!

Unfortunately we won't be able to merge it. The code is generated from metadata and would be erased in the next weekly generation.

Can you please provide a link to the documentation of the endpoints and operations you're trying to access to in the SDK?

@Inbethath
Copy link
Author

You bet - Thanks for letting me know and hopefully it helps! :)

For the documentation here it is: https://learn.microsoft.com/en-us/graph/api/usersimulationdetails-list?view=graph-rest-1.0&tabs=http

There is also this which is also not implemented afaik: https://learn.microsoft.com/en-us/graph/api/simulationreportoverview-get?view=graph-rest-1.0&tabs=http

@baywet
Copy link
Member

baywet commented Jan 24, 2025

Thank you for the additional information.

This is effectively a limitation of the design, long story short, the OData to OpenAPI conversion library we rely on does NOT expand complex properties as path segments to avoid generating tens of thousands of additional operations.
And simulation report is a complex type. (report property on the simulation type)

But you should be able to get to the information by using the get simulation operation and adding an expand query parameter

Something like this

request_configuration = RequestConfiguration[SimulationItemRequestBuilderGetQueryParameters]()
request_configuration.query_parameters.expand = ['report($expand=overview,simulationUsers)']
simulation = await graph_client.security.attack_simulation.simulations.by_simulation_id('simulation-id').get(request_configuration)
// simulation.report.overview...

Let us know if you have any additional comments or questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants