Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error deserializing Container Model due to type mismatch on first_seen and last_seen values. #430

Closed
andrew-bab opened this issue May 10, 2024 · 1 comment · Fixed by #431
Labels
bug Something isn't working

Comments

@andrew-bab
Copy link

Using the gofalcon to get containers on the /container-security/combined/containers/v1 endpoint I get the following error:
json: cannot unmarshal string into Go struct field ModelsContainer.resources.first_seen of type int64

This is caused by the fact that the data structure for ModelsContainer defines the FirstSeen and LastSeen fields as int64 and the api has them being strings representing date times.

models.ContainerEntityResponse{ errors [...] meta* msaspec.MetaInfo{ pagination msaspec.Paging{...} powered_by string query_time* number($double) trace_id* string writes msaspec.Writes{...} } resources* [models.Container{ agents* [...] allow_privilege_escalation* boolean cid* string cloud_account_id* string cloud_name* string cloud_region* string cluster_id* string cluster_name* string config_labels* string container_id* string container_name* string created_at* string first_seen* string image_application_package_count* integer($int32) image_assessed_at* integer($int64) image_detection_count* integer($int32) image_digest* string image_has_been_assessed* boolean image_highest_severity_vulnerability* string image_id* string image_package_count* integer($int32) image_registry* string image_repository* string image_tag* string image_vulnerability_count* integer($int32) insecure_mount_source* string insecure_mount_type* string insecure_propagation_mode* boolean interactive_mode* boolean ipv4* string ipv6* string labels* {...} labels_list* [...] last_seen* string namespace* string node_name* string node_uid* string pod_id* string pod_name* string ports* [...] privileged* boolean root_write_access* boolean run_as_root_group* boolean run_as_root_user* boolean running_status* boolean volume_mounts* string }] }

can you please fix this in the go sdk.

@ffalor ffalor added the bug Something isn't working label May 13, 2024
ffalor added a commit to ffalor/gofalcon that referenced this issue May 13, 2024
@ffalor
Copy link
Contributor

ffalor commented May 13, 2024

Hey @andrew-bab thanks for reporting this issue. It has been fixed. I plan on doing a new release of the sdk soon (v0.7.0), but in the meantime you can target the fixed commit:

go get github.com/crowdstrike/gofalcon/falcon@800c2ad

Your go.mod file should now look like this:

github.com/crowdstrike/gofalcon v0.6.1-0.20240513170451-800c2ad57f94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants