I had several assets added via API that should not have been. I am now trying to write a groovy tag for assets that are not in the VM or WAS modules so I can remove them.
Is there any documentation on Groovy as used with Qualys?
Try this, create a new Groovy Script-let TAG say NOTINVM or something then for the code use:
// Skip testing on non-VM hosts. return (asset.getAssetType()!=Asset.AssetType.HOST);
That is all. It should return the result of the evaluation so if the Asset is not in VM I think this will work. I will look for the documentation I have but it is old. You may want to see if your TAM can find something more updated and post.
I appreciate the response, but this doesn't cover the WAS module, or any of the other modules that might be in use. I was hoping there was something like:
return !asset.getActivatedForModule().contains(Module.ModuleType.VM) && !asset.getActivatedForModule().contains(Module.ModuleType.WAS) && ... ;
but without documentation I'm just guessing at the available methods and constants.
Retrieving data ...