Skip to content

Show exploited machine name under "Stolen From" in stolen credentials section - #1004

Merged
mssalvatore merged 6 commits into
guardicore:developfrom
shreyamalviya:bugfix-incorrect-host-in-stolen-creds-report
Mar 3, 2021
Merged

mssalvatore merged 6 commits into
guardicore:developfrom
shreyamalviya:bugfix-incorrect-host-in-stolen-creds-report

Conversation

@shreyamalviya

Copy link
Copy Markdown
Contributor

Fixes #1001

@codecov

codecov Bot commented Feb 26, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #1004 (243e077) into develop (eb41376) will increase coverage by 1.43%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1004      +/-   ##
===========================================
+ Coverage    26.21%   27.64%   +1.43%     
===========================================
  Files          402      402              
  Lines        12830    12833       +3     
===========================================
+ Hits          3363     3548     +185     
+ Misses        9467     9285     -182     
Impacted Files Coverage ฮ”
monkey/monkey/monkey_island/cc/services/node.py 29.28% <0.00%> (+0.41%) โฌ†๏ธ
.../monkey_island/cc/services/reporting/pth_report.py 29.11% <0.00%> (+29.11%) โฌ†๏ธ
...nkey/monkey_island/cc/services/reporting/report.py 29.56% <0.00%> (+29.56%) โฌ†๏ธ
...ces/reporting/report_generation_synchronisation.py 33.33% <0.00%> (+33.33%) โฌ†๏ธ
...d/cc/services/reporting/report_exporter_manager.py 47.82% <0.00%> (+47.82%) โฌ†๏ธ
...nkey_island/cc/services/groups_and_users_consts.py 100.00% <0.00%> (+100.00%) โฌ†๏ธ

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 eb41376...243e077. Read the comment docs.

@mssalvatore

Copy link
Copy Markdown
Collaborator

In general, our process for fixing bugs should be:

  1. Write a test (or tests) that reproduces the bug. This test should fail.
  2. Fix the bug
  3. Verify that tests now pass.

Since we don't want to test private methods, we can write tests against get_stolen_creds(). This will exercise the flawed code. We can use mongomock to provide whatever data is necessary to reproduce the issue in the test.

These tests also help communicate the root cause of the bug.

@shreyamalviya
shreyamalviya force-pushed the bugfix-incorrect-host-in-stolen-creds-report branch 5 times, most recently from aa5d9e3 to b953d6e Compare March 3, 2021 11:32
@shreyamalviya
shreyamalviya force-pushed the bugfix-incorrect-host-in-stolen-creds-report branch from b953d6e to d772760 Compare March 3, 2021 11:38
@ghost

ghost commented Mar 3, 2021 •

Copy link
Copy Markdown

Congratulations ๐ŸŽ‰. DeepCode analyzed your code in 2.894 seconds and we found no issues. Enjoy a moment of no bugs โ˜€๏ธ.

๐Ÿ‘‰ View analysis in DeepCodeโ€™s Dashboard | Configure the bot


@staticmethod
def get_stolen_creds():
print(f"\n\n{list(mongo.db.telemetry.find())}\n\n")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this a debug statement that slipped in by accident?

@mssalvatore
mssalvatore merged commit bcc462e into guardicore:develop Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect host in "stolen from" column

2 participants