Altinn / altinn-storage

Altinn platform microservice for handling instance storage
2 stars 3 forks source link

Storage should be able to receive defender scan results #542

Open SandGrainOne opened 3 weeks ago

SandGrainOne commented 3 weeks ago

Description

Storage should be expanded with an endpoint that can handle defender scan results report. Defender can be configured to publish scan results on an EventGrid topic. Storage should consume the reports and update correct DataElement with the scan results.

We need a new controller with a new POST endpoint as an event receiver. The endpoint should be secured with an AccessKey. This will also require more Azure resources defined in terraform. "The event topic must be a custom topic in the same region as the storage account". The Storage application must also have a defined event subscription, possibly for every storage account unless we find a way to publish all reports to the same topic.

We need to analyze what we need to include in the report so that Storage can find correct DataElement. The report need to contain app id, instance id and data id as well as the scan result. Some of that might be unknown for defender and would need to be included in the event subscription for each storage account if possible

Additional Information

This issue is part of a change where the goal is to discontinue the file scan application and the use of Clam AV. Defender is already active, but the reports aren't being used for anything.

Most of the required setup, wiring and authorization has already been done once in the Notifications Email application. Take a look at the DeliveryReportController implementation. It must be adapted for Defender, but the framework should be usable.

Take a look at terraform resource definitions, but note that we want to change how AccessKey is included in a request.

Tasks

Acceptance Criterias

No response