Comments (10)
Hoping this was a simple one, but changing AlertProp
to ScheduledAlertProp
didn't fix it. The $rule
object properties are seemingly treated as a single argument to the constructor rather than the individual key/values.
AzSentinel/Public/Disable-AzSentinelAlertRule.ps1:63-65
$bodyAlertProp = [ScheduledAlertProp]::new(
($rule | Select-Object * -ExcludeProperty lastModifiedUtc, etag, id)
)
The subsequent errors:
MethodException: /x/git/AZSentinel/AzSentinel/Public/Disable-AzSentinelAlertRule.ps1:66
Line |
66 | … @($rule | Select-Object * -ExcludeProperty lastModifiedUtc, …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find an overload for "new" and the argument count: "1".
MethodException: /x/git/AZSentinel/AzSentinel/Public/Disable-AzSentinelAlertRule.ps1:69
Line |
69 | $body = [AlertRule]::new(
| ~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find an overload for "new" and the argument count: "2".
from azsentinel.
I am cross the same situation. I am sure works before last commit.
Do have some workaround?
from azsentinel.
I haven't been able to get this working either. Currently on 0.6.10
Get-Command -Module AzSentinel Disable-AzSentinelAlertRule
CommandType Name Version Source
----------- ---- ------- ------
Function Disable-AzSentinelAlertRule 0.6.10 AzSentinel
Get-Command -Module AzSentinel Enable-AzSentinelAlertRule
CommandType Name Version Source
----------- ---- ------- ------
Function Enable-AzSentinelAlertRule 0.6.10 AzSentinel
Disable-AzSentinelAlertRule -WorkspaceName $Workspace -RuleName $RuleName -Verbose -Debug
<SNIP>
InvalidOperation: /Users/test/.local/share/powershell/Modules/AzSentinel/0.6.10/AzSentinel.psm1:3376
Line |
3376 | $bodyAlertProp = [AlertProp]::new(
| ~~~~~~~~~~~
| Unable to find type [AlertProp].
MethodException: /Users/test/.local/share/powershell/Modules/AzSentinel/0.6.10/AzSentinel.psm1:3380
Line |
3380 | $body = [AlertRule]::new(
| ~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find an overload for "new" and the argument count: "2".
from azsentinel.
@pemontto I know works before, because I running a script last week and works well. Yesterday i starting have the issues with disable the AlertRule
from azsentinel.
For now you can have a look at your previous versions and rollback to a version that works
Get-Module -ListAvailable AzSentinel
Rollback
Import-Module AzSentinel -RequiredVersion "0.6.8" -Force
from azsentinel.
I am try using the 0.6.10, 0.6.8 and 0.6.5 and I still have same error.
Disable-AzSentinelAlertRule -SubscriptionId $SubscriptionId -WorkspaceName $WorkspaceName -RuleName $RuleName
InvalidOperation: C:\Users\user\Documents\PowerShell\Modules\AzSentinel\0.6.5\AzSentinel.psm1:644
Line |
644 | $bodyAlertProp = [AlertProp]::new(
| ~~~~~~~~~~~
| Unable to find type [AlertProp].
MethodException: C:\Users\user\Documents\PowerShell\Modules\AzSentinel\0.6.5\AzSentinel.psm1:648
Line |
648 | $body = [AlertRule]::new(
Disable-AzSentinelAlertRule: Response status code does not indicate success: 400 (Bad Request).
| ~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find an overload for "new" and the argument count: "2".
from azsentinel.
@rleal124 thanks for the feedback, I see what's broken. Already fixed the issue for disable and enable function. Will merge this.
from azsentinel.
@pkhabazi Thanks for your feedback.
from azsentinel.
@pemontto and @rleal124 please update to version 0.6.11, problem should be fixed in this version
from azsentinel.
@pkhabazi Thanks, I tested now and works well. Many thanks for your support.
from azsentinel.
Related Issues (20)
- [Feature Request] Disable other response playbooks
- Bug Report HOT 1
- Import-AzSentinelDataConnector doesn't configure AzureSecurityCenter Data Connector
- Import-AzSentinelAlertRule fails when passing multiple JSON files HOT 5
- Bug Report HOT 2
- [Feature Request] Support new anomaly rule type
- [Feature Request] Retry-able errors HOT 2
- Entities Mapping HOT 5
- Alert Details Settings
- Bug Report: Issue with Taxii Data Connectors HOT 1
- Import-AzSentinelAlertRule update to support CustomDetails HOT 1
- New-AzSentinelAlertRule does not work with tactic parameter even if the values are formatted correctly HOT 4
- Set-AzSentinel: Response status code does not indicate success: 401 (Unauthorized) HOT 1
- [Feature Request] Support new ThreatIntelligence rule kind
- Set-Sentinel returns with status code 400
- Failed to import "AzureResource" entityType and "ResourceId" field.
- Set-AzSentinel: Unable to enable Sentinel on workspace with error message: Response status code does not indicate success: 404 (Not Found). HOT 5
- Import-AzSentinelAlertRule with invalid rule does not cause exception
- Add capability to deploy Techniques in analytics rule for Microsoft Sentinel
- Bug Report HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azsentinel.