Skip to content

Set DPIRule to default state #2

@sudofez

Description

@sudofez

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) #<-----
            }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions