SecureGuard is a Go-based security management platform for tracking assets, vulnerabilities, and incidents. It provides robust role-based access control (RBAC), secure data handling, and a RESTful API built with Gin.
- Role-Based Access Control (RBAC):
Admin
: Full access to all operationsAnalyst
: Create/manage incidents, vulnerabilities, assetsViewer
: Read-only access
- Management Modules:
- Assets with vulnerability mapping
- Vulnerability tracking
- Incident management
- Security:
- Bcrypt password hashing
- SQL injection prevention
- Prepared statements for database security
graph TD
A[User] --> B[Ingress]
B --> C[SecureGuard API]
C --> D[(PostgreSQL)]
C --> E[RBAC Auth]
Component | Technology |
---|---|
Language | Go 1.19+ |
Framework | Gin |
Database | PostgreSQL 14+ |
Container | Docker 20.10+ |
Orchestration | Kubernetes 1.24+ |
Packaging | Helm 3.8+ |
docker-compose up -d
Access API at http://localhost:8080
- Kubernetes cluster (v1.24+)
- PostgreSQL instance (or use included
db-statefulset.yaml
)
- Create namespace:
kubectl create namespace secureguard
- Apply manifests:
kubectl apply -f kubernetes/
helm install secureguard ./helm \
--set postgres.enabled=true \
--namespace secureguard
The kubernetes/
directory contains:
api-depl.yaml
: SecureGuard API deploymentapi-svc.yaml
: ClusterIP serviceingress.yaml
: Ingress configurationingress-class.yaml
: Ingress Classdb-sfs.yaml
: PostgreSQL StatefulSetdb-svc.yaml
: Headless PostgreSQL servicemigrations.yaml
: Database Migrationsnamespace.yaml
: Namespace configurationsecret.yaml
: Secret configuration
secureguard-helm/
├── Chart.yaml
├── templates/
│ ├── api-depl.yaml
│ ├── api-svc.yaml
│ ├── db-sfs.yaml
│ ├── db-svc.yaml
│ ├── ingress.yaml
│ ├── ingress-class.yaml
│ ├── migrations.yaml
│ ├── namespace.yaml
│ ├── secret.yaml
└── values.yaml
Set environment variables in config.yaml
:
database:
DB_URL: "postgres-hl.secureguard.svc.cluster.local"
POSTGRES_USER: "admin"
POSTGRES_PASSWORD: "securepassword"
api:
PORT: 4000
Method | Endpoint | Description |
---|---|---|
POST | /users/register |
Register new user |
POST | /users/login |
Authenticate user |
GET | /assets |
List all assets (RBAC protected) |
POST | /vulnerabilities |
Create vulnerability record |
- Database:
- Use cloud-managed PostgreSQL (RDS, Cloud SQL)
- Enable automated backups
-
Security:
kubectl create secret generic db-creds \ --from-literal=username=admin \ --from-literal=password='S3cure!P@ss' \ -n secureguard
-
Monitoring:
- Add Prometheus annotations to deployments
- Configure Grafana dashboards
Database Connection Issues:
- Verify DNS resolution:
kubectl exec -it <api-pod> -- nslookup postgres-hl
- Check PVC binding status:
kubectl get pvc -n secureguard
RBAC Errors:
- Verify JWT_SECRET matches across deployments
- Check role assignments in database
- Fork the repository
- Create feature branch (
git checkout -b feature/improvement
) - Commit changes with descriptive messages
- Open pull request against
main
branch
- Docker Image: docker.io/akshayyyyy/secureguard
- Helm Chart (OCI):
oci://docker.io/akshayyyyy/secureguard