-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into robertomonteromiguel/onboarding_rh9_ami_update
- Loading branch information
Showing
45 changed files
with
584 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ | ||
"language": "", | ||
"pii": "", | ||
"id": "log170aa-acda-4453-9111-1478a600line", | ||
"where": { | ||
"typeName": null, | ||
"sourceFile": "ACTUAL_SOURCE_FILE", | ||
"lines": [ | ||
"33" | ||
] | ||
}, | ||
"captureSnapshot": true, | ||
"capture": { | ||
"maxFieldCount": 200 | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,35 +121,38 @@ def filter(keys_to_filter): | |
@features.debugger_pii_redaction | ||
@scenarios.debugger_pii_redaction | ||
class Test_Debugger_PII_Redaction(base._Base_Debugger_Test): | ||
def _setup(self): | ||
probes = base.read_probes("pii") | ||
def _setup(self, probes_file): | ||
probes = base.read_probes(probes_file) | ||
self.expected_probe_ids = base.extract_probe_ids(probes) | ||
self.rc_state = rc.send_debugger_command(probes, version=1) | ||
|
||
interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=30) | ||
|
||
self.weblog_responses = [weblog.get("/debugger/pii")] | ||
|
||
def _test(self, redacted_keys, redacted_types): | ||
def _test(self, redacted_keys, redacted_types, line_probe=False): | ||
self.assert_all_states_not_error() | ||
self.assert_all_probes_are_installed() | ||
self.assert_all_weblog_responses_ok() | ||
|
||
self._validate_pii_keyword_redaction(redacted_keys) | ||
self._validate_pii_type_redaction(redacted_types) | ||
self._validate_pii_keyword_redaction(redacted_keys, line_probe=line_probe) | ||
self._validate_pii_type_redaction(redacted_types, line_probe=line_probe) | ||
|
||
def setup_pii_redaction_full(self): | ||
self._setup() | ||
self._setup("pii") | ||
|
||
@missing_feature(context.library < "[email protected]", reason="keywords are not fully redacted") | ||
@missing_feature(context.library < "[email protected]", reason="keywords are not fully redacted") | ||
@bug(context.library == "[email protected]", reason="DEBUG-3127") | ||
@bug(context.library == "[email protected]", reason="DEBUG-3127") | ||
# Ruby requires @irrelevant rather than @missing_feature to skip setup | ||
# for this test (which will interfere with the line probe test). | ||
@irrelevant(context.library == "ruby", reason="Local variable capture not implemented for method probes") | ||
def test_pii_redaction_full(self): | ||
self._test(REDACTED_KEYS, REDACTED_TYPES) | ||
|
||
def setup_pii_redaction_java_1_33(self): | ||
self._setup() | ||
self._setup("pii") | ||
|
||
@irrelevant(context.library != "[email protected]", reason="not relevant for other version") | ||
def test_pii_redaction_java_1_33(self): | ||
|
@@ -170,7 +173,7 @@ def test_pii_redaction_java_1_33(self): | |
) | ||
|
||
def setup_pii_redaction_dotnet_2_50(self): | ||
self._setup() | ||
self._setup("pii") | ||
|
||
@irrelevant(context.library != "[email protected]", reason="not relevant for other version") | ||
@bug( | ||
|
@@ -179,7 +182,14 @@ def setup_pii_redaction_dotnet_2_50(self): | |
def test_pii_redaction_dotnet_2_50(self): | ||
self._test(filter(["applicationkey", "connectionstring"]), REDACTED_TYPES) | ||
|
||
def _validate_pii_keyword_redaction(self, should_redact_field_names): | ||
def setup_pii_redaction_line(self): | ||
self._setup("pii_line") | ||
|
||
@irrelevant(context.library != "ruby", reason="Ruby needs to use line probes to capture variables") | ||
def test_pii_redaction_line(self): | ||
self._test(REDACTED_KEYS, REDACTED_TYPES, True) | ||
|
||
def _validate_pii_keyword_redaction(self, should_redact_field_names, line_probe=False): | ||
agent_logs_endpoint_requests = list(interfaces.agent.get_data(path_filters="/api/v2/logs")) | ||
not_redacted = [] | ||
not_found = list(set(should_redact_field_names)) | ||
|
@@ -193,12 +203,21 @@ def _validate_pii_keyword_redaction(self, should_redact_field_names): | |
|
||
if snapshot: | ||
for field_name in should_redact_field_names: | ||
fields = snapshot["captures"]["return"]["locals"]["pii"]["fields"] | ||
|
||
if field_name in fields: | ||
if line_probe: | ||
fields = snapshot["captures"]["lines"]["33"]["locals"]["pii"]["fields"] | ||
else: | ||
fields = snapshot["captures"]["return"]["locals"]["pii"]["fields"] | ||
|
||
# Ruby prefixes instance variable names with @ | ||
if context.library == "ruby": | ||
check_field_name = "@" + field_name | ||
else: | ||
check_field_name = field_name | ||
|
||
if check_field_name in fields: | ||
not_found.remove(field_name) | ||
|
||
if "value" in fields[field_name]: | ||
if "value" in fields[check_field_name]: | ||
not_redacted.append(field_name) | ||
error_message = "" | ||
if not_redacted: | ||
|
@@ -212,7 +231,7 @@ def _validate_pii_keyword_redaction(self, should_redact_field_names): | |
if error_message != "": | ||
raise ValueError(error_message) | ||
|
||
def _validate_pii_type_redaction(self, should_redact_types): | ||
def _validate_pii_type_redaction(self, should_redact_types, line_probe=False): | ||
agent_logs_endpoint_requests = list(interfaces.agent.get_data(path_filters="/api/v2/logs")) | ||
not_redacted = [] | ||
|
||
|
@@ -225,7 +244,10 @@ def _validate_pii_type_redaction(self, should_redact_types): | |
|
||
if snapshot: | ||
for type_name in should_redact_types: | ||
type_info = snapshot["captures"]["return"]["locals"][type_name] | ||
if line_probe: | ||
type_info = snapshot["captures"]["lines"]["33"]["locals"][type_name] | ||
else: | ||
type_info = snapshot["captures"]["return"]["locals"][type_name] | ||
|
||
if "fields" in type_info: | ||
not_redacted.append(type_name) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
import tests.debugger.utils as base | ||
|
||
from utils import scenarios, features, remote_config as rc, bug, context | ||
from utils import weblog, scenarios, features, remote_config as rc, bug, context, missing_feature | ||
|
||
|
||
@features.debugger | ||
|
@@ -40,6 +40,7 @@ def setup_probe_status_metric(self): | |
|
||
@bug(context.library == "[email protected]", reason="DEBUG-3127") | ||
@bug(context.library == "[email protected]", reason="DEBUG-3127") | ||
@missing_feature(context.library == "ruby", reason="Not yet implemented") | ||
def test_probe_status_metric(self): | ||
self._assert() | ||
|
||
|
@@ -49,6 +50,7 @@ def setup_probe_status_span(self): | |
|
||
self._setup(probes) | ||
|
||
@missing_feature(context.library == "ruby", reason="Not yet implemented") | ||
def test_probe_status_span(self): | ||
self._assert() | ||
|
||
|
@@ -60,6 +62,7 @@ def setup_probe_status_spandecoration(self): | |
|
||
@bug(context.library == "[email protected]", reason="DEBUG-3127") | ||
@bug(context.library == "[email protected]", reason="DEBUG-3127") | ||
@missing_feature(context.library == "ruby", reason="Not yet implemented") | ||
def test_probe_status_spandecoration(self): | ||
self._assert() | ||
|
||
|
Oops, something went wrong.