github-mirror 0.0.10

GitHub's v3 REST API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# The MIT License (MIT)
#
# Copyright (c) 2024 Aliaksei Bialiauski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
get:
  summary: List global security advisories
  description: |-
    Lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.

    By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)."
  tags:
    - security-advisories
  operationId: security-advisories/list-global-advisories
  externalDocs:
    description: API method documentation
    url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories
  parameters:
    - name: ghsa_id
      in: query
      description: If specified, only advisories with this GHSA (GitHub Security
        Advisory) identifier will be returned.
      schema:
        type: string
    - name: type
      in: query
      description: If specified, only advisories of this type will be returned.
        By default, a request with no other parameters defined will only return
        reviewed advisories that are not malware.
      schema:
        type: string
        enum:
          - reviewed
          - malware
          - unreviewed
        default: reviewed
    - name: cve_id
      description: If specified, only advisories with this CVE (Common Vulnerabilities
        and Exposures) identifier will be returned.
      in: query
      schema:
        type: string
    - name: ecosystem
      in: query
      description: If specified, only advisories for these ecosystems will be returned.
      schema: &1
        type: string
        description: The package's language or package management ecosystem.
        enum:
          - rubygems
          - npm
          - pip
          - maven
          - nuget
          - composer
          - go
          - rust
          - erlang
          - actions
          - pub
          - other
          - swift
    - name: severity
      in: query
      description: If specified, only advisories with these severities will be returned.
      schema:
        type: string
        enum:
          - unknown
          - low
          - medium
          - high
          - critical
    - name: cwes
      in: query
      description: |-
        If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned.

        Example: `cwes=79,284,22` or `cwes[]=79&cwes[]=284&cwes[]=22`
      schema:
        oneOf:
          - type: string
          - type: array
            items:
              type: string
    - name: is_withdrawn
      in: query
      description: Whether to only return advisories that have been withdrawn.
      schema:
        type: boolean
    - name: affects
      in: query
      description: |-
        If specified, only return advisories that affect any of `package` or `package@version`. A maximum of 1000 packages can be specified.
        If the query parameter causes the URL to exceed the maximum URL length supported by your client, you must specify fewer packages.

        Example: `affects=package1,package2@1.0.0,package3@^2.0.0` or `affects[]=package1&affects[]=package2@1.0.0`
      schema:
        oneOf:
          - type: string
          - type: array
            maxItems: 1000
            items:
              type: string
    - name: published
      in: query
      description: |-
        If specified, only return advisories that were published on a date or date range.

        For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)."
      schema:
        type: string
    - name: updated
      in: query
      description: |-
        If specified, only return advisories that were updated on a date or date range.

        For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)."
      schema:
        type: string
    - name: modified
      description: |-
        If specified, only show advisories that were updated or published on a date or date range.

        For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)."
      in: query
      schema:
        type: string
    - &39
      name: before
      description: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers).
        If specified, the query only searches for results before this cursor. For
        more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      required: false
      schema:
        type: string
    - &40
      name: after
      description: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers).
        If specified, the query only searches for results after this cursor. For
        more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      required: false
      schema:
        type: string
    - &38
      name: direction
      description: The direction to sort the results by.
      in: query
      required: false
      schema:
        type: string
        enum:
          - asc
          - desc
        default: desc
    - name: per_page
      description: The number of results per page (max 100). For more information,
        see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 30
    - name: sort
      description: The property to sort the results by.
      in: query
      required: false
      schema:
        type: string
        enum:
          - updated
          - published
        default: published
  responses:
    '200':
      description: Response
      content:
        application/json:
          schema:
            items: &2
              description: A GitHub Security Advisory.
              properties:
                ghsa_id:
                  type: string
                  description: The GitHub Security Advisory ID.
                  readOnly: true
                cve_id:
                  type:
                    - string
                    - 'null'
                  description: The Common Vulnerabilities and Exposures (CVE)
                    ID.
                  readOnly: true
                url:
                  type: string
                  description: The API URL for the advisory.
                  readOnly: true
                html_url:
                  type: string
                  format: uri
                  description: The URL for the advisory.
                  readOnly: true
                repository_advisory_url:
                  type:
                    - string
                    - 'null'
                  format: uri
                  description: The API URL for the repository advisory.
                  readOnly: true
                summary:
                  type: string
                  description: A short summary of the advisory.
                  maxLength: 1024
                description:
                  type:
                    - string
                    - 'null'
                  description: A detailed description of what the advisory entails.
                  maxLength: 65535
                type:
                  type: string
                  description: The type of advisory.
                  readOnly: true
                  enum:
                    - reviewed
                    - unreviewed
                    - malware
                severity:
                  type: string
                  description: The severity of the advisory.
                  enum:
                    - critical
                    - high
                    - medium
                    - low
                    - unknown
                source_code_location:
                  type:
                    - string
                    - 'null'
                  format: uri
                  description: The URL of the advisory's source code.
                identifiers:
                  type:
                    - array
                    - 'null'
                  readOnly: true
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: The type of identifier.
                        enum:
                          - CVE
                          - GHSA
                      value:
                        type: string
                        description: The identifier value.
                    required:
                      - type
                      - value
                references:
                  type:
                    - array
                    - 'null'
                  items:
                    type: string
                    description: URLs with more information regarding the advisory.
                published_at:
                  type: string
                  format: date-time
                  description: The date and time of when the advisory was published,
                    in ISO 8601 format.
                  readOnly: true
                updated_at:
                  type: string
                  format: date-time
                  description: The date and time of when the advisory was last
                    updated, in ISO 8601 format.
                  readOnly: true
                github_reviewed_at:
                  type:
                    - string
                    - 'null'
                  format: date-time
                  description: The date and time of when the advisory was reviewed
                    by GitHub, in ISO 8601 format.
                  readOnly: true
                nvd_published_at:
                  type:
                    - string
                    - 'null'
                  format: date-time
                  description: |-
                    The date and time when the advisory was published in the National Vulnerability Database, in ISO 8601 format.
                    This field is only populated when the advisory is imported from the National Vulnerability Database.
                  readOnly: true
                withdrawn_at:
                  type:
                    - string
                    - 'null'
                  format: date-time
                  description: The date and time of when the advisory was withdrawn,
                    in ISO 8601 format.
                  readOnly: true
                vulnerabilities:
                  type:
                    - array
                    - 'null'
                  description: The products and respective version ranges affected
                    by the advisory.
                  items:
                    description: A vulnerability describing the product and its
                      affected versions within a GitHub Security Advisory.
                    type: object
                    properties:
                      package:
                        description: The name of the package affected by the vulnerability.
                        type:
                          - object
                          - 'null'
                        properties:
                          ecosystem: *1
                          name:
                            type:
                              - string
                              - 'null'
                            description: The unique package name within its ecosystem.
                        required:
                          - ecosystem
                          - name
                      vulnerable_version_range:
                        type:
                          - string
                          - 'null'
                        description: The range of the package versions affected
                          by the vulnerability.
                      first_patched_version:
                        type:
                          - string
                          - 'null'
                        description: The package version that resolves the vulnerability.
                      vulnerable_functions:
                        type:
                          - array
                          - 'null'
                        description: The functions in the package that are affected
                          by the vulnerability.
                        readOnly: true
                        items:
                          type: string
                    required:
                      - package
                      - vulnerable_version_range
                      - first_patched_version
                      - vulnerable_functions
                cvss:
                  type:
                    - object
                    - 'null'
                  properties:
                    vector_string:
                      type:
                        - string
                        - 'null'
                      description: The CVSS vector.
                    score:
                      type:
                        - number
                        - 'null'
                      description: The CVSS score.
                      minimum: 0
                      maximum: 10
                      readOnly: true
                  required:
                    - vector_string
                    - score
                cwes:
                  type:
                    - array
                    - 'null'
                  items:
                    type: object
                    properties:
                      cwe_id:
                        type: string
                        description: The Common Weakness Enumeration (CWE) identifier.
                      name:
                        type: string
                        description: The name of the CWE.
                        readOnly: true
                    required:
                      - cwe_id
                      - name
                credits:
                  type:
                    - array
                    - 'null'
                  description: The users who contributed to the advisory.
                  readOnly: true
                  items:
                    type: object
                    properties:
                      user: &4
                        title: Simple User
                        description: A GitHub user.
                        type: object
                        properties:
                          name:
                            type:
                              - string
                              - 'null'
                          email:
                            type:
                              - string
                              - 'null'
                          login:
                            type: string
                            examples:
                              - octocat
                          id:
                            type: integer
                            examples:
                              - 1
                          node_id:
                            type: string
                            examples:
                              - MDQ6VXNlcjE=
                          avatar_url:
                            type: string
                            format: uri
                            examples:
                              - https://github.com/images/error/octocat_happy.gif
                          gravatar_id:
                            type:
                              - string
                              - 'null'
                            examples:
                              - 41d064eb2195891e12d0413f63227ea7
                          url:
                            type: string
                            format: uri
                            examples:
                              - https://api.github.com/users/octocat
                          html_url:
                            type: string
                            format: uri
                            examples:
                              - https://github.com/octocat
                          followers_url:
                            type: string
                            format: uri
                            examples:
                              - https://api.github.com/users/octocat/followers
                          following_url:
                            type: string
                            examples:
                              - https://api.github.com/users/octocat/following{/other_user}
                          gists_url:
                            type: string
                            examples:
                              - https://api.github.com/users/octocat/gists{/gist_id}
                          starred_url:
                            type: string
                            examples:
                              - https://api.github.com/users/octocat/starred{/owner}{/repo}
                          subscriptions_url:
                            type: string
                            format: uri
                            examples:
                              - https://api.github.com/users/octocat/subscriptions
                          organizations_url:
                            type: string
                            format: uri
                            examples:
                              - https://api.github.com/users/octocat/orgs
                          repos_url:
                            type: string
                            format: uri
                            examples:
                              - https://api.github.com/users/octocat/repos
                          events_url:
                            type: string
                            examples:
                              - https://api.github.com/users/octocat/events{/privacy}
                          received_events_url:
                            type: string
                            format: uri
                            examples:
                              - https://api.github.com/users/octocat/received_events
                          type:
                            type: string
                            examples:
                              - User
                          site_admin:
                            type: boolean
                          starred_at:
                            type: string
                            examples:
                              - '"2020-07-09T00:17:55Z"'
                        required:
                          - avatar_url
                          - events_url
                          - followers_url
                          - following_url
                          - gists_url
                          - gravatar_id
                          - html_url
                          - id
                          - node_id
                          - login
                          - organizations_url
                          - received_events_url
                          - repos_url
                          - site_admin
                          - starred_url
                          - subscriptions_url
                          - type
                          - url
                      type: &198
                        type: string
                        description: The type of credit the user is receiving.
                        enum:
                          - analyst
                          - finder
                          - reporter
                          - coordinator
                          - remediation_developer
                          - remediation_reviewer
                          - remediation_verifier
                          - tool
                          - sponsor
                          - other
                    required:
                      - user
                      - type
              required:
                - ghsa_id
                - cve_id
                - url
                - html_url
                - repository_advisory_url
                - summary
                - description
                - type
                - severity
                - source_code_location
                - identifiers
                - references
                - published_at
                - updated_at
                - github_reviewed_at
                - nvd_published_at
                - withdrawn_at
                - vulnerabilities
                - cvss
                - cwes
                - credits
              additionalProperties: false
          examples:
            default:
              value:
                - id: 1
                  ghsa_id: GHSA-abcd-1234-efgh
                  cve_id: CVE-2050-00000
                  url: https://api.github.com/advisories/GHSA-abcd-1234-efgh
                  html_url: https://github.com/advisories/GHSA-abcd-1234-efgh
                  repository_advisory_url: https://api.github.com/repos/project/a-package/security-advisories/GHSA-abcd-1234-efgh
                  summary: Heartbleed security advisory
                  description: This bug allows an attacker to read portions of the
                    affected server’s memory, potentially disclosing sensitive information.
                  type: reviewed
                  severity: high
                  source_code_location: https://github.com/project/a-package
                  identifiers:
                    - type: GHSA
                      value: GHSA-abcd-1234-efgh
                    - type: CVE
                      value: CVE-2050-00000
                  references:
                    - https://nvd.nist.gov/vuln/detail/CVE-2050-00000
                  published_at: '2023-03-23T02:30:56Z'
                  updated_at: '2023-03-24T02:30:56Z'
                  github_reviewed_at: '2023-03-23T02:30:56Z'
                  nvd_published_at: '2023-03-25T02:30:56Z'
                  withdrawn_at:
                  vulnerabilities:
                    - package:
                        ecosystem: npm
                        name: a-package
                      first_patched_version: 1.0.3
                      vulnerable_version_range: "<=1.0.2"
                      vulnerable_functions:
                        - a_function
                  cvss:
                    vector_string: CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H
                    score: 7.6
                  cwes:
                    - cwe_id: CWE-400
                      name: Uncontrolled Resource Consumption
                  credits:
                    - user:
                        login: octocat
                        id: 1
                        node_id: MDQ6VXNlcjE=
                        avatar_url: https://github.com/images/error/octocat_happy.gif
                        gravatar_id: ''
                        url: https://api.github.com/users/octocat
                        html_url: https://github.com/octocat
                        followers_url: https://api.github.com/users/octocat/followers
                        following_url: https://api.github.com/users/octocat/following{/other_user}
                        gists_url: https://api.github.com/users/octocat/gists{/gist_id}
                        starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}
                        subscriptions_url: https://api.github.com/users/octocat/subscriptions
                        organizations_url: https://api.github.com/users/octocat/orgs
                        repos_url: https://api.github.com/users/octocat/repos
                        events_url: https://api.github.com/users/octocat/events{/privacy}
                        received_events_url: https://api.github.com/users/octocat/received_events
                        type: User
                        site_admin: false
                      type: analyst
    '429':
      description: Too many requests
      content:
        application/json:
          schema: &3
            title: Basic Error
            description: Basic Error
            properties:
              message:
                type: string
              documentation_url:
                type: string
              url:
                type: string
              status:
                type: string
    '422': &7
      description: Validation failed, or the endpoint has been spammed.
      content:
        application/json:
          schema: &86
            title: Validation Error Simple
            description: Validation Error Simple
            required:
              - message
              - documentation_url
            properties:
              message:
                type: string
              documentation_url:
                type: string
              errors:
                type: array
                items:
                  type: string
  x-github:
    githubCloudOnly: false
    enabledForGitHubApps: true
    category: security-advisories
    subcategory: global-advisories