Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Provide compliance results with partial success
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Claudius committed Sep 2, 2016
1 parent e9db099 commit 5e4701d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/ssh_scan/policy_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def missing_policy_compression
end

def out_of_policy_auth_methods
return [] if @result["auth_methods"].nil?

target_auth_methods = @result["auth_methods"]
outliers = []

Expand Down
22 changes: 17 additions & 5 deletions lib/ssh_scan/scan_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,25 @@ def scan_target(socket, opts)
"sha1" => fingerprint_sha1,
"sha256" => fingerprint_sha256,
}
# Do this only when no errors were reported
unless policy.nil?
policy_mgr = SSHScan::PolicyManager.new(result, policy)
result['compliance'] = policy_mgr.compliance_results
end
end
end

# Do this only when no errors were reported
if !policy.nil? &&
!result[:key_algorithms].nil? &&
!result[:server_host_key_algorithms].nil? &&
!result[:encryption_algorithms_client_to_server].nil? &&
!result[:encryption_algorithms_server_to_client].nil? &&
!result[:mac_algorithms_client_to_server].nil? &&
!result[:mac_algorithms_server_to_client].nil? &&
!result[:compression_algorithms_client_to_server].nil? &&
!result[:compression_algorithms_server_to_client].nil? &&
!result[:languages_client_to_server].nil? &&
!result[:languages_server_to_client].nil?
policy_mgr = SSHScan::PolicyManager.new(result, policy)
result['compliance'] = policy_mgr.compliance_results
end

return result
end

Expand Down

0 comments on commit 5e4701d

Please sign in to comment.