Open SetTrend opened 8 months ago
Thanks @SetTrend would love to see more commentary on how someone would think about constructing this rule/what conditions they would consider before moving to up for grabs
Happy to add a rule but we need something concrete that we can alert on based on just static analysis without false positives. But I fear if the parser cannot do that due to PowerShell's dynamic nature, I am not sure PSSA can do better.
The
switch
statement condition syntax seems obscure from time to time. See PowerShell issues 21299 and 10911.Hence, I suggest do add a few checks to test
switch
statement conditions for invalid syntax. (I.e., syntax that will never be evaluated, or that will always evaluate to$false
etc.)