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

Refactoring/azure/network #242

Merged
merged 7 commits into from
Mar 13, 2019

Conversation

misg
Copy link
Contributor

@misg misg commented Mar 11, 2019

This PR aims to migrate Azure Network service to the new architecture, as part of #183.

@misg misg requested review from Aboisier, x4v13r64 and Remi05 March 11, 2019 15:57
@misg misg self-assigned this Mar 11, 2019
@misg misg added this to the Iteration #4 milestone Mar 11, 2019
@Aboisier Aboisier mentioned this pull request Mar 11, 2019
53 tasks
@misg misg force-pushed the refactoring/azure/network branch from 060bb81 to a2a7d27 Compare March 11, 2019 18:32
@codecov-io
Copy link

Codecov Report

Merging #242 into refactoring/resource-configs will increase coverage by 0.4%.
The diff coverage is 21.8%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##           refactoring/resource-configs     #242     +/-   ##
===============================================================
+ Coverage                         29.69%   30.09%   +0.4%     
===============================================================
  Files                               104      110      +6     
  Lines                              5415     5542    +127     
===============================================================
+ Hits                               1608     1668     +60     
- Misses                             3807     3874     +67
Impacted Files Coverage Δ
...azure/resources/network/network_security_groups.py 10.52% <10.52%> (ø)
...viders/azure/resources/network/network_watchers.py 31.25% <31.25%> (ø)
ScoutSuite/providers/azure/configs/services.py 53.06% <50%> (ø) ⬆️
...uite/providers/azure/resources/network/networks.py 63.63% <63.63%> (ø)
ScoutSuite/providers/azure/facade/network.py 66.66% <66.66%> (ø)
ScoutSuite/providers/aws/resources/regions.py 30.3% <0%> (-7.2%) ⬇️
ScoutSuite/providers/aws/facade/cloudtrail.py 40% <0%> (-5.46%) ⬇️
ScoutSuite/providers/aws/facade/utils.py 45% <0%> (-5%) ⬇️
ScoutSuite/providers/aws/facade/efs.py 28% <0%> (-3.58%) ⬇️
ScoutSuite/providers/aws/provider.py 10.27% <0%> (-0.03%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c7fc86...a2a7d27. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Mar 11, 2019

Codecov Report

Merging #242 into refactoring/resource-configs will increase coverage by 0.15%.
The diff coverage is 23.02%.

Impacted file tree graph

@@                       Coverage Diff                        @@
##           refactoring/resource-configs     #242      +/-   ##
================================================================
+ Coverage                         30.18%   30.34%   +0.15%     
================================================================
  Files                               115      118       +3     
  Lines                              5585     5612      +27     
================================================================
+ Hits                               1686     1703      +17     
- Misses                             3899     3909      +10
Impacted Files Coverage Δ
...azure/resources/network/network_security_groups.py 10.52% <10.52%> (ø)
...viders/azure/resources/network/network_watchers.py 31.25% <31.25%> (ø)
ScoutSuite/providers/azure/configs/services.py 53.06% <50%> (ø) ⬆️
...uite/providers/azure/resources/network/networks.py 63.63% <63.63%> (ø)
ScoutSuite/providers/azure/facade/network.py 66.66% <66.66%> (ø)
ScoutSuite/providers/azure/services/network.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a38af77...cfad7fc. Read the comment docs.

port_ranges.append(port_range)
return port_ranges

def _format_ports(self, ports):
Copy link
Contributor

@Aboisier Aboisier Mar 12, 2019

Choose a reason for hiding this comment

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

I feel like it would be worth writing one or two unit tests for this method, _parse_exposed_ports and _parse_ports. It should be pretty quick since they won't require any mocking or setup. It's a bit hard to see what the methods do, having basic unit tests would be a good way of documenting them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would you mind if I create an issue to do that and postpone it? I didn't write the _format_ports myself and this PR is just about moving the current code to the new architecture...

Copy link
Contributor

Choose a reason for hiding this comment

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

Of course 👍 !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done! (#255 )

@misg misg merged commit 01b998c into refactoring/resource-configs Mar 13, 2019
@misg misg deleted the refactoring/azure/network branch March 13, 2019 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants