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

Removed scanner details message #80

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions discoverx/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def scan_result(self):

return self._scan_result.df

def display_rules(self):
"""Displays the available rules in a friendly HTML format"""
text = self.rules.get_rules_info()
logger.friendlyHTML(text)

def search(
self,
search_term: str,
Expand Down
3 changes: 0 additions & 3 deletions discoverx/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,6 @@ def summary_html(self) -> str:
To be more precise:
</p>
{summary_html_table}
<p>
You can see the full classification output with 'dx.scan_result'.
</p>


"""
11 changes: 11 additions & 0 deletions tests/unit/discovery_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ def test_discover_select_by_class(discover_ip):
discover_ip.select_by_classes(from_tables="invalid from", by_classes="email")


def test_discover_display_rules(capfd, discover_ip):
# search a specific term and auto-detect matching classes/rules
discover_ip.display_rules()

captured = capfd.readouterr()
assert "Matching rules" in captured.out
assert "built-in rules that are available to you:" in captured.out
assert "mac_address - MAC Addresses" in captured.out
assert "credit_card_expiration_date" in captured.out


def test_discover_delete_by_class(spark, discover_ip):
# search a specific term and auto-detect matching classes/rules
discover_ip.delete_by_class(from_tables="*.default.tb_*", by_class="ip_v4", values="9.9.9.9")
Expand Down
Loading