# ShipAppReady readiness report: GreenEdge Lawn Quotes

Report: https://ship-app-ready.labs.adanatech.com/reports/sample-lawn  
Source: Sample app (fictional)  
Readiness score: **35/100** (Not safe to launch yet)

> The score, the findings and the cost estimate are computed by fixed rules. Text marked [AI-generated] was written by an AI model from the scan results; [Built-in rules] marks the scanner's own text. Reports expire after 24 hours.

## Scorecard

GreenEdge Lawn Quotes appears to help customers of a fictional landscaping company estimate lawn-care prices from yard size and selected extras. It saves quote details in a local database and includes an administrator page listing recent quotes. The code also includes a function for copying that database to Amazon S3. _[AI-generated]_

- Stack: Python / Flask
- Entry point: app.py (port 5000)
- Size: 12 files, about 144 lines of code
- Findings: 1 critical, 3 high, 2 low, 1 info

## Findings

### Critical (1)

**SEC-01. AWS access key ID written into the code, in config.py**  
Area: Secrets · Location: `config.py:6`  
Evidence: AWS access key ID: AKIA…MPLE (20 characters)  
Why it matters: config.py contains an AWS access key ID, which can be copied along with the source code and remain in older copies. The code does not establish whether it is active; paired with its matching secret key, an active key could allow access to AWS resources.  
Fix: Check the key in AWS and revoke it if active, replacing it wherever needed. Remove the hardcoded ID and update the S3 client to use an AWS task role; if access keys are still needed outside AWS, read them from environment variables and keep deployed secrets in AWS Secrets Manager. _[AI-generated]_

### High (3)

**DATA-01. Data is saved in a SQLite database file inside the app**  
Area: Data storage · Location: `app.py:18`  
Evidence: conn = sqlite3.connect(DB_PATH) (also files: quotes.db)  
Why it matters: Quotes are stored in quotes.db inside the app directory, so changes could disappear when a container is replaced and separate copies of the app would not share the same data. A backup function exists, but the excerpts do not show that it is scheduled or that backups succeed.  
Fix: Move quote storage to a managed database such as Amazon RDS for PostgreSQL, and migrate any existing records before switching over. Enable backups and test restoring them. _[AI-generated]_

**AUTH-01. The /admin/quotes page or action has no sign-in check**  
Area: Sign-in and access · Location: `app.py:63`  
Evidence: GET /admin/quotes with no sign-in decorator or middleware  
Why it matters: The /admin/quotes route has no sign-in check in the code. Anyone who can reach that address could view the recent quote records, including ZIP codes and quote details.  
Fix: Require sign-in and verify administrator permissions before returning this page. Test that both anonymous visitors and signed-in non-administrators are refused. _[AI-generated]_

**CFG-01. Debug mode is switched on**  
Area: Configuration · Location: `app.py:71`  
Evidence: app.run(debug=True)  
Why it matters: Starting app.py directly enables Flask debug mode, which can expose internal error details and potentially an interactive command console. The excerpts do not establish how the deployed app is started.  
Fix: Remove debug=True and keep debug mode off in production. Use the Dockerfile's Gunicorn command, a server intended for production, rather than starting the Flask development server. _[AI-generated]_

### Low (2)

**DEP-01. Some dependencies have no fixed version (requirements.txt)**  
Area: Dependencies · Location: `requirements.txt`  
Evidence: 1 without an exact version: boto3  
Why it matters: The boto3 requirement allows multiple versions, so a later build could install different software from the version you tested.  
Fix: Record the exact tested boto3 version in requirements.txt using ==, or use a committed dependency lock file. Update dependencies deliberately and test each update. _[AI-generated]_

**OPS-02. No health check address**  
Area: Deployability · Location: `app.py`  
Evidence: No /health route found  
Why it matters: There is no dedicated /health address for AWS to check whether the app is responding. A simple, predictable response helps AWS route traffic only to healthy copies.  
Fix: Add the supplied route after app is created and before the app.run block. Configure the AWS health check to request /health on port 8080 and expect HTTP 200. _[AI-generated]_

### Info (1)

