Security Best Practices
NexStorage has been designed with security as a fundamental principle. This guide outlines best practices to ensure your data remains secure, compliant, and protected against unauthorized access or data breaches.
Securing Data in Transit
Enforcing HTTPS
Always use encrypted connections to protect data in transit:
# Configure the NexStorage console to redirect HTTP to HTTPS
nexstorage-admin config set console.secure true
# Disable HTTP access completely
nexstorage-admin config set api.http.enabled false
For production environments, completely disable HTTP access and use only HTTPS with a valid TLS certificate.
TLS Configuration
NexStorage supports modern TLS implementations:
- Use TLS 1.3 whenever possible (default in NexStorage)
- Configure minimum TLS version to 1.2 for legacy clients:
nexstorage-admin config set ssl.minimum_version "TLSv1.2" - Configure strong cipher suites:
nexstorage-admin config set ssl.ciphers "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256"
Custom Certificates
Replace the default self-signed certificate with your own trusted certificates:
# Install custom certificates
nexstorage-admin certificates install \
--cert-file /path/to/your/certificate.crt \
--key-file /path/to/your/private.key
For certificate management through services like Let's Encrypt:
nexstorage-admin certificates install-acme \
--domain storage.yourcompany.com \
--email admin@yourcompany.com
Bucket Security Configuration
Private vs Public Buckets
By default, all NexStorage buckets are private. For content that needs to be publicly accessible:
# Make specific objects public
nexstorage-client object set-acl \
--bucket my-public-content \
--object images/logo.png \
--acl public-read
# Configure bucket policy for public read access to a specific directory
nexstorage-client bucket policy set \
--bucket my-public-content \
--policy '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-public-content/public-images/*"
}
]
}'
Public buckets should be used only when necessary, and restricted to specific prefixes/directories rather than the entire bucket.
Bucket Policies
Create detailed bucket policies to control access:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {"AWS": ["arn:aws:iam::123456789012:user/analytics-team"]},
"Action": ["s3:GetObject", "s3:ListBucket"],
"Resource": [
"arn:aws:s3:::data-warehouse",
"arn:aws:s3:::data-warehouse/*"
],
"Condition": {
"IpAddress": {
"aws:SourceIp": "192.168.1.0/24"
}
}
}
]
}
Save this policy to a file (e.g., policy.json) and apply it:
nexstorage-client bucket policy set \
--bucket data-warehouse \
--policy-file ./policy.json
CORS Configuration
For web applications that need to access NexStorage resources from different domains:
nexstorage-client bucket cors set \
--bucket app-assets \
--config '{
"CORSRules": [
{
"AllowedOrigins": ["https://app.yourcompany.com"],
"AllowedMethods": ["GET", "PUT", "POST"],
"AllowedHeaders": ["*"],
"ExposeHeaders": ["ETag"],
"MaxAgeSeconds": 3600
}
]
}'
Object Versioning and Immutability
Enabling Versioning
Protect against accidental deletions and changes by enabling versioning:
# Enable versioning on a bucket
nexstorage-client bucket versioning enable \
--bucket critical-documents
Retrieve previous versions of objects:
# List all versions of an object
nexstorage-client object list \
--bucket critical-documents \
--prefix financial-report.pdf \
--versions
# Retrieve a specific version
nexstorage-client object get \
--bucket critical-documents \
--object financial-report.pdf \
--version-id "3a2a54b9-5a0f-4c0a-8c9e-12b3e4c7d8e9" \
--file financial-report-v1.pdf
Object Locking
For regulatory compliance or data protection, implement object locking:
# Enable object lock on a bucket (must be enabled at bucket creation)
nexstorage-client bucket create \
--bucket regulatory-data \
--object-lock
# Set retention on an object
nexstorage-client object lock \
--bucket regulatory-data \
--object patient-records.zip \
--mode COMPLIANCE \
--retention "2030-01-01T00:00:00Z"
Available lock modes:
- COMPLIANCE: Cannot be overridden by any user, including root
- GOVERNANCE: Can be overridden by users with special permissions
For legal and compliance requirements, use COMPLIANCE mode with retention periods that match your regulatory needs.
Legal Hold
Place legal holds on objects during litigation or investigations:
# Place legal hold
nexstorage-client object legal-hold set \
--bucket legal-evidence \
--object case123.zip \
--status ON
# Remove legal hold
nexstorage-client object legal-hold set \
--bucket legal-evidence \
--object case123.zip \
--status OFF
Identity and Access Management
NexStorage provides IAM-compatible access control for fine-grained permissions management.
User Management
Create dedicated users for different applications or teams:
# Create a new user
nexstorage-admin user create \
--name analytics-service \
--description "Service account for analytics pipelines"
# Generate access keys for the user
nexstorage-admin user keys create \
--name analytics-service
Policy Management
Create custom policies to enforce principle of least privilege:
# Create a read-only policy
nexstorage-admin policy create \
--name ReadOnlyAccess \
--document '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": "*"
}
]
}'
# Assign the policy to a user
nexstorage-admin user policy attach \
--name analytics-service \
--policy ReadOnlyAccess
Temporary Credentials
For short-term access needs, use temporary credentials:
# Generate temporary credentials valid for 1 hour
nexstorage-admin user temp-credentials \
--name admin \
--duration 3600 \
--policy-file ./temp-policy.json
Auditing and Logging
Enabling Comprehensive Audit Logs
Configure detailed audit logging:
# Enable audit logging
nexstorage-admin config set audit.enabled true
# Configure audit log destination
nexstorage-admin config set audit.destination "file"
nexstorage-admin config set audit.file.path "/var/log/nexstorage/audit.log"
# For Elasticsearch integration
nexstorage-admin config set audit.destination "elasticsearch"
nexstorage-admin config set audit.elasticsearch.url "https://elasticsearch.yourdomain.com:9200"
nexstorage-admin config set audit.elasticsearch.index "nexstorage-audit"