Static Analysis for AWS Best Practices in Python Code

05/09/2022
by   Rajdeep Mukherjee, et al.
0

Amazon Web Services (AWS) is a comprehensive and broadly adopted cloud provider, offering over 200 fully featured services, including compute, database, storage, networking and content delivery, machine learning, Internet of Things and many others. AWS SDKs provide access to AWS services through API endpoints. However, incorrect use of these APIs can lead to code defects, crashes, performance issues, and other problems. This paper presents automated static analysis rules, developed in the context of a commercial service for detection of code defects and security vulnerabilities, to identify deviations from AWS best practices in Python applications that use the AWS SDK. Such applications use the AWS SDK for Python, called "Boto3", to access AWS cloud services. However, precise static analysis of Python applications that use cloud SDKs requires robust type inference for inferring the types of cloud service clients. The dynamic style of Boto3 APIs poses unique challenges for type resolution, as does the interprocedural style in which service clients are used in practice. In support of our best-practices goal, we present a layered strategy for type inference that combines multiple type-resolution and tracking strategies in a staged manner. From our experiments across >3,000 popular Python GitHub repos that make use of the AWS SDK, our layered type inference system achieves 85 precision and 100 Additionally, we present a representative sample of eight AWS best-practice rules that detect a wide range of issues including pagination, polling, and batch operations. We have assessed the efficacy of these rules based on real-world developer feedback. Developers have accepted more than 85 recommendations made by five out of eight Python rules, and almost 83 recommendations.

READ FULL TEXT

page 8

page 9

page 13

page 21

page 22

page 23

page 27

page 32

research
07/18/2023

Generative Type Inference for Python

Python is a popular dynamic programming language, evidenced by its ranki...
research
09/23/2021

Security Review of Ethereum Beacon Clients

The beacon chain is the backbone of the Ethereum's evolution towards a p...
research
06/14/2022

Cloud Property Graph: Connecting Cloud Security Assessments with Static Code Analysis

In this paper, we present the Cloud Property Graph (CloudPG), which brid...
research
03/03/2023

Exploiting Input Sanitization for Regex Denial of Service

Web services use server-side input sanitization to guard against harmful...
research
12/08/2019

TypeWriter: Neural Type Prediction with Search-based Validation

Maintaining large code bases written in dynamically typed languages, suc...
research
08/04/2023

TIPICAL – Type Inference for Python In Critical Accuracy Level

Type inference methods based on deep learning are becoming increasingly ...
research
02/12/2020

Building Reliable Cloud Services Using P# (Experience Report)

Cloud services must typically be distributed across a large number of ma...

Please sign up or login with your details

Forgot password? Click here to reset