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

Set DPIRule to default state #2

Open
sudofez opened this issue Jul 25, 2018 · 1 comment
Open

Set DPIRule to default state #2

sudofez opened this issue Jul 25, 2018 · 1 comment

Comments

@sudofez
Copy link

sudofez commented Jul 25, 2018

Is there a way to set a DPIRule back to it's default state? I'm working on setting new rules to alert only for x amount of time during pre-prod testing and switching them back to their default state after I observe the rule impact.

Is this possible through the API or will I have to store the rule state in a DB or file somewhere before I switch the detectOnly boolean?

Something like this is what I'm after:

function setTempDetect($rules){

    foreach($r in $rules){
        
        if((New-TimeSpan -Start $r.Issued -End (Get-Date)).Days -le 7){
               $r.detectOnly = $true
        }
        else{
               $r.DetectOnly = setDefaultState($r) #<-----
            }
    }
}
@andresark
Copy link

It seems the updated API would allow for this use case, check the "detectOnly" field: https://automation.deepsecurity.trendmicro.com/article/11_3/api-reference?platform=on-premise#operation/modifyIntrusionPreventionRuleOnPolicy

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

No branches or pull requests

2 participants