**OPS-01. No Dockerfile yet (a draft is on the Fixes tab)**  
Area: Deployability  
Evidence: No Dockerfile in the project  
Why it matters: The project has no Dockerfile to describe a repeatable container build and startup command for AWS.  
Fix: Add the supplied Dockerfile and .dockerignore, then build and test the image for linux/amd64. Complete the database and configuration changes before treating that image as launch-ready. _[AI-generated]_

## Fixes: packaging files

### Dockerfile _[AI-generated]_

Packages the app as one container: an official slim base image with security updates applied, an unprivileged user, and the app listening on 0.0.0.0.

```
FROM --platform=linux/amd64 public.ecr.aws/docker/library/python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt gunicorn==23.0.0

RUN useradd --uid 10001 --no-create-home app && chown app:app /app
COPY --chown=app:app . .
USER app

EXPOSE 8080
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "2", "app:app"]
```

### .env.example _[AI-generated]_

Lists every setting the app reads, marked secret or setting, required or optional. Secrets go in AWS Secrets Manager, never in the code.

```
# The current code reads these three variables.
# AWS_SECRET_ACCESS_KEY is required to use the current backup function.
# Copying this file does not load it automatically; supply values through your runtime.

# setting, optional
AWS_REGION=us-east-1
# secret, required
AWS_SECRET_ACCESS_KEY=
# setting, optional
BACKUP_BUCKET=greenedge-quote-backups

# Before AWS launch, remove the hardcoded access key and explicit credentials
# from the S3 client, and grant S3 access through the container's AWS task role.
# With that code change, AWS_SECRET_ACCESS_KEY is no longer needed on AWS.
```

### .dockerignore _[AI-generated]_

Keeps secrets, Git history and generated folders out of the container image.

```
.env
.env.*
!.env.example
.git
.gitignore
node_modules/
__pycache__/
*.py[cod]
.venv/
venv/
.pytest_cache/
*.log
logs/
.DS_Store
*.db
*.sqlite
*.sqlite3
```

### health route (Flask) _[AI-generated]_

A /health address that answers 200, so the load balancer can tell the app is alive.

```
# Add after app = Flask(__name__), before the app.run block.
@app.get("/health")
def health():
    return {"status": "ok"}, 200
```

## Cost estimate

About **$38.80 to $44.80 per month** on AWS ECS Express Mode in your own account.

| Item | Monthly | Detail |
|---|---|---|
| Container (ECS Express Mode) | $22 | One copy always on, 512 CPU units / 1024 MB memory, with its public IP |
| Load balancer with HTTPS | $16–$22 | One per AWS account, shared by every app in it |
| Secrets Manager (2 secrets) | $0.80 | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY |

Assumptions:

- One always-on copy on AWS ECS Express Mode in your own AWS account, sized for a typical web app.
- Light to moderate traffic; data transfer, logs and backups add a few dollars at most at this scale.
- If your account already runs other apps behind the same load balancer, that line is shared.
- Your domain name and DNS are not included.
- Outside API usage (for example an AI or email service the app calls) is billed separately by that provider.
- Approximate US East prices; AWS prices change, and this is an estimate, not a quote.

## Launch plan

- Deploy one container (512 CPU units, 1024 MB) in your AWS account, behind HTTPS.
- Health check: /health.
- Secrets: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, in AWS Secrets Manager.

Before launch _[AI-generated]_:

- Choose the public domain, configure its DNS records, and enable HTTPS in AWS.
- Check and revoke the AWS key written in config.py if active. Choose an AWS task role for S3 access; if keys must remain, store their secret values in AWS Secrets Manager.
- Move any existing quotes.db records to the chosen managed database before launch; the supplied container build deliberately excludes local database files.
- Choose who may administer quotes, then add and test sign-in and administrator-only access.
- Confirm the S3 bucket and backup schedule if retaining database-file backups, and test recovery of your chosen database.
- Build and test the linux/amd64 container, pin the tested boto3 version, and configure AWS to check /health on port 8080.

---
Generated by ShipAppReady, a pilot from AdanaTech Labs (https://labs.adanatech.com).
