diff --git a/main.go b/main.go index be407e8..65ddd33 100644 --- a/main.go +++ b/main.go @@ -145,7 +145,8 @@ func (l *CompliancePlugin) Eval(request *proto.EvalRequest, apiHelper runner.Api }, Labels: map[string]string{ "package": string(result.Policy.Package), - "type": "aws-cloud--ec2", + "type": "aws", + "service": "ec2", "instanceID": fmt.Sprintf("%v", instance["InstanceID"]), }, }) @@ -161,7 +162,8 @@ func (l *CompliancePlugin) Eval(request *proto.EvalRequest, apiHelper runner.Api }, Labels: map[string]string{ "package": string(result.Policy.Package), - "type": "aws-cloud--ec2", + "type": "aws", + "service": "ec2", "instanceID": fmt.Sprintf("%v", instance["InstanceID"]), }, }) @@ -185,7 +187,8 @@ func (l *CompliancePlugin) Eval(request *proto.EvalRequest, apiHelper runner.Api }, Labels: map[string]string{ "package": string(result.Policy.Package), - "type": "aws-cloud--ec2", + "type": "aws", + "service": "ec2", "instanceID": fmt.Sprintf("%v", instance["InstanceID"]), }, }) @@ -208,7 +211,8 @@ func (l *CompliancePlugin) Eval(request *proto.EvalRequest, apiHelper runner.Api }, Labels: map[string]string{ "package": string(result.Policy.Package), - "type": "aws-cloud--ec2", + "type": "aws", + "service": "ec2", "instanceID": fmt.Sprintf("%v", instance["InstanceID"]), }, }) @@ -240,7 +244,8 @@ func (l *CompliancePlugin) Eval(request *proto.EvalRequest, apiHelper runner.Api assessmentResult.End = timestamppb.New(endTime) streamId, err := sdk.SeededUUID(map[string]string{ - "type": "aws-cloud--ec2", + "type": "aws", + "service": "ec2", "_policy": policyPath, "instance_id": fmt.Sprintf("%v", instance["InstanceID"]), }) @@ -261,8 +266,10 @@ func (l *CompliancePlugin) Eval(request *proto.EvalRequest, apiHelper runner.Api err = apiHelper.CreateResult( streamId.String(), map[string]string{ - "type": "aws-cloud--ec2", - "_policy": policyPath, + "type": "aws", + "service": "ec2", + "instance_id": fmt.Sprintf("%v", instance["InstanceID"]), + "_policy": policyPath, }, policyPath, assessmentResult.Result())