-
Notifications
You must be signed in to change notification settings - Fork 173
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
New-MgSecurityAttackSimulation - endUserNotificationSetting properties seem to be broken #2770
Comments
Hi @sc9246 , Thanks for raising this! I see the metadata is there and it shall work. Which SDK version are you using? Does the API call work when using Graph Explorer (if it works in your environment)? |
Hi @petrhollayms - I did more testing over the weekend to try and get things working, but still cannot. The problem seems to exist for both the SDK and the API, but they behave differently.
I built the data by using a manually created attack simulation as a reference. I took the exact same data supplied to the cmdlet above, and posted it via Invoke-RestMethod, and also the Graph Explorer API. I got an Accepted 202 response (both are same). It did create the attack simulation, but it did not set any of the notification settings (it shows as do not deliver notifications in the UI portal).
I could just be supplying the property incorrectly, but I've tried so many variations of what/how is included, and cannot get it to apply the settings. I've even tried leaving them unknown, and then PATCH'ing the enduserNotificationSetting, but it doesn't seem to be supported as an update parameter (no error but nothing changes). |
Hi, I attempted to repro this error using the commandlet & graph explorer but was unsuccessful. Attached JSON post data and the powershell script used for verifying. astgraph.txt Few observations based on the JSON post data shared in previous comment:
|
I was also having this issue and it looks like the key revolves around the URL for the various bits for payload, login page, landing page and end user notifications: payloads('02178408-41c4-48d1-9828-688db34fe881')" and in the End User Notification section: endUserNotifications('39f2c7bb-0df5-44be-9c6b-e30403c0b845')" Basically, the URL was wrong and the GUID for the object called needed to be in quotes and then in parenthesis. Hope that makes sense. Bolding did not seem to work in my browser. |
Understood on changes - it was just throwing everything at it in an attempt to make things work. It would be great if documentation for the POST data, or cmdlet, were updated (nothing anywhere I can find ever mentions wrapping IDs in quotes and parenthesis). The cmdlet is working with the very bare-bones notification setting. However, the main component of this I was trying to get working was also microsoftManaged training. I can take your example JSON to post, also my own, and send it via powershell/Graph Explorer and it does not error. However, it also does not do anything (always a accepted status and then nothing appears). Below is JSON for a POST that I would expect to work. This is for direct API call so I did not use ('') around IDs, but I did try that as a test (same problem). Is there something else wrong here? Documentation for each pieces makes it seems like this should work:
|
Describe the bug
Trying to create a new attack simulation with New-MgSecurityAttackSimulation, but once I introduce settings for endUserNotificationSetting, the cmdlet always errors with:
Status: 400 (BadRequest)
ErrorCode: UnknownError`
If I set endUserNotificationSetting -> settingType = unknown, it ignores that property and everything under it, and the simulation creates OK. The issue seems to be no matter how I try to include notification settings, creation via Graph results in an error. Even using the documented creation from the MS KB does not work:
Expected behavior
Expect to be able to provide notification options to API/cmdlet, and have them work.
How to reproduce
Purged tenant data, apologies if I messed up formatting, but this should be a mostly complete example that will not work as is (unless changing endUserNotificationSetting = @{ settingtype = "unknown"}
SDK Version
No response
Latest version known to work for scenario above?
No response
Known Workarounds
Per above, tweaking this will make it work, but it ignores all notification options.
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: