Skip to main content

More Info:

Checks if an AWS AppSync API has logging enabled. The rule is NON_COMPLIANT if logging is not enabled, or fieldLogLevel is neither ERROR nor ALL.

Risk Level

Medium

Address

Monitoring

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • GDPR
  • HIPAA
  • ISO 27001
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
  • StateRAMP
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Check Cause

Using Console

  1. Sign in to the AWS Management Console.
  2. Navigate to the AWS AppSync service by typing ‘AppSync’ in the search bar and selecting it from the dropdown menu.
  3. In the AppSync dashboard, you will see a list of all your APIs. Select the API you want to check.
  4. In the settings of the selected API, look for the ‘Logging’ section. If logging is enabled, you will see the details of the logging configuration, such as the log level and the CloudWatch Logs role ARN. If this section is not present or it says that logging is disabled, then the AppSync API does not have logging enabled.
  1. First, you need to install and configure AWS CLI on your local machine. You can do this by following the instructions provided by AWS. Make sure you have the necessary permissions to access the AppSync APIs.
  2. Once the AWS CLI is set up, you can list all the AppSync APIs using the following command:
    Replace ‘your-region’ with the region where your APIs are located. This command will return a list of all the AppSync APIs in the specified region.
  3. To check the logging configuration of each API, you need to describe the API using the following command:
    Replace ‘your-api-id’ with the ID of the API you want to check and ‘your-region’ with the region where your API is located. This command will return the details of the specified API.
  4. In the output of the above command, look for the ‘logConfig’ field. If the ‘logConfig’ field is present and the ‘cloudWatchLogsRoleArn’ and ‘fieldLogLevel’ are set, then logging is enabled for the API. If the ‘logConfig’ field is not present or the ‘cloudWatchLogsRoleArn’ and ‘fieldLogLevel’ are not set, then logging is not enabled for the API.
  1. Install and configure AWS SDK for Python (Boto3): Before you can begin writing Python scripts to detect misconfigurations, you need to install and configure Boto3. You can install it using pip:
    Then, configure your AWS credentials to enable Boto3 to communicate with AWS services:
    You’ll be prompted to provide your AWS Access Key ID and Secret Access Key, which you can find in your AWS Management Console.
  2. Import necessary libraries and establish a client connection: In your Python script, you’ll need to import Boto3 and establish a client connection to AWS AppSync. Here’s how you can do it:
  3. List all AppSync APIs and check their logging status: You can use the list_graphql_apis method to get a list of all AppSync APIs, and then check the logConfig field of each API to see if logging is enabled. Here’s a sample script:
  4. Handle pagination: The list_graphql_apis method returns a maximum of 25 APIs at a time. If you have more than 25 APIs, you’ll need to handle pagination by using the nextToken field in the response:
    This script will print out the names of all APIs and whether logging is enabled for each one.

Additional Reading: