You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
GetFindings() client tries to deserialize a finding that contains the following path: service.runtimeDetails.process.euid (or userId) when the value of that path is a string "1000" instead of an integer, it fails with the following error:
Just call GetFindings() on a detector ID that returns a finding with "runtimeDetails" that contains a "process" node, for example: "Trojan:Runtime/BlackholeTraffic!DNS" sample
Here's a sample JSON finding as returned by the server:
Allow deserializing strings as integers, or solve it with the API owner to never return a string instead of int
Additional Information/Context
when type ProcessDetails struct was introduced to the SDK on v1.44.233 on this PR aws/aws-sdk-go#4782 the problem seem to have surfaced, (although the API should return a json integer/number and not a string representation of it)
It is possible to solve it by allowing numbers to be deserialized from strings on private/protocol/json/jsonutil/unmarshal.go
Downgrading toe SDK v1.44.232 "solves" the problem as well (as there is no attempt to deserialize to int64 from string)
SDK version used
1.45.16 (latest) down to 1.44.233 (including)
Environment details (Version of Go (go version)? OS name and version, etc.)
go version go1.20.5 windows/amd64
The text was updated successfully, but these errors were encountered:
If you did not know, all the AWS SDKs are code-generated from the API model definition of each AWS service.
In this case, AWS GuardDuty's userId and euid are modeled as an Integer, but it seems like the guard duty is returning back a string, causing the protocol deserializer to break.
So in simple terms, the service guarantees one thing, and then sends back a different thing.
We cannot accept your PR because the whole point of protocol deserializers is to provide robust type checking.
I have created an internal ticket with the service team and there's a fix pending. Please stand by for updates.
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Hi @RanVaknin
Thanks for helping
How can we follow up on this issue?
Specifically we need to know when a version with a fix for this is released.
Thanks!
The service team has reported a rollout on the backend, so it's not tied to an SDK version, its a change in server side behavior. I suggest you test your code again.
Thanks,
Ran~
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugSomething isn't workingservice-apiThis issue pertains to the AWS API
Describe the bug
GetFindings() client tries to deserialize a finding that contains the following path:
service.runtimeDetails.process.euid
(oruserId
) when the value of that path is a string"1000"
instead of an integer, it fails with the following error:Expected Behavior
successfully deserialize the
guardduty.Finding
Current Behavior
fails to serialize output, the following error is returned:
Reproduction Steps
Just call GetFindings() on a detector ID that returns a finding with "runtimeDetails" that contains a "process" node, for example: "Trojan:Runtime/BlackholeTraffic!DNS" sample
Here's a sample JSON finding as returned by the server:
Possible Solution
Allow deserializing strings as integers, or solve it with the API owner to never return a string instead of int
Additional Information/Context
when
type ProcessDetails struct
was introduced to the SDK on v1.44.233 on this PR aws/aws-sdk-go#4782 the problem seem to have surfaced, (although the API should return a json integer/number and not a string representation of it)It is possible to solve it by allowing numbers to be deserialized from strings on private/protocol/json/jsonutil/unmarshal.go
Downgrading toe SDK v1.44.232 "solves" the problem as well (as there is no attempt to deserialize to int64 from string)
SDK version used
1.45.16 (latest) down to 1.44.233 (including)
Environment details (Version of Go (
go version
)? OS name and version, etc.)go version go1.20.5 windows/amd64
The text was updated successfully, but these errors were encountered: