This document outlines security best practices and policies for using the n8n-nodes-appwrite-full package.
| Version | Supported |
|---|---|
| 0.10.x | ✅ |
| < 0.10 | ❌ |
If you discover a security vulnerability in this project, please report it by:
- DO NOT open a public GitHub issue
- Email the maintainer at: timiliris@example.com
- Include a detailed description of the vulnerability
- Provide steps to reproduce (if applicable)
- Suggest a fix (if you have one)
We aim to respond to security reports within 48 hours.
- Store API keys securely in n8n credentials manager
- Use API keys with minimum required scopes
- Rotate API keys regularly (recommended: every 90 days)
- Create separate API keys for different environments (dev, staging, production)
- Revoke API keys immediately when:
- Team members leave
- Keys are suspected to be compromised
- Projects are decommissioned
- Hard-code API keys in workflows
- Share API keys via email, chat, or version control
- Use production API keys in development environments
- Grant more permissions than necessary
- Reuse API keys across multiple projects
Configure API keys with minimum required scopes:
| Operation Type | Required Scopes |
|---|---|
| Databases | databases.read, databases.write |
| Collections | collections.read, collections.write |
| Documents | documents.read, documents.write |
| Storage | files.read, files.write, buckets.read, buckets.write |
| Sites | sites.read, sites.write |
| Teams | teams.read, teams.write |
| Users | users.read, users.write |
Important: Only grant the scopes your workflows actually need.
This package includes built-in validation for:
- ID validation: Alphanumeric, underscore, hyphen only (max 36 chars)
- JSON parsing: Safe parsing with size limits (max 1MB)
- Email validation: RFC-compliant email format
- Name validation: Maximum 128 characters
For sensitive data, add additional validation in your workflows:
// Example: Validate user input before creating document
if (!email.includes('@')) {
throw new Error('Invalid email format');
}
if (password.length < 12) {
throw new Error('Password must be at least 12 characters');
}When creating documents or files, always specify explicit permissions:
{
"permissions": [
"read(\"user:USER_ID\")",
"write(\"user:USER_ID\")"
]
}// DON'T: Allows anyone to read/write
{
"permissions": [
"read(\"any\")",
"write(\"any\")"
]
}// DO: Restrict to specific roles
{
"permissions": [
"read(\"role:members\")",
"write(\"role:admins\")"
]
}When working with file uploads:
- Validate file types: Use bucket
allowedFileExtensions - Limit file size: Set
maximumFileSizeon buckets - Enable antivirus: Set
antivirus: trueon buckets (Appwrite Cloud) - Enable encryption: Set
encryption: truefor sensitive files
Example secure bucket configuration:
{
"bucketId": "secure-files",
"name": "Secure Files",
"permissions": ["read(\"role:members\")"],
"fileSecurity": true,
"enabled": true,
"options": {
"maximumFileSize": 5242880, // 5MB
"allowedFileExtensions": ["pdf", "jpg", "png"],
"encryption": true,
"antivirus": true
}
}When creating users:
- Never log passwords: Ensure workflows don't log sensitive data
- Use strong passwords: Enforce minimum 12 characters with complexity
- Don't send passwords in plain text: Use secure password reset flows
- Hash on server: Appwrite handles hashing - never pre-hash passwords
Use different Appwrite projects for different environments:
| Environment | Configuration |
|---|---|
| Development | Test project with limited data |
| Staging | Separate project mirroring production |
| Production | Production project with strict security |
Configure credentials separately for each environment in n8n.
Be aware of Appwrite rate limits:
- Appwrite Cloud: Varies by plan
- Self-hosted: Configurable
Implement retry logic with exponential backoff:
// Example: Retry with backoff
let retries = 3;
while (retries > 0) {
try {
await createDocument(...);
break;
} catch (error) {
if (error.code === 429) { // Rate limit
await sleep(Math.pow(2, 3 - retries) * 1000);
retries--;
} else {
throw error;
}
}
}Enable audit logging in Appwrite to track:
- Document creations/modifications/deletions
- User management actions
- Permission changes
- File uploads/downloads
Review logs regularly for suspicious activity.
- Use HTTPS only (enforce TLS 1.2+)
- Configure firewall rules
- Use VPN for administrative access
- Implement IP whitelisting for API access
- Enable CORS appropriately
- Verify endpoint is
https://cloud.appwrite.io/v1 - Never connect over HTTP
- Use webhook signatures for webhooks
This package validates inputs, but always sanitize data in workflows:
// Example: Sanitize HTML content
const sanitized = htmlContent
.replace(/<script[^>]*>.*?<\/script>/gi, '')
.replace(/<iframe[^>]*>.*?<\/iframe>/gi, '');The package provides structured error handling. In workflows:
- Don't expose sensitive errors to users: Log detailed errors internally
- Use generic messages: "An error occurred" instead of exposing stack traces
- Enable
continueOnFail: For non-critical operations
This package is scanned for vulnerabilities. To check:
npm auditUpdate dependencies regularly:
npm update n8n-nodes-appwrite-full| Vulnerability | Mitigation |
|---|---|
| Injection | Use validated, parameterized inputs |
| Broken Auth | Use Appwrite's built-in auth, validate sessions |
| Sensitive Data Exposure | Encrypt at rest, use HTTPS, limit permissions |
| XXE | Avoid parsing untrusted XML |
| Broken Access Control | Use role-based permissions, validate IDs |
| Security Misconfiguration | Follow this guide, review settings |
| XSS | Sanitize outputs, use Content Security Policy |
| Insecure Deserialization | Validate JSON before parsing (done automatically) |
| Insufficient Logging | Enable audit logs, monitor errors |
| SSRF | Validate URLs, use allowlists |
The package enforces the following limits:
- JSON payload: 1 MB maximum
- ID length: 36 characters maximum
- Name length: 128 characters maximum
These limits prevent:
- Memory exhaustion attacks
- Buffer overflow attempts
- Denial of service via large payloads
When using this package for applications subject to:
- GDPR: Ensure proper consent, implement data deletion, use encryption
- HIPAA: Use encryption, audit logs, access controls, BAA with Appwrite
- PCI-DSS: Never store credit card data in Appwrite, use compliant payment processor
- SOC 2: Enable logging, implement access controls, regular security reviews
Before deploying workflows to production:
- API keys use minimum required scopes
- Credentials stored securely in n8n
- Permissions configured with least privilege
- File upload validation enabled
- Error handling doesn't expose sensitive info
- Audit logging enabled in Appwrite
- HTTPS enforced for all connections
- Rate limiting considered
- Input validation implemented
- Dependencies up to date
- Security policies documented for team
This security policy is reviewed quarterly and updated as needed.
Last Updated: 2024-11-14 Version: 1.0.0