codegurusecurity.d.ts 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. import {Request} from '../lib/request';
  2. import {Response} from '../lib/response';
  3. import {AWSError} from '../lib/error';
  4. import {Service} from '../lib/service';
  5. import {ServiceConfigurationOptions} from '../lib/service';
  6. import {ConfigBase as Config} from '../lib/config-base';
  7. interface Blob {}
  8. declare class CodeGuruSecurity extends Service {
  9. /**
  10. * Constructs a service object. This object has one method for each API operation.
  11. */
  12. constructor(options?: CodeGuruSecurity.Types.ClientConfiguration)
  13. config: Config & CodeGuruSecurity.Types.ClientConfiguration;
  14. /**
  15. * Returns a list of all requested findings.
  16. */
  17. batchGetFindings(params: CodeGuruSecurity.Types.BatchGetFindingsRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.BatchGetFindingsResponse) => void): Request<CodeGuruSecurity.Types.BatchGetFindingsResponse, AWSError>;
  18. /**
  19. * Returns a list of all requested findings.
  20. */
  21. batchGetFindings(callback?: (err: AWSError, data: CodeGuruSecurity.Types.BatchGetFindingsResponse) => void): Request<CodeGuruSecurity.Types.BatchGetFindingsResponse, AWSError>;
  22. /**
  23. * Use to create a scan using code uploaded to an S3 bucket.
  24. */
  25. createScan(params: CodeGuruSecurity.Types.CreateScanRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.CreateScanResponse) => void): Request<CodeGuruSecurity.Types.CreateScanResponse, AWSError>;
  26. /**
  27. * Use to create a scan using code uploaded to an S3 bucket.
  28. */
  29. createScan(callback?: (err: AWSError, data: CodeGuruSecurity.Types.CreateScanResponse) => void): Request<CodeGuruSecurity.Types.CreateScanResponse, AWSError>;
  30. /**
  31. * Generates a pre-signed URL and request headers used to upload a code resource. You can upload your code resource to the URL and add the request headers using any HTTP client.
  32. */
  33. createUploadUrl(params: CodeGuruSecurity.Types.CreateUploadUrlRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.CreateUploadUrlResponse) => void): Request<CodeGuruSecurity.Types.CreateUploadUrlResponse, AWSError>;
  34. /**
  35. * Generates a pre-signed URL and request headers used to upload a code resource. You can upload your code resource to the URL and add the request headers using any HTTP client.
  36. */
  37. createUploadUrl(callback?: (err: AWSError, data: CodeGuruSecurity.Types.CreateUploadUrlResponse) => void): Request<CodeGuruSecurity.Types.CreateUploadUrlResponse, AWSError>;
  38. /**
  39. * Use to get account level configuration.
  40. */
  41. getAccountConfiguration(params: CodeGuruSecurity.Types.GetAccountConfigurationRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.GetAccountConfigurationResponse) => void): Request<CodeGuruSecurity.Types.GetAccountConfigurationResponse, AWSError>;
  42. /**
  43. * Use to get account level configuration.
  44. */
  45. getAccountConfiguration(callback?: (err: AWSError, data: CodeGuruSecurity.Types.GetAccountConfigurationResponse) => void): Request<CodeGuruSecurity.Types.GetAccountConfigurationResponse, AWSError>;
  46. /**
  47. * Returns a list of all findings generated by a particular scan.
  48. */
  49. getFindings(params: CodeGuruSecurity.Types.GetFindingsRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.GetFindingsResponse) => void): Request<CodeGuruSecurity.Types.GetFindingsResponse, AWSError>;
  50. /**
  51. * Returns a list of all findings generated by a particular scan.
  52. */
  53. getFindings(callback?: (err: AWSError, data: CodeGuruSecurity.Types.GetFindingsResponse) => void): Request<CodeGuruSecurity.Types.GetFindingsResponse, AWSError>;
  54. /**
  55. * Returns top level metrics about an account from a specified date, including number of open findings, the categories with most findings, the scans with most open findings, and scans with most open critical findings.
  56. */
  57. getMetricsSummary(params: CodeGuruSecurity.Types.GetMetricsSummaryRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.GetMetricsSummaryResponse) => void): Request<CodeGuruSecurity.Types.GetMetricsSummaryResponse, AWSError>;
  58. /**
  59. * Returns top level metrics about an account from a specified date, including number of open findings, the categories with most findings, the scans with most open findings, and scans with most open critical findings.
  60. */
  61. getMetricsSummary(callback?: (err: AWSError, data: CodeGuruSecurity.Types.GetMetricsSummaryResponse) => void): Request<CodeGuruSecurity.Types.GetMetricsSummaryResponse, AWSError>;
  62. /**
  63. * Returns details about a scan, including whether or not a scan has completed.
  64. */
  65. getScan(params: CodeGuruSecurity.Types.GetScanRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.GetScanResponse) => void): Request<CodeGuruSecurity.Types.GetScanResponse, AWSError>;
  66. /**
  67. * Returns details about a scan, including whether or not a scan has completed.
  68. */
  69. getScan(callback?: (err: AWSError, data: CodeGuruSecurity.Types.GetScanResponse) => void): Request<CodeGuruSecurity.Types.GetScanResponse, AWSError>;
  70. /**
  71. * Returns metrics about all findings in an account within a specified time range.
  72. */
  73. listFindingsMetrics(params: CodeGuruSecurity.Types.ListFindingsMetricsRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.ListFindingsMetricsResponse) => void): Request<CodeGuruSecurity.Types.ListFindingsMetricsResponse, AWSError>;
  74. /**
  75. * Returns metrics about all findings in an account within a specified time range.
  76. */
  77. listFindingsMetrics(callback?: (err: AWSError, data: CodeGuruSecurity.Types.ListFindingsMetricsResponse) => void): Request<CodeGuruSecurity.Types.ListFindingsMetricsResponse, AWSError>;
  78. /**
  79. * Returns a list of all the standard scans in an account. Does not return express scans.
  80. */
  81. listScans(params: CodeGuruSecurity.Types.ListScansRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.ListScansResponse) => void): Request<CodeGuruSecurity.Types.ListScansResponse, AWSError>;
  82. /**
  83. * Returns a list of all the standard scans in an account. Does not return express scans.
  84. */
  85. listScans(callback?: (err: AWSError, data: CodeGuruSecurity.Types.ListScansResponse) => void): Request<CodeGuruSecurity.Types.ListScansResponse, AWSError>;
  86. /**
  87. * Returns a list of all tags associated with a scan.
  88. */
  89. listTagsForResource(params: CodeGuruSecurity.Types.ListTagsForResourceRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.ListTagsForResourceResponse) => void): Request<CodeGuruSecurity.Types.ListTagsForResourceResponse, AWSError>;
  90. /**
  91. * Returns a list of all tags associated with a scan.
  92. */
  93. listTagsForResource(callback?: (err: AWSError, data: CodeGuruSecurity.Types.ListTagsForResourceResponse) => void): Request<CodeGuruSecurity.Types.ListTagsForResourceResponse, AWSError>;
  94. /**
  95. * Use to add one or more tags to an existing scan.
  96. */
  97. tagResource(params: CodeGuruSecurity.Types.TagResourceRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.TagResourceResponse) => void): Request<CodeGuruSecurity.Types.TagResourceResponse, AWSError>;
  98. /**
  99. * Use to add one or more tags to an existing scan.
  100. */
  101. tagResource(callback?: (err: AWSError, data: CodeGuruSecurity.Types.TagResourceResponse) => void): Request<CodeGuruSecurity.Types.TagResourceResponse, AWSError>;
  102. /**
  103. * Use to remove one or more tags from an existing scan.
  104. */
  105. untagResource(params: CodeGuruSecurity.Types.UntagResourceRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.UntagResourceResponse) => void): Request<CodeGuruSecurity.Types.UntagResourceResponse, AWSError>;
  106. /**
  107. * Use to remove one or more tags from an existing scan.
  108. */
  109. untagResource(callback?: (err: AWSError, data: CodeGuruSecurity.Types.UntagResourceResponse) => void): Request<CodeGuruSecurity.Types.UntagResourceResponse, AWSError>;
  110. /**
  111. * Use to update account-level configuration with an encryption key.
  112. */
  113. updateAccountConfiguration(params: CodeGuruSecurity.Types.UpdateAccountConfigurationRequest, callback?: (err: AWSError, data: CodeGuruSecurity.Types.UpdateAccountConfigurationResponse) => void): Request<CodeGuruSecurity.Types.UpdateAccountConfigurationResponse, AWSError>;
  114. /**
  115. * Use to update account-level configuration with an encryption key.
  116. */
  117. updateAccountConfiguration(callback?: (err: AWSError, data: CodeGuruSecurity.Types.UpdateAccountConfigurationResponse) => void): Request<CodeGuruSecurity.Types.UpdateAccountConfigurationResponse, AWSError>;
  118. }
  119. declare namespace CodeGuruSecurity {
  120. export interface AccountFindingsMetric {
  121. /**
  122. * The number of closed findings of each severity in an account on the specified date.
  123. */
  124. closedFindings?: FindingMetricsValuePerSeverity;
  125. /**
  126. * The date from which the finding metrics were retrieved.
  127. */
  128. date?: Timestamp;
  129. /**
  130. * The average time it takes to close findings of each severity in days.
  131. */
  132. meanTimeToClose?: FindingMetricsValuePerSeverity;
  133. /**
  134. * The number of new findings of each severity in account on the specified date.
  135. */
  136. newFindings?: FindingMetricsValuePerSeverity;
  137. /**
  138. * The number of open findings of each severity in an account as of the specified date.
  139. */
  140. openFindings?: FindingMetricsValuePerSeverity;
  141. }
  142. export type AnalysisType = "Security"|"All"|string;
  143. export interface BatchGetFindingsError {
  144. /**
  145. * A code associated with the type of error.
  146. */
  147. errorCode: ErrorCode;
  148. /**
  149. * The finding ID of the finding that was not fetched.
  150. */
  151. findingId: String;
  152. /**
  153. * Describes the error.
  154. */
  155. message: String;
  156. /**
  157. * The name of the scan that generated the finding.
  158. */
  159. scanName: ScanName;
  160. }
  161. export type BatchGetFindingsErrors = BatchGetFindingsError[];
  162. export interface BatchGetFindingsRequest {
  163. /**
  164. * A list of finding identifiers. Each identifier consists of a scanName and a findingId. You retrieve the findingId when you call GetFindings.
  165. */
  166. findingIdentifiers: FindingIdentifiers;
  167. }
  168. export interface BatchGetFindingsResponse {
  169. /**
  170. * A list of errors for individual findings which were not fetched. Each BatchGetFindingsError contains the scanName, findingId, errorCode and error message.
  171. */
  172. failedFindings: BatchGetFindingsErrors;
  173. /**
  174. * A list of all requested findings.
  175. */
  176. findings: Findings;
  177. }
  178. export type CategoriesWithMostFindings = CategoryWithFindingNum[];
  179. export interface CategoryWithFindingNum {
  180. /**
  181. * The name of the finding category. A finding category is determined by the detector that detected the finding.
  182. */
  183. categoryName?: String;
  184. /**
  185. * The number of open findings in the category.
  186. */
  187. findingNumber?: Integer;
  188. }
  189. export type ClientToken = string;
  190. export interface CodeLine {
  191. /**
  192. * The code that contains a vulnerability.
  193. */
  194. content?: String;
  195. /**
  196. * The code line number.
  197. */
  198. number?: Integer;
  199. }
  200. export type CodeSnippet = CodeLine[];
  201. export interface CreateScanRequest {
  202. /**
  203. * The type of analysis you want CodeGuru Security to perform in the scan, either Security or All. The Security type only generates findings related to security. The All type generates both security findings and quality findings. Defaults to Security type if missing.
  204. */
  205. analysisType?: AnalysisType;
  206. /**
  207. * The idempotency token for the request. Amazon CodeGuru Security uses this value to prevent the accidental creation of duplicate scans if there are failures and retries.
  208. */
  209. clientToken?: ClientToken;
  210. /**
  211. * The identifier for an input resource used to create a scan.
  212. */
  213. resourceId: ResourceId;
  214. /**
  215. * The unique name that CodeGuru Security uses to track revisions across multiple scans of the same resource. Only allowed for a STANDARD scan type. If not specified, it will be auto generated.
  216. */
  217. scanName: ScanName;
  218. /**
  219. * The type of scan, either Standard or Express. Defaults to Standard type if missing. Express scans run on limited resources and use a limited set of detectors to analyze your code in near-real time. Standard scans have standard resource limits and use the full set of detectors to analyze your code.
  220. */
  221. scanType?: ScanType;
  222. /**
  223. * An array of key-value pairs used to tag a scan. A tag is a custom attribute label with two parts: A tag key. For example, CostCenter, Environment, or Secret. Tag keys are case sensitive. An optional tag value field. For example, 111122223333, Production, or a team name. Omitting the tag value is the same as using an empty string. Tag values are case sensitive.
  224. */
  225. tags?: TagMap;
  226. }
  227. export interface CreateScanResponse {
  228. /**
  229. * The identifier for the resource object that contains resources that were scanned.
  230. */
  231. resourceId: ResourceId;
  232. /**
  233. * UUID that identifies the individual scan run.
  234. */
  235. runId: Uuid;
  236. /**
  237. * The name of the scan.
  238. */
  239. scanName: ScanName;
  240. /**
  241. * The ARN for the scan name.
  242. */
  243. scanNameArn?: ScanNameArn;
  244. /**
  245. * The current state of the scan. Returns either InProgress, Successful, or Failed.
  246. */
  247. scanState: ScanState;
  248. }
  249. export interface CreateUploadUrlRequest {
  250. /**
  251. * The name of the scan that will use the uploaded resource. CodeGuru Security uses the unique scan name to track revisions across multiple scans of the same resource. Use this scanName when you call CreateScan on the code resource you upload to this URL.
  252. */
  253. scanName: ScanName;
  254. }
  255. export interface CreateUploadUrlResponse {
  256. /**
  257. * The identifier for the uploaded code resource.
  258. */
  259. codeArtifactId: Uuid;
  260. /**
  261. * A set of key-value pairs that contain the required headers when uploading your resource.
  262. */
  263. requestHeaders: RequestHeaderMap;
  264. /**
  265. * A pre-signed S3 URL. You can upload the code file you want to scan and add the required requestHeaders using any HTTP client.
  266. */
  267. s3Url: S3Url;
  268. }
  269. export type DetectorTags = String[];
  270. export type Double = number;
  271. export interface EncryptionConfig {
  272. /**
  273. * The KMS key ARN to use for encryption. This must be provided as a header when uploading your code resource.
  274. */
  275. kmsKeyArn?: KmsKeyArn;
  276. }
  277. export type ErrorCode = "DUPLICATE_IDENTIFIER"|"ITEM_DOES_NOT_EXIST"|"INTERNAL_ERROR"|"INVALID_FINDING_ID"|"INVALID_SCAN_NAME"|string;
  278. export interface FilePath {
  279. /**
  280. * A list of CodeLine objects that describe where the security vulnerability appears in your code.
  281. */
  282. codeSnippet?: CodeSnippet;
  283. /**
  284. * The last line number of the code snippet where the security vulnerability appears in your code.
  285. */
  286. endLine?: Integer;
  287. /**
  288. * The name of the file.
  289. */
  290. name?: String;
  291. /**
  292. * The path to the resource with the security vulnerability.
  293. */
  294. path?: String;
  295. /**
  296. * The first line number of the code snippet where the security vulnerability appears in your code.
  297. */
  298. startLine?: Integer;
  299. }
  300. export interface Finding {
  301. /**
  302. * The time when the finding was created.
  303. */
  304. createdAt?: Timestamp;
  305. /**
  306. * A description of the finding.
  307. */
  308. description?: String;
  309. /**
  310. * The identifier for the detector that detected the finding in your code. A detector is a defined rule based on industry standards and AWS best practices.
  311. */
  312. detectorId?: String;
  313. /**
  314. * The name of the detector that identified the security vulnerability in your code.
  315. */
  316. detectorName?: String;
  317. /**
  318. * One or more tags or categorizations that are associated with a detector. These tags are defined by type, programming language, or other classification such as maintainability or consistency.
  319. */
  320. detectorTags?: DetectorTags;
  321. /**
  322. * The identifier for the component that generated a finding such as AWSCodeGuruSecurity or AWSInspector.
  323. */
  324. generatorId?: String;
  325. /**
  326. * The identifier for a finding.
  327. */
  328. id?: String;
  329. /**
  330. * An object that contains the details about how to remediate a finding.
  331. */
  332. remediation?: Remediation;
  333. /**
  334. * The resource where Amazon CodeGuru Security detected a finding.
  335. */
  336. resource?: Resource;
  337. /**
  338. * The identifier for the rule that generated the finding.
  339. */
  340. ruleId?: String;
  341. /**
  342. * The severity of the finding.
  343. */
  344. severity?: Severity;
  345. /**
  346. * The status of the finding. A finding status can be open or closed.
  347. */
  348. status?: Status;
  349. /**
  350. * The title of the finding.
  351. */
  352. title?: String;
  353. /**
  354. * The type of finding.
  355. */
  356. type?: String;
  357. /**
  358. * The time when the finding was last updated. Findings are updated when you remediate them or when the finding code location changes.
  359. */
  360. updatedAt?: Timestamp;
  361. /**
  362. * An object that describes the detected security vulnerability.
  363. */
  364. vulnerability?: Vulnerability;
  365. }
  366. export interface FindingIdentifier {
  367. /**
  368. * The identifier for a finding.
  369. */
  370. findingId: String;
  371. /**
  372. * The name of the scan that generated the finding.
  373. */
  374. scanName: String;
  375. }
  376. export type FindingIdentifiers = FindingIdentifier[];
  377. export interface FindingMetricsValuePerSeverity {
  378. /**
  379. * The severity of the finding is critical and should be addressed immediately.
  380. */
  381. critical?: Double;
  382. /**
  383. * The severity of the finding is high and should be addressed as a near-term priority.
  384. */
  385. high?: Double;
  386. /**
  387. * The finding is related to quality or readability improvements and not considered actionable.
  388. */
  389. info?: Double;
  390. /**
  391. * The severity of the finding is low and does require action on its own.
  392. */
  393. low?: Double;
  394. /**
  395. * The severity of the finding is medium and should be addressed as a mid-term priority.
  396. */
  397. medium?: Double;
  398. }
  399. export type Findings = Finding[];
  400. export type FindingsMetricList = AccountFindingsMetric[];
  401. export interface GetAccountConfigurationRequest {
  402. }
  403. export interface GetAccountConfigurationResponse {
  404. /**
  405. * An EncryptionConfig object that contains the KMS key ARN to use for encryption. By default, CodeGuru Security uses an AWS-managed key for encryption. To specify your own key, call UpdateAccountConfiguration.
  406. */
  407. encryptionConfig: EncryptionConfig;
  408. }
  409. export interface GetFindingsRequest {
  410. /**
  411. * The maximum number of results to return in the response. Use this parameter when paginating results. If additional results exist beyond the number you specify, the nextToken element is returned in the response. Use nextToken in a subsequent request to retrieve additional results.
  412. */
  413. maxResults?: GetFindingsRequestMaxResultsInteger;
  414. /**
  415. * A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request to continue listing results after the first page.
  416. */
  417. nextToken?: NextToken;
  418. /**
  419. * The name of the scan you want to retrieve findings from.
  420. */
  421. scanName: ScanName;
  422. /**
  423. * The status of the findings you want to get. Pass either Open, Closed, or All.
  424. */
  425. status?: Status;
  426. }
  427. export type GetFindingsRequestMaxResultsInteger = number;
  428. export interface GetFindingsResponse {
  429. /**
  430. * A list of findings generated by the specified scan.
  431. */
  432. findings?: Findings;
  433. /**
  434. * A pagination token. You can use this in future calls to GetFindings to continue listing results after the current page.
  435. */
  436. nextToken?: NextToken;
  437. }
  438. export interface GetMetricsSummaryRequest {
  439. /**
  440. * The date you want to retrieve summary metrics from, rounded to the nearest day. The date must be within the past two years since metrics data is only stored for two years. If a date outside of this range is passed, the response will be empty.
  441. */
  442. date: Timestamp;
  443. }
  444. export interface GetMetricsSummaryResponse {
  445. /**
  446. * The summary metrics from the specified date.
  447. */
  448. metricsSummary?: MetricsSummary;
  449. }
  450. export interface GetScanRequest {
  451. /**
  452. * UUID that identifies the individual scan run you want to view details about. You retrieve this when you call the CreateScan operation. Defaults to the latest scan run if missing.
  453. */
  454. runId?: Uuid;
  455. /**
  456. * The name of the scan you want to view details about.
  457. */
  458. scanName: ScanName;
  459. }
  460. export interface GetScanResponse {
  461. /**
  462. * The type of analysis CodeGuru Security performed in the scan, either Security or All. The Security type only generates findings related to security. The All type generates both security findings and quality findings.
  463. */
  464. analysisType: AnalysisType;
  465. /**
  466. * The time the scan was created.
  467. */
  468. createdAt: Timestamp;
  469. /**
  470. * The number of times a scan has been re-run on a revised resource.
  471. */
  472. numberOfRevisions?: Long;
  473. /**
  474. * UUID that identifies the individual scan run.
  475. */
  476. runId: Uuid;
  477. /**
  478. * The name of the scan.
  479. */
  480. scanName: ScanName;
  481. /**
  482. * The ARN for the scan name.
  483. */
  484. scanNameArn?: ScanNameArn;
  485. /**
  486. * The current state of the scan. Pass either InProgress, Successful, or Failed.
  487. */
  488. scanState: ScanState;
  489. /**
  490. * The time when the scan was last updated. Only available for STANDARD scan types.
  491. */
  492. updatedAt?: Timestamp;
  493. }
  494. export type HeaderKey = string;
  495. export type HeaderValue = string;
  496. export type Integer = number;
  497. export type KmsKeyArn = string;
  498. export interface ListFindingsMetricsRequest {
  499. /**
  500. * The end date of the interval which you want to retrieve metrics from.
  501. */
  502. endDate: Timestamp;
  503. /**
  504. * The maximum number of results to return in the response. Use this parameter when paginating results. If additional results exist beyond the number you specify, the nextToken element is returned in the response. Use nextToken in a subsequent request to retrieve additional results.
  505. */
  506. maxResults?: ListFindingsMetricsRequestMaxResultsInteger;
  507. /**
  508. * A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request to continue listing results after the first page.
  509. */
  510. nextToken?: NextToken;
  511. /**
  512. * The start date of the interval which you want to retrieve metrics from.
  513. */
  514. startDate: Timestamp;
  515. }
  516. export type ListFindingsMetricsRequestMaxResultsInteger = number;
  517. export interface ListFindingsMetricsResponse {
  518. /**
  519. * A list of AccountFindingsMetric objects retrieved from the specified time interval.
  520. */
  521. findingsMetrics?: FindingsMetricList;
  522. /**
  523. * A pagination token. You can use this in future calls to ListFindingMetrics to continue listing results after the current page.
  524. */
  525. nextToken?: NextToken;
  526. }
  527. export interface ListScansRequest {
  528. /**
  529. * The maximum number of results to return in the response. Use this parameter when paginating results. If additional results exist beyond the number you specify, the nextToken element is returned in the response. Use nextToken in a subsequent request to retrieve additional results.
  530. */
  531. maxResults?: ListScansRequestMaxResultsInteger;
  532. /**
  533. * A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request to continue listing results after the first page.
  534. */
  535. nextToken?: NextToken;
  536. }
  537. export type ListScansRequestMaxResultsInteger = number;
  538. export interface ListScansResponse {
  539. /**
  540. * A pagination token. You can use this in future calls to ListScans to continue listing results after the current page.
  541. */
  542. nextToken?: NextToken;
  543. /**
  544. * A list of ScanSummary objects with information about all scans in an account.
  545. */
  546. summaries?: ScanSummaries;
  547. }
  548. export interface ListTagsForResourceRequest {
  549. /**
  550. * The ARN of the ScanName object. You can retrieve this ARN by calling ListScans or GetScan.
  551. */
  552. resourceArn: ScanNameArn;
  553. }
  554. export interface ListTagsForResourceResponse {
  555. /**
  556. * An array of key-value pairs used to tag an existing scan. A tag is a custom attribute label with two parts: A tag key. For example, CostCenter, Environment, or Secret. Tag keys are case sensitive. An optional tag value field. For example, 111122223333, Production, or a team name. Omitting the tag value is the same as using an empty string. Tag values are case sensitive.
  557. */
  558. tags?: TagMap;
  559. }
  560. export type Long = number;
  561. export interface MetricsSummary {
  562. /**
  563. * A list of CategoryWithFindingNum objects for the top 5 finding categories with the most open findings in an account.
  564. */
  565. categoriesWithMostFindings?: CategoriesWithMostFindings;
  566. /**
  567. * The date from which the metrics summary information was retrieved.
  568. */
  569. date?: Timestamp;
  570. /**
  571. * The number of open findings of each severity in an account.
  572. */
  573. openFindings?: FindingMetricsValuePerSeverity;
  574. /**
  575. * A list of ScanNameWithFindingNum objects for the top 3 scans with the most number of open findings in an account.
  576. */
  577. scansWithMostOpenCriticalFindings?: ScansWithMostOpenCriticalFindings;
  578. /**
  579. * A list of ScanNameWithFindingNum objects for the top 3 scans with the most number of open critical findings in an account.
  580. */
  581. scansWithMostOpenFindings?: ScansWithMostOpenFindings;
  582. }
  583. export type NextToken = string;
  584. export interface Recommendation {
  585. /**
  586. * The recommended course of action to remediate the finding.
  587. */
  588. text?: String;
  589. /**
  590. * The URL address to the recommendation for remediating the finding.
  591. */
  592. url?: String;
  593. }
  594. export type ReferenceUrls = String[];
  595. export type RelatedVulnerabilities = String[];
  596. export interface Remediation {
  597. /**
  598. * An object that contains information about the recommended course of action to remediate a finding.
  599. */
  600. recommendation?: Recommendation;
  601. /**
  602. * A list of SuggestedFix objects. Each object contains information about a suggested code fix to remediate the finding.
  603. */
  604. suggestedFixes?: SuggestedFixes;
  605. }
  606. export type RequestHeaderMap = {[key: string]: HeaderValue};
  607. export interface Resource {
  608. /**
  609. * The identifier for the resource.
  610. */
  611. id?: String;
  612. /**
  613. * The identifier for a section of the resource, such as an AWS Lambda layer.
  614. */
  615. subResourceId?: String;
  616. }
  617. export interface ResourceId {
  618. /**
  619. * The identifier for the code file uploaded to the resource where a finding was detected.
  620. */
  621. codeArtifactId?: Uuid;
  622. }
  623. export type S3Url = string;
  624. export type ScanName = string;
  625. export type ScanNameArn = string;
  626. export interface ScanNameWithFindingNum {
  627. /**
  628. * The number of open findings generated by a scan.
  629. */
  630. findingNumber?: Integer;
  631. /**
  632. * The name of the scan.
  633. */
  634. scanName?: String;
  635. }
  636. export type ScanState = "InProgress"|"Successful"|"Failed"|string;
  637. export type ScanSummaries = ScanSummary[];
  638. export interface ScanSummary {
  639. /**
  640. * The time when the scan was created.
  641. */
  642. createdAt: Timestamp;
  643. /**
  644. * The identifier for the scan run.
  645. */
  646. runId: Uuid;
  647. /**
  648. * The name of the scan.
  649. */
  650. scanName: ScanName;
  651. /**
  652. * The ARN for the scan name.
  653. */
  654. scanNameArn?: ScanNameArn;
  655. /**
  656. * The state of the scan. A scan can be In Progress, Complete, or Failed.
  657. */
  658. scanState: ScanState;
  659. /**
  660. * The time the scan was last updated. A scan is updated when it is re-run.
  661. */
  662. updatedAt?: Timestamp;
  663. }
  664. export type ScanType = "Standard"|"Express"|string;
  665. export type ScansWithMostOpenCriticalFindings = ScanNameWithFindingNum[];
  666. export type ScansWithMostOpenFindings = ScanNameWithFindingNum[];
  667. export type Severity = "Critical"|"High"|"Medium"|"Low"|"Info"|string;
  668. export type Status = "Closed"|"Open"|"All"|string;
  669. export type String = string;
  670. export interface SuggestedFix {
  671. /**
  672. * The suggested code to add to your file.
  673. */
  674. code?: String;
  675. /**
  676. * A description of the suggested code fix and why it is being suggested.
  677. */
  678. description?: String;
  679. }
  680. export type SuggestedFixes = SuggestedFix[];
  681. export type TagKey = string;
  682. export type TagKeyList = TagKey[];
  683. export type TagMap = {[key: string]: TagValue};
  684. export interface TagResourceRequest {
  685. /**
  686. * The ARN of the ScanName object. You can retrieve this ARN by calling ListScans or GetScan.
  687. */
  688. resourceArn: ScanNameArn;
  689. /**
  690. * An array of key-value pairs used to tag an existing scan. A tag is a custom attribute label with two parts: A tag key. For example, CostCenter, Environment, or Secret. Tag keys are case sensitive. An optional tag value field. For example, 111122223333, Production, or a team name. Omitting the tag value is the same as using an empty string. Tag values are case sensitive.
  691. */
  692. tags: TagMap;
  693. }
  694. export interface TagResourceResponse {
  695. }
  696. export type TagValue = string;
  697. export type Timestamp = Date;
  698. export interface UntagResourceRequest {
  699. /**
  700. * The ARN of the ScanName object. You can retrieve this ARN by calling ListScans or GetScan.
  701. */
  702. resourceArn: ScanNameArn;
  703. /**
  704. * A list of keys for each tag you want to remove from a scan.
  705. */
  706. tagKeys: TagKeyList;
  707. }
  708. export interface UntagResourceResponse {
  709. }
  710. export interface UpdateAccountConfigurationRequest {
  711. /**
  712. * The KMS key ARN you want to use for encryption. Defaults to service-side encryption if missing.
  713. */
  714. encryptionConfig: EncryptionConfig;
  715. }
  716. export interface UpdateAccountConfigurationResponse {
  717. /**
  718. * An EncryptionConfig object that contains the KMS key ARN to use for encryption.
  719. */
  720. encryptionConfig: EncryptionConfig;
  721. }
  722. export type Uuid = string;
  723. export interface Vulnerability {
  724. /**
  725. * An object that describes the location of the detected security vulnerability in your code.
  726. */
  727. filePath?: FilePath;
  728. /**
  729. * The identifier for the vulnerability.
  730. */
  731. id?: String;
  732. /**
  733. * The number of times the vulnerability appears in your code.
  734. */
  735. itemCount?: Integer;
  736. /**
  737. * One or more URL addresses that contain details about a vulnerability.
  738. */
  739. referenceUrls?: ReferenceUrls;
  740. /**
  741. * One or more vulnerabilities that are related to the vulnerability being described.
  742. */
  743. relatedVulnerabilities?: RelatedVulnerabilities;
  744. }
  745. /**
  746. * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
  747. */
  748. export type apiVersion = "2018-05-10"|"latest"|string;
  749. export interface ClientApiVersions {
  750. /**
  751. * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
  752. */
  753. apiVersion?: apiVersion;
  754. }
  755. export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
  756. /**
  757. * Contains interfaces for use with the CodeGuruSecurity client.
  758. */
  759. export import Types = CodeGuruSecurity;
  760. }
  761. export = CodeGuruSecurity;