diff --git a/rpe/engines/opa.py b/rpe/engines/opa.py index 631fd6c..38a324f 100644 --- a/rpe/engines/opa.py +++ b/rpe/engines/opa.py @@ -57,14 +57,16 @@ def _opa_request(self, path, method='GET', data=None): # Perform an evaluation on a given resource def evaluate(self, resource): + resource_data = resource.get() + input = { - 'input': resource.get(), + 'input': resource_data, } evals = self._opa_request('rpe/evaluate', method='POST', data=input) return [ - Evaluation(engine=self, resource=resource, **ev) + Evaluation(engine=self, resource=resource, evaluation_artifact=resource_data, **ev) for ev in evals ] diff --git a/rpe/policy.py b/rpe/policy.py index b0ca1e1..cdd175e 100644 --- a/rpe/policy.py +++ b/rpe/policy.py @@ -1,4 +1,4 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import List from rpe.engines import Engine @@ -20,6 +20,7 @@ class Evaluation: compliant: bool excluded: bool remediable: bool + evaluation_artifact: dict = field(default_factory=dict) # Data used during evaluation def remediate(self): return self.engine.remediate(self.resource, self.policy_id)