Improve security: redact sensitive evidence, tighten scope checks, secure persistence, and test coverage - #1
Closed
prithvee07 wants to merge 1 commit into
Closed
Improve security: redact sensitive evidence, tighten scope checks, secure persistence, and test coverage#1prithvee07 wants to merge 1 commit into
prithvee07 wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
utils/redaction.pyand integratedredact_sensitive_textincore/workflow.pyand when saving tool executions so raw tool evidence and analyst inputs have common credential patterns redacted.tools/base_tool.pyso the logged/storedcommandis always the sanitized form returned by_sanitize_command_for_loggingand never the raw executable arguments.PentestMemory.save_stateand workflow report/session save paths now create directories with mode0o700and create files with0o600viaos.open/os.fchmodto avoid world-readable secrets.core/workflow.pyto reduce TOCTOU/DNS-rebinding windows.utils/scope_validator.pyblacklist behavior to block non-global addresses (including IPv6 ULA and IPv4 link-local) and explicit special names, and continue to resolve hostnames and check resolved IPs against blacklist networks.tools/nmap.pyto reject XML inputs containing DTDs/entities and inputs larger than 10 MiB before parsing to mitigate entity expansion and memory exhaustion.pyproject.tomlto avoid inadvertent major-version upgrades in release builds.tests/test_redaction.py, additional assertions intests/test_memory.py, new nmap safety tests intests/test_nmap_tool.py, added behavior test intests/test_base_tool.py, and extended blacklist cases intests/test_scope_validator.py.Testing
pytestincludingtests/test_memory.py,tests/test_redaction.py,tests/test_nmap_tool.py,tests/test_base_tool.py, andtests/test_scope_validator.py, and all tests passed.Codex Task