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

Enhancement/Leverage httplib2shim for GCP Client Libraries #676

Merged
merged 4 commits into from
Mar 22, 2020

Conversation

x4v13r64
Copy link
Collaborator

@x4v13r64 x4v13r64 commented Mar 17, 2020

Description

Test fix for #665 & #443, leveraging https://github.com/GoogleCloudPlatform/httplib2shim.

Ran with no errors on my end, with the additional improvements:

  • Completed in 36 seconds vs 4.26 minutes
  • Used 85MB or memory vs 190MB

Type of change

Select the relevant option(s):

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (optional)
  • New and existing unit tests pass locally with my changes

@x4v13r64 x4v13r64 changed the base branch from master to develop March 17, 2020 09:54
@x4v13r64 x4v13r64 added component-provider-gcp Affects GCP provider enhancement New feature or request labels Mar 17, 2020
@x4v13r64
Copy link
Collaborator Author

@rtomlinson-latacora, @kareem-DA, @nycnewman please test.

@kareem-DA
Copy link

kareem-DA commented Mar 17, 2020 via email

@rtomlinson-latacora
Copy link
Contributor

I ran with --all-projects and it only took ~5 minutes with expected errors. Huge improvement. Nice find @j4v .
What command did you use @kareem-DA? That looks like it might just be a bug in the _get_projects_recursively logic for folders.

@x4v13r64
Copy link
Collaborator Author

I ran with --all-projects and it only took ~5 minutes with expected errors. Huge improvement. Nice find @j4v .

If you look at the cprofile a huge % of the time was spent just creating the clients so I'm not surprised. What was the previous run time like?

@x4v13r64
Copy link
Collaborator Author

x4v13r64 commented Mar 17, 2020

I ran test/httplib2shim and I got the following error:

That's odd - the same command runs fine in develop or master? Can you provide full input/output please... The changes in this PR shouldn't affect the functionality you describe.

See below.

@kareem-DA
Copy link

kareem-DA commented Mar 17, 2020 via email

@x4v13r64
Copy link
Collaborator Author

x4v13r64 commented Mar 17, 2020

Ok bug confirmed, fixing.

@kareem-DA should now be fixed, please retest?

@rtomlinson-latacora
Copy link
Contributor

ScoutSuite was running for 2-3 hours with my semaphore fix for a large organization.

@x4v13r64
Copy link
Collaborator Author

ScoutSuite was running for 2-3 hours with my semaphore fix for a large organization.

2-3h to 5 minutes???

@rtomlinson-latacora
Copy link
Contributor

ScoutSuite was running for 2-3 hours with my semaphore fix for a large organization.

2-3h to 5 minutes???

Haha, yeah. I was being pretty conservative with the semaphores so I probably could have cut that time down.

@x4v13r64
Copy link
Collaborator Author

ScoutSuite was running for 2-3 hours with my semaphore fix for a large organization.

2-3h to 5 minutes???

Haha, yeah. I was being pretty conservative with the semaphores so I probably could have cut that time down.

Well great, that's a tremendous improvement. Could you confirm that the report generated is the same? A quick diff against the results JSON should only show 2-3 differences.

@rtomlinson-latacora
Copy link
Contributor

ScoutSuite was running for 2-3 hours with my semaphore fix for a large organization.

2-3h to 5 minutes???

Haha, yeah. I was being pretty conservative with the semaphores so I probably could have cut that time down.

Well great, that's a tremendous improvement. Could you confirm that the report generated is the same? A quick diff against the results JSON should only show 2-3 differences.

Yup. Running it the old way with the semaphore now since I already overwrote the existing report. It'll be a little while but I'll get you a response.

@kareem-DA
Copy link

kareem-DA commented Mar 17, 2020 via email

@x4v13r64
Copy link
Collaborator Author

This is much better. Ran the entire org in 3 minutes. All services and all projects. The results look accurate as well.

Great, I'll run some tests on my end and integrate into develop. Thanks both!

@rtomlinson-latacora
Copy link
Contributor

Findings are comparable on my end as well.

@x4v13r64 x4v13r64 merged commit 7ec5749 into develop Mar 22, 2020
@x4v13r64 x4v13r64 deleted the test/httplib2shim branch March 22, 2020 15:34
@x4v13r64
Copy link
Collaborator Author

Thanks @rtomlinson-latacora & @kareem-DA, this has now been merged into develop. I'll release v5.8 ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-provider-gcp Affects GCP provider enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants