Add reporting of parent services to credential service - #201
Merged
adfoster-r7 merged 3 commits intoMay 28, 2026
Merged
Conversation
sjanusz-r7
force-pushed
the
add-reporting-of-parent-services-to-credential-service
branch
from
May 21, 2026 15:08
7abc27f to
6aa3ade
Compare
4 tasks
sjanusz-r7
force-pushed
the
add-reporting-of-parent-services-to-credential-service
branch
from
May 21, 2026 15:19
6aa3ade to
bec404a
Compare
sjanusz-r7
force-pushed
the
add-reporting-of-parent-services-to-credential-service
branch
from
May 21, 2026 15:48
bec404a to
0aa86f1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends credential service creation so callers can report service hierarchy metadata when creating Mdm::Service records for credential logins.
Changes:
- Adds
:resourceassignment to credential service creation. - Adds
:parentshandling and a recursiveprocess_service_chainhelper for parent service creation/association. - Links resolved parent services to the newly created credential service.
Impact Analysis:
- Blast radius: medium; affects credential service reporting paths and consumers passing service hierarchy data.
- Data and contract effects: adds parent service associations and resource persistence for
Mdm::Service; incorrect alias handling or persistence can create incomplete service hierarchy records. - Rollback and test focus: rollback is code-only; highest-value validation is credential service creation with
parents,resource, recursive parents, and framework-independent gem loading.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| when ::Mdm::Service | ||
| service_obj = service | ||
| when ::Hash | ||
| next if service[:port].nil? || service[:proto].nil? |
Comment on lines
+661
to
+665
| service_info = { | ||
| port: service[:port].to_i, | ||
| proto: service[:proto].to_s.downcase, | ||
| } | ||
| service_info[:name] = service[:name].downcase if service[:name] |
Comment on lines
+672
to
+673
| service_obj.state ||= Msf::ServiceState::Open | ||
| service_obj.info = service[:info] ? service[:info] : '' |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
This PR allows for service hierarchy reporting when calling off to
report_credential_service.rapid7/metasploit-framework#21488