Skip to content
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
14 changes: 14 additions & 0 deletions app/models/mdm/vuln_attempt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ class Mdm::VulnAttempt < ApplicationRecord
#
# @return [String]

# @!attribute check_code
# The check code returned by the module's check method, if this attempt
# was a vulnerability check rather than an exploitation attempt.
#
# @return [String] one of 'vulnerable', 'appears', 'safe', 'detected', 'unknown'
# @return [nil] if this was an exploitation attempt, not a check

# @!attribute check_detail
# The human-readable message from the module's check method describing
# why the target was determined to be vulnerable, safe, etc.
#
# @return [String] if {#check_code} is present.
# @return [nil] if this was an exploitation attempt, not a check

# @!attribute username
# The {Mdm::User#username name of the user} that made this attempt.
#
Expand Down
6 changes: 6 additions & 0 deletions db/migrate/20260411000000_add_check_code_to_vuln_attempts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddCheckCodeToVulnAttempts < ActiveRecord::Migration[7.0]
def change
add_column :vuln_attempts, :check_code, :string
add_column :vuln_attempts, :check_detail, :text
end
Comment thread
adfoster-r7 marked this conversation as resolved.
end
2 changes: 2 additions & 0 deletions spec/app/models/mdm/vuln_attempt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
it { is_expected.to have_db_column(:session_id).of_type(:integer) }
it { is_expected.to have_db_column(:loot_id).of_type(:integer) }
it { is_expected.to have_db_column(:fail_detail).of_type(:text) }
it { is_expected.to have_db_column(:check_code).of_type(:string) }
it { is_expected.to have_db_column(:check_detail).of_type(:text) }
end
end

Expand Down
5 changes: 4 additions & 1 deletion spec/dummy/db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,9 @@ CREATE TABLE public.vuln_attempts (
module text,
session_id integer,
loot_id integer,
fail_detail text
fail_detail text,
check_code character varying,
check_detail text
);


Expand Down Expand Up @@ -3602,6 +3604,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20250721114306'),
('20251231162000'),
('20260130124052'),
('20260411000000'),
('21'),
('22'),
('23'),
Expand Down
Loading