Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Load whole config for SQS #791

Merged
merged 3 commits into from
Aug 28, 2017
Merged

Load whole config for SQS #791

merged 3 commits into from
Aug 28, 2017

Conversation

tabletcorry
Copy link
Contributor

Looking for feedback to start with, haven't tested this yet. Want to make sure that this kind of item config change is kosher.

Commit message follows:

Previously, the SQS watcher and ignored any queue without a policy. This
meant a subset of queues were invisible to security monkey.

Now, load all configuration for all SQS items, and make the policy a
child object, rather than the top level.

Delete the item counts from SQS items, as they change constantly, and we
don't care.

Previously, the SQS watcher and ignored any queue without a policy. This
meant a subset of queues were invisible to security monkey.

Now, load all configuration for all SQS items, and make the policy a
child object, rather than the top level.

Delete the item counts from SQS items, as they change constantly, and we
don't care.
# Delete ephemeral values
del attrs['ApproximateNumberOfMessagesNotVisible']
del attrs['ApproximateNumberOfMessages']
del attrs['ApproximateNumberOfMessagesDelayed']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of deleting ephemeral things, we can just tell SM that they are ephemeral:

Example from S3: https://github.com/Netflix/security_monkey/blob/develop/security_monkey/watchers/s3.py#L15

Example from IAM User: https://github.com/Netflix/security_monkey/blob/develop/security_monkey/watchers/iam/iam_user.py#L14

Just put this in the watcher constructor:

self.ephemeral_paths = [
    'ApproximateNumberOfMessagesNotVisible',
    'ApproximateNumberOfMessages',
    'ApproximateNumberOfMessagesDelayed']

@tabletcorry
Copy link
Contributor Author

Derp, sorry I didn't get back to this sooner. Thanks for making that fix.

Boto returns weird types that don't interact well with `deepcopy`.  Casting to a `dict` fixes it.
@scriptsrc scriptsrc merged commit 5354f5f into Netflix:develop Aug 28, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+3.08%) to 66.391% when pulling 24d967c on tabletcorry:develop into 0f29754 on Netflix:develop.

@tabletcorry
Copy link
Contributor Author

Cool! Just updated my instance, and it is slurping up the rest of the SQS items ❤️ (and spotting issues 😅).

@tabletcorry
Copy link
Contributor Author

It looks like the ephemeral path filtering doesn't work? I am seeing the configs get captured for all SQS items every hour, as the message counts are changing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants