:doc:`CodeGuruSecurity <../../codeguru-security>` / Client / get_findings

************
get_findings
************



.. py:method:: CodeGuruSecurity.Client.get_findings(**kwargs)

  

  Returns a list of all findings generated by a particular scan.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/GetFindings>`_  


  **Request Syntax**
  ::

    response = client.get_findings(
        scanName='string',
        nextToken='string',
        maxResults=123,
        status='Closed'|'Open'|'All'
    )
    
  :type scanName: string
  :param scanName: **[REQUIRED]** 

    The name of the scan you want to retrieve findings from.

    

  
  :type nextToken: string
  :param nextToken: 

    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.

    

  
  :type maxResults: integer
  :param maxResults: 

    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. If not specified, returns 1000 results.

    

  
  :type status: string
  :param status: 

    The status of the findings you want to get. Pass either ``Open``, ``Closed``, or ``All``.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'findings': [
              {
                  'createdAt': datetime(2015, 1, 1),
                  'description': 'string',
                  'generatorId': 'string',
                  'id': 'string',
                  'updatedAt': datetime(2015, 1, 1),
                  'type': 'string',
                  'status': 'Closed'|'Open'|'All',
                  'resource': {
                      'id': 'string',
                      'subResourceId': 'string'
                  },
                  'vulnerability': {
                      'referenceUrls': [
                          'string',
                      ],
                      'relatedVulnerabilities': [
                          'string',
                      ],
                      'id': 'string',
                      'filePath': {
                          'name': 'string',
                          'path': 'string',
                          'startLine': 123,
                          'endLine': 123,
                          'codeSnippet': [
                              {
                                  'number': 123,
                                  'content': 'string'
                              },
                          ]
                      },
                      'itemCount': 123
                  },
                  'severity': 'Critical'|'High'|'Medium'|'Low'|'Info',
                  'remediation': {
                      'recommendation': {
                          'text': 'string',
                          'url': 'string'
                      },
                      'suggestedFixes': [
                          {
                              'description': 'string',
                              'code': 'string'
                          },
                      ]
                  },
                  'title': 'string',
                  'detectorTags': [
                      'string',
                  ],
                  'detectorId': 'string',
                  'detectorName': 'string',
                  'ruleId': 'string'
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **findings** *(list) --* 

        A list of findings generated by the specified scan.

        
        

        - *(dict) --* 

          Information about a finding that was detected in your code.

          
          

          - **createdAt** *(datetime) --* 

            The time when the finding was created.

            
          

          - **description** *(string) --* 

            A description of the finding.

            
          

          - **generatorId** *(string) --* 

            The identifier for the component that generated a finding such as AmazonCodeGuruSecurity.

            
          

          - **id** *(string) --* 

            The identifier for a finding.

            
          

          - **updatedAt** *(datetime) --* 

            The time when the finding was last updated. Findings are updated when you remediate them or when the finding code location changes.

            
          

          - **type** *(string) --* 

            The type of finding.

            
          

          - **status** *(string) --* 

            The status of the finding. A finding status can be open or closed.

            
          

          - **resource** *(dict) --* 

            The resource where Amazon CodeGuru Security detected a finding.

            
            

            - **id** *(string) --* 

              The ``scanName`` of the scan that was run on the resource.

              
            

            - **subResourceId** *(string) --* 

              The identifier for a section of the resource.

              
        
          

          - **vulnerability** *(dict) --* 

            An object that describes the detected security vulnerability.

            
            

            - **referenceUrls** *(list) --* 

              One or more URL addresses that contain details about a vulnerability.

              
              

              - *(string) --* 
          
            

            - **relatedVulnerabilities** *(list) --* 

              One or more vulnerabilities that are related to the vulnerability being described.

              
              

              - *(string) --* 
          
            

            - **id** *(string) --* 

              The identifier for the vulnerability.

              
            

            - **filePath** *(dict) --* 

              An object that describes the location of the detected security vulnerability in your code.

              
              

              - **name** *(string) --* 

                The name of the file.

                
              

              - **path** *(string) --* 

                The path to the resource with the security vulnerability.

                
              

              - **startLine** *(integer) --* 

                The first line number of the code snippet where the security vulnerability appears in your code.

                
              

              - **endLine** *(integer) --* 

                The last line number of the code snippet where the security vulnerability appears in your code.

                
              

              - **codeSnippet** *(list) --* 

                A list of ``CodeLine`` objects that describe where the security vulnerability appears in your code.

                
                

                - *(dict) --* 

                  The line of code where a finding was detected.

                  
                  

                  - **number** *(integer) --* 

                    The code line number.

                    
                  

                  - **content** *(string) --* 

                    The code that contains a vulnerability.

                    
              
            
          
            

            - **itemCount** *(integer) --* 

              The number of times the vulnerability appears in your code.

              
        
          

          - **severity** *(string) --* 

            The severity of the finding. Severity can be critical, high, medium, low, or informational. For information on severity levels, see `Finding severity <https://docs.aws.amazon.com/codeguru/latest/security-ug/findings-overview.html#severity-distribution>`__ in the *Amazon CodeGuru Security User Guide*.

            
          

          - **remediation** *(dict) --* 

            An object that contains the details about how to remediate a finding.

            
            

            - **recommendation** *(dict) --* 

              An object that contains information about the recommended course of action to remediate a finding.

              
              

              - **text** *(string) --* 

                The recommended course of action to remediate the finding.

                
              

              - **url** *(string) --* 

                The URL address to the recommendation for remediating the finding.

                
          
            

            - **suggestedFixes** *(list) --* 

              A list of ``SuggestedFix`` objects. Each object contains information about a suggested code fix to remediate the finding.

              
              

              - *(dict) --* 

                Information about the suggested code fix to remediate a finding.

                
                

                - **description** *(string) --* 

                  A description of the suggested code fix and why it is being suggested.

                  
                

                - **code** *(string) --* 

                  The suggested code fix. If applicable, includes code patch to replace your source code.

                  
            
          
        
          

          - **title** *(string) --* 

            The title of the finding.

            
          

          - **detectorTags** *(list) --* 

            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.

            
            

            - *(string) --* 
        
          

          - **detectorId** *(string) --* 

            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.

            
          

          - **detectorName** *(string) --* 

            The name of the detector that identified the security vulnerability in your code.

            
          

          - **ruleId** *(string) --* 

            The identifier for the rule that generated the finding.

            
      
    
      

      - **nextToken** *(string) --* 

        A pagination token. You can use this in future calls to ``GetFindings`` to continue listing results after the current page.

        
  
  **Exceptions**
  
  *   :py:class:`CodeGuruSecurity.Client.exceptions.InternalServerException`

  
  *   :py:class:`CodeGuruSecurity.Client.exceptions.ConflictException`

  
  *   :py:class:`CodeGuruSecurity.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CodeGuruSecurity.Client.exceptions.ThrottlingException`

  
  *   :py:class:`CodeGuruSecurity.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`CodeGuruSecurity.Client.exceptions.ValidationException`

  