guacsec / guac

GUAC aggregates software security metadata into a high fidelity graph database.
https://guac.sh
Apache License 2.0
1.28k stars 176 forks source link

[bug] Guaccollect s3 polling not working #2277

Open ANIRUDH-333 opened 5 days ago

ANIRUDH-333 commented 5 days ago

Describe the bug Guaccollect doesn't recognise the poll flag and polling doesn't happen when we don't give any flag. It just ingests the existing artifacts and quits.

To Reproduce Run the following command

guaccollect s3 \
    --blob-addr="s3://test-blobstore?region=us-west-2" \
    --s3-region us-west-2 \
    --s3-url https://s3.us-west-2.amazonaws.com/ \
    --s3-bucket test-artifacts \
    --s3-mp-endpoint https://sqs.us-west-2.amazonaws.com/123234556/test-collect-event \
    --s3-queues test-collect-event \
    --s3-mp sqs

Expected behavior guaccollect is supposed to keep running and should ingest the new artifacts as they are added to the bucket.

GUAC version 0.10.2

ANIRUDH-333 commented 5 days ago

On diving deeper into the code, inside guaccollect dir, we found that the s3.go expects poll flag (viper.GetBool("poll")). But the root command uses the service-poll flag. Besides that, s3.go flag set doesn't mention the poll flag. We found that the files.go uses the service-poll flag and when we made that change, it started working. If this change is acceptable, we can contribute for the fix.