Skip to content

Add reporting of parent services to credential service - #201

Merged
adfoster-r7 merged 3 commits into
rapid7:masterfrom
sjanusz-r7:add-reporting-of-parent-services-to-credential-service
May 28, 2026
Merged

Add reporting of parent services to credential service#201
adfoster-r7 merged 3 commits into
rapid7:masterfrom
sjanusz-r7:add-reporting-of-parent-services-to-credential-service

Conversation

@sjanusz-r7

@sjanusz-r7 sjanusz-r7 commented May 21, 2026

Copy link
Copy Markdown
Contributor

This PR allows for service hierarchy reporting when calling off to report_credential_service.

rapid7/metasploit-framework#21488

@sjanusz-r7
sjanusz-r7 force-pushed the add-reporting-of-parent-services-to-credential-service branch from 7abc27f to 6aa3ade Compare May 21, 2026 15:08
@sjanusz-r7
sjanusz-r7 force-pushed the add-reporting-of-parent-services-to-credential-service branch from 6aa3ade to bec404a Compare May 21, 2026 15:19
@sjanusz-r7
sjanusz-r7 force-pushed the add-reporting-of-parent-services-to-credential-service branch from bec404a to 0aa86f1 Compare May 21, 2026 15:48
@adfoster-r7
adfoster-r7 requested a review from Copilot May 28, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 :resource assignment to credential service creation.
  • Adds :parents handling and a recursive process_service_chain helper 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 thread lib/metasploit/credential/creation.rb Outdated
Comment thread lib/metasploit/credential/creation.rb Outdated
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>
@adfoster-r7
adfoster-r7 merged commit 27f086f into rapid7:master May 28, 2026
2 checks passed
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.

3 participants