Module: VeracodeApiMacros

Includes:
VeracodeApiResults, VeracodeApiScan
Defined in:
lib/veracodecli/api.rb

Instance Method Summary collapse

Methods included from VeracodeApiResults

#get_most_recent_build_id, #get_prescan_results, #get_scan_report, #get_scan_report_pdf

Methods included from VeracodeApiBase

#get_repo_archive, #parse_new_app_id, #response_parse_app_id, #veracode_api_request

Methods included from VeracodeApiScan

#create_app_profile, #get_app_id, #submit_prescan, #upload_file

Instance Method Details

#get_pdf_macro(app_name) ⇒ Object



136
137
138
139
140
141
142
143
144
145
# File 'lib/veracodecli/api.rb', line 136

def get_pdf_macro(app_name)
  app_id = get_app_id app_name
  build_id = get_most_recent_build_id app_id
  report = get_scan_report_pdf build_id
  file_path = "/tmp/#{build_id}_report.pdf"
  file = File.open file_path, 'w+'
  file.write report
  file.close
  return file_path
end

#get_report_macro(app_name) ⇒ Object



130
131
132
133
134
# File 'lib/veracodecli/api.rb', line 130

def get_report_macro(app_name)
  app_id = get_app_id app_name
  build_id = get_most_recent_build_id app_id
  p get_scan_report build_id
end

#submit_scan_macro(app_name, business_criticality, business_unit, team) ⇒ Object



118
119
120
121
122
123
124
125
126
127
128
# File 'lib/veracodecli/api.rb', line 118

def submit_scan_macro(app_name, business_criticality, business_unit, team)
  archive_path = "/tmp/sast_upload.zip"
  app_id = get_app_id(app_name)
  if app_id.nil?
    app_id = create_app_profile(app_name, business_criticality, business_unit, team)
  end
  upload = upload_file app_id, archive_path
  ResponseLogger.new.log upload
  submit_prescan app_id
  File.delete archive_path
end