fortify / fcli

fcli is a command-line utility for interacting with various Fortify products
https://fortify.github.io/fcli/
Other
31 stars 22 forks source link

FoD: Add functionality for 'refreshing' scan settings with new entitlement id #614

Open rsenden opened 1 month ago

rsenden commented 1 month ago

Enhancement Request

If the entitlement associated with an existing scan setup is deactivated (usually because it was replaced with a new entitlement), the fcli fod sast-scan start (and possibly the same for other scan types) will fail with an exception like the following:

image

Ideally, if possible, this should be fixed on the FoD side, with any existing scan setups automatically being reconfigured with the new entitlement id if an existing entitlement is replaced with a new entitlement.

Alternatively, we could implement the following functionality in fcli:

We could potentially implement this in 3 different places:

kadraman commented 1 month ago

This logic is mostly already in fod xxx-scan setup via the ‎FoDScanHelper::getEntitlementToUse() method - which validates the entitlement is still valid. We could call this using existing scan configuration, e.g. Assessment Name/Type and try and find an appropriate entitlement but there is potential for a customer to have multiple current entitlements and there is no guarantee we would select the "right one". The entitlements are consumed at scan time so I can imagine if this is done automatically it could lead to lots of issues with wrong entitlements being consumed?

Maybe it would be better if the customer proactively had the ability to "migrate" the setup to using the correct entitlements. This would be best done using FoD UI itself, but maybe we can provide fcli commands to do this.

rsenden commented 1 month ago

What about having an fcli update-entitlements action that takes old and new entitlement id's as input, then iterates through all existing scan setups and updates entitlementId if current scan setup entitlement id matches the given old entitlement id?

Although users would need to run this manually, and it would potentially take a long time to iterate through all existing scan setups, it would provide an easy way for users to migrate any existing scan setups to a new entitlement id.