Skip to content

Commit 2ba871c

Browse files
authored
Merge pull request #6 from brevdev/devin/1754374679-implement-fluidstack-provider
Add FluidStack provider boilerplate with comprehensive API stubs
2 parents 904f10a + 51b4b4a commit 2ba871c

File tree

6 files changed

+396
-0
lines changed

6 files changed

+396
-0
lines changed

internal/fluidstack/v1/README.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# FluidStack Provider
2+
3+
FluidStack is an AI cloud platform designed for high-stakes AI workloads, offering bare-metal and virtualized instances with comprehensive security and compliance features.
4+
5+
## Provider Information
6+
7+
- **Provider Name**: `fluidstack`
8+
- **API Documentation**: https://docs.fluidstack.io/api/infrastructure/
9+
- **Base URL**: `https://api.fluidstack.io/v1alpha1`
10+
- **Authentication**: Bearer token (API key)
11+
12+
## Supported Features
13+
14+
### ✅ Instance Management
15+
- **Create Instance**: `POST /instances` - Create new instances with project scoping
16+
- **Get Instance**: `GET /instances/{id}` - Retrieve instance details
17+
- **List Instances**: `GET /instances` - List all instances in project
18+
- **Terminate Instance**: `DELETE /instances/{id}` - Delete instances
19+
- **Start Instance**: `POST /instances/{id}/start` - Start stopped instances
20+
- **Stop Instance**: `POST /instances/{id}/stop` - Stop running instances
21+
22+
### ✅ Instance Types
23+
- **List Instance Types**: `GET /instance-types` - Get available instance configurations
24+
- **GPU Support**: NVIDIA GPU instances for AI/ML workloads
25+
- **Bare Metal & Virtualized**: Both deployment options available
26+
27+
### ✅ Project Management
28+
- **Create Project**: `POST /projects` - Create isolated project environments
29+
- **List Projects**: `GET /projects` - List all projects
30+
- **Get Project**: `GET /projects/{id}` - Get project details
31+
- **Delete Project**: `DELETE /projects/{id}` - Remove projects
32+
- **Project Scoping**: All resources are scoped to projects via `X-PROJECT-ID` header
33+
34+
### ✅ Security Features
35+
- **Disk Encryption**: Hardware-level self-encrypting drives (SEDs) for data at rest
36+
- **Transit Encryption**: SSL/TLS encryption for all network traffic
37+
- **Network Isolation**: Project-level isolation using VXLAN and eBPF
38+
- **Compliance**: HIPAA, GDPR, ISO27001, SOC 2 TYPE I certified
39+
40+
### ✅ Additional Features
41+
- **Tagging**: Support for resource tagging and organization
42+
- **Filesystem Management**: Block and file storage management
43+
- **Kubernetes Clusters**: Managed Kubernetes cluster support
44+
- **Slurm Clusters**: Managed Slurm batch orchestration
45+
46+
## Unsupported Features
47+
48+
### ❌ Firewall Rules
49+
- **Individual Instance Firewalls**: No API endpoints for per-instance firewall rules
50+
- **Security Groups**: Uses project-level isolation instead of security groups
51+
- **Network ACLs**: No granular network access control lists
52+
53+
### ❌ Storage Operations
54+
- **Volume Resizing**: No API support for resizing instance volumes
55+
- **Snapshot Management**: Volume snapshot operations not available
56+
- **Volume Attachment**: Dynamic volume attach/detach not supported
57+
58+
### ❌ Advanced Networking
59+
- **VPC Management**: No virtual private cloud configuration
60+
- **Load Balancers**: No managed load balancer services
61+
- **Custom Networks**: Limited to project-level network isolation
62+
63+
## Implementation Notes
64+
65+
### Authentication
66+
```go
67+
client := NewFluidStackClient("your-api-key")
68+
```
69+
70+
### Project Scoping
71+
All instance operations require a project context:
72+
```go
73+
// All API calls include X-PROJECT-ID header
74+
// Projects provide isolation boundary for resources
75+
```
76+
77+
### Security Model
78+
- **Project-Level Isolation**: Resources are isolated at the project level
79+
- **Default Network Behavior**: Instances can egress to internet, communicate within project
80+
- **Encryption**: Automatic encryption at rest and in transit
81+
82+
## API Capabilities
83+
84+
FluidStack provides a comprehensive Infrastructure API with the following endpoint categories:
85+
86+
- **Projects**: Full CRUD operations for project management
87+
- **Instances**: Complete instance lifecycle management
88+
- **Instance Types**: Hardware configuration discovery
89+
- **Filesystems**: Storage management operations
90+
- **Kubernetes**: Managed Kubernetes cluster operations
91+
- **Slurm**: Managed Slurm cluster operations
92+
- **Capacity**: Real-time capacity checking
93+
94+
## Compliance & Security
95+
96+
FluidStack meets enterprise security requirements with:
97+
- Hardware-level disk encryption using self-encrypting drives
98+
- SSL/TLS encryption for all network traffic
99+
- Tier-3 data centers with biometric access controls
100+
- Multiple compliance certifications (HIPAA, GDPR, ISO27001, SOC 2)
101+
- Project-level network isolation using VXLAN and eBPF
102+
103+
For detailed security information, see [SECURITY.md](./SECURITY.md).

internal/fluidstack/v1/SECURITY.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# FluidStack Security Compliance
2+
3+
This document outlines FluidStack's security capabilities and compliance with Brev's security requirements.
4+
5+
## ✅ FULLY COMPLIANT
6+
7+
### Disk Encryption
8+
- **Encryption at Rest**: Hardware-level self-encrypting drives (SEDs)
9+
- **Implementation**: Automatic encryption without performance overhead
10+
- **Coverage**: All data stored on FluidStack infrastructure
11+
- **Standard**: Industry-standard encryption algorithms
12+
13+
### Transit Encryption
14+
- **Protocol**: SSL/TLS encryption for all network traffic
15+
- **Coverage**: All API communications and data transfer
16+
- **Implementation**: Automatic encryption for all connections
17+
18+
### Network Isolation
19+
- **Project-Level Isolation**: Dedicated L3 networks per project
20+
- **Technology**: VXLAN and eBPF for network segmentation
21+
- **Isolation Scope**: Hardware, network, and storage levels
22+
- **Multi-Tenancy**: Single-tenant by default, no shared clusters
23+
24+
### Physical Security
25+
- **Data Centers**: Tier-3 facilities with 24/7 surveillance
26+
- **Access Controls**: Biometric access controls and mantrap entry systems
27+
- **Monitoring**: Continuous monitoring with CCTV coverage
28+
- **Personnel**: Restricted access to authorized personnel only
29+
30+
### Compliance Certifications
31+
- **HIPAA**: Health Insurance Portability and Accountability Act
32+
- **GDPR**: General Data Protection Regulation
33+
- **ISO27001**: Information Security Management System
34+
- **SOC 2 TYPE I**: Service Organization Control 2
35+
36+
## ⚠️ PARTIAL COMPLIANCE
37+
38+
### Network Security Model
39+
- **✅ Outbound Traffic**: Instances can egress to public internet (compliant)
40+
- **✅ Project Isolation**: Strong isolation between projects (compliant)
41+
- **❓ Inbound Traffic**: "Deny all inbound by default" behavior not explicitly documented
42+
- **❓ Instance-Level Firewalls**: No API endpoints for individual instance firewall rules
43+
44+
### Firewall Management
45+
- **Limitation**: Security managed at project/cluster level, not per-instance
46+
- **API Gap**: No dedicated firewall rule management endpoints in Infrastructure API
47+
- **Workaround**: Project-level isolation provides security boundary
48+
- **Impact**: May not provide granular instance-level firewall control
49+
50+
## ❌ LIMITATIONS
51+
52+
### Granular Network Control
53+
- **Missing Feature**: Individual instance firewall rule management
54+
- **Alternative**: Project-level network isolation
55+
- **API Support**: No explicit firewall rule endpoints found
56+
- **Security Model**: Relies on project boundaries for isolation
57+
58+
### Network Security APIs
59+
- **Firewall Rules**: No API endpoints for creating/managing firewall rules
60+
- **Security Groups**: No security group concept or API
61+
- **Network ACLs**: No network access control list management
62+
63+
## Security Implementation Notes
64+
65+
### Default Security Posture
66+
```
67+
✅ Data encrypted at rest (hardware-level SEDs)
68+
✅ Data encrypted in transit (SSL/TLS)
69+
✅ Project-level network isolation (VXLAN/eBPF)
70+
✅ Physical security (Tier-3 data centers)
71+
❓ Instance-level firewall rules (not documented)
72+
❓ "Deny all inbound" default behavior (needs verification)
73+
```
74+
75+
### Recommended Security Practices
76+
77+
1. **Project Organization**: Use separate projects for different security zones
78+
2. **Network Design**: Leverage project-level isolation for security boundaries
79+
3. **Access Control**: Implement application-level security controls
80+
4. **Monitoring**: Use FluidStack's audit logging and monitoring features
81+
82+
### Security Verification Required
83+
84+
Before production deployment, verify:
85+
86+
1. **Default Inbound Policy**: Confirm if inbound traffic is denied by default
87+
2. **Firewall APIs**: Check for any undocumented firewall management endpoints
88+
3. **Network Behavior**: Test actual network isolation and traffic patterns
89+
4. **Security Controls**: Validate project-level isolation effectiveness
90+
91+
## Risk Assessment
92+
93+
### Low Risk
94+
- **Data Encryption**: Excellent hardware-level encryption
95+
- **Physical Security**: Strong data center security controls
96+
- **Compliance**: Multiple enterprise certifications
97+
- **Network Isolation**: Strong project-level isolation
98+
99+
### Medium Risk
100+
- **Firewall Management**: Limited granular network control
101+
- **API Limitations**: No explicit firewall rule management
102+
- **Documentation Gaps**: Some security behaviors not explicitly documented
103+
104+
### Mitigation Strategies
105+
106+
1. **Application Security**: Implement security controls at the application layer
107+
2. **Project Design**: Use project boundaries as security zones
108+
3. **Network Architecture**: Design applications to work within project isolation model
109+
4. **Monitoring**: Implement comprehensive logging and monitoring
110+
111+
## Conclusion
112+
113+
FluidStack provides **excellent foundational security** with hardware-level encryption, strong network isolation, and comprehensive compliance certifications. However, it may not provide the granular instance-level firewall management that some security models require.
114+
115+
**Recommendation**: FluidStack is suitable for workloads that can leverage project-level security isolation. For applications requiring fine-grained instance-level firewall controls, additional verification and testing is recommended.
116+
117+
## References
118+
119+
- [FluidStack Security Documentation](https://www.fluidstack.io/resources/security)
120+
- [FluidStack Infrastructure API](https://docs.fluidstack.io/api/infrastructure/)
121+
- [FluidStack Networking Overview](https://docs.fluidstack.io/fluidstack/networking/overview/)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package v1
2+
3+
import (
4+
"context"
5+
6+
"github.com/brevdev/cloud/pkg/v1"
7+
)
8+
9+
func (c *FluidStackClient) GetCapabilities(_ context.Context) (v1.Capabilities, error) {
10+
capabilities := v1.Capabilities{
11+
v1.CapabilityCreateInstance,
12+
v1.CapabilityTerminateInstance,
13+
v1.CapabilityStopStartInstance,
14+
v1.CapabilityTags,
15+
}
16+
17+
return capabilities, nil
18+
}

internal/fluidstack/v1/client.go

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
package v1
2+
3+
import (
4+
"context"
5+
"crypto/sha256"
6+
"fmt"
7+
8+
"github.com/brevdev/cloud/pkg/v1"
9+
)
10+
11+
const CloudProviderID = "fluidstack"
12+
13+
// FluidStackCredential implements the CloudCredential interface for FluidStack
14+
type FluidStackCredential struct {
15+
RefID string
16+
APIKey string
17+
}
18+
19+
var _ v1.CloudCredential = &FluidStackCredential{}
20+
21+
func NewFluidStackCredential(refID, apiKey string) *FluidStackCredential {
22+
return &FluidStackCredential{
23+
RefID: refID,
24+
APIKey: apiKey,
25+
}
26+
}
27+
28+
// GetReferenceID returns the reference ID for this credential
29+
func (c *FluidStackCredential) GetReferenceID() string {
30+
return c.RefID
31+
}
32+
33+
// GetAPIType returns the API type for FluidStack
34+
func (c *FluidStackCredential) GetAPIType() v1.APIType {
35+
return v1.APITypeGlobal
36+
}
37+
38+
// GetCloudProviderID returns the cloud provider ID for FluidStack
39+
func (c *FluidStackCredential) GetCloudProviderID() v1.CloudProviderID {
40+
return CloudProviderID
41+
}
42+
43+
// GetTenantID returns the tenant ID for FluidStack
44+
func (c *FluidStackCredential) GetTenantID() (string, error) {
45+
return fmt.Sprintf("%s-%x", CloudProviderID, sha256.Sum256([]byte(c.APIKey))), nil
46+
}
47+
48+
// GetCapabilities returns the capabilities for FluidStack
49+
func (c *FluidStackCredential) GetCapabilities(ctx context.Context) (v1.Capabilities, error) {
50+
client, err := c.MakeClient(ctx, "")
51+
if err != nil {
52+
return nil, err
53+
}
54+
return client.GetCapabilities(ctx)
55+
}
56+
57+
// MakeClient creates a new FluidStack client from this credential
58+
func (c *FluidStackCredential) MakeClient(_ context.Context, _ string) (v1.CloudClient, error) {
59+
return NewFluidStackClient(c.RefID, c.APIKey), nil
60+
}
61+
62+
// FluidStackClient implements the CloudClient interface for FluidStack
63+
// It embeds NotImplCloudClient to handle unsupported features
64+
type FluidStackClient struct {
65+
v1.NotImplCloudClient
66+
refID string
67+
apiKey string
68+
baseURL string
69+
}
70+
71+
var _ v1.CloudClient = &FluidStackClient{}
72+
73+
func NewFluidStackClient(refID, apiKey string) *FluidStackClient {
74+
return &FluidStackClient{
75+
refID: refID,
76+
apiKey: apiKey,
77+
baseURL: "https://api.fluidstack.io/v1alpha1",
78+
}
79+
}
80+
81+
// GetAPIType returns the API type for FluidStack
82+
func (c *FluidStackClient) GetAPIType() v1.APIType {
83+
return v1.APITypeGlobal
84+
}
85+
86+
// GetCloudProviderID returns the cloud provider ID for FluidStack
87+
func (c *FluidStackClient) GetCloudProviderID() v1.CloudProviderID {
88+
return CloudProviderID
89+
}
90+
91+
// MakeClient creates a new client instance
92+
func (c *FluidStackClient) MakeClient(_ context.Context, _ string) (v1.CloudClient, error) {
93+
return c, nil
94+
}
95+
96+
// GetReferenceID returns the reference ID for this client
97+
func (c *FluidStackClient) GetReferenceID() string {
98+
return c.refID
99+
}

internal/fluidstack/v1/instance.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package v1
2+
3+
import (
4+
"context"
5+
6+
"github.com/brevdev/cloud/pkg/v1"
7+
)
8+
9+
func (c *FluidStackClient) CreateInstance(_ context.Context, _ v1.CreateInstanceAttrs) (*v1.Instance, error) {
10+
return nil, v1.ErrNotImplemented
11+
}
12+
13+
func (c *FluidStackClient) GetInstance(_ context.Context, _ v1.CloudProviderInstanceID) (*v1.Instance, error) {
14+
return nil, v1.ErrNotImplemented
15+
}
16+
17+
func (c *FluidStackClient) TerminateInstance(_ context.Context, _ v1.CloudProviderInstanceID) error {
18+
return v1.ErrNotImplemented
19+
}
20+
21+
func (c *FluidStackClient) ListInstances(_ context.Context, _ v1.ListInstancesArgs) ([]v1.Instance, error) {
22+
return nil, v1.ErrNotImplemented
23+
}
24+
25+
func (c *FluidStackClient) RebootInstance(_ context.Context, _ v1.CloudProviderInstanceID) error {
26+
return v1.ErrNotImplemented
27+
}
28+
29+
func (c *FluidStackClient) MergeInstanceForUpdate(currInst v1.Instance, _ v1.Instance) v1.Instance {
30+
return currInst
31+
}
32+
33+
func (c *FluidStackClient) MergeInstanceTypeForUpdate(currIt v1.InstanceType, _ v1.InstanceType) v1.InstanceType {
34+
return currIt
35+
}

0 commit comments

Comments
 (0)