Skip to content

Commit acdc2f5

Browse files
committed
Merge branch 'feature/host-basic-system-discovery' - Host basic system discovery functionality
2 parents dc353c7 + d8237fc commit acdc2f5

52 files changed

Lines changed: 1074 additions & 215745 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,18 @@ $RECYCLE.BIN/
400400
.nfs*
401401

402402
# ======================================
403-
# TEST AND TEMPORARY FILES
403+
# TEST AND DOCUMENTATION DIRECTORIES - NEVER COMMIT
404404
# ======================================
405405

406+
# Project-specific test and documentation directories
407+
/test/
408+
/tests/
409+
/docs/
410+
backend/test/
411+
backend/tests/
412+
frontend/test/
413+
frontend/tests/
414+
406415
# Test reports and artifacts
407416
test-reports/
408417
test_results/
@@ -416,7 +425,11 @@ frontend_test.log
416425
*test*.py
417426
*test*.sh
418427
*test*.md
419-
**/tests/** # But keep files in proper test directories
428+
*test*.js
429+
*test*.cjs
430+
*test*.mjs
431+
*test*.ts
432+
*test*.tsx
420433

421434
# Temporary files
422435
*.tmp
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"""Add compatibility fields to Host and ScapContent models
2+
3+
Revision ID: 006
4+
Revises: 005
5+
Create Date: 2025-09-02 16:00:00.000000
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
from sqlalchemy.dialects import postgresql
11+
12+
# revision identifiers
13+
revision = '006'
14+
down_revision = '005'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade() -> None:
20+
"""Add compatibility fields to Host and ScapContent models"""
21+
22+
# Add compatibility fields to hosts table
23+
op.add_column('hosts', sa.Column('os_family', sa.String(50), nullable=True))
24+
op.add_column('hosts', sa.Column('os_version', sa.String(100), nullable=True))
25+
op.add_column('hosts', sa.Column('architecture', sa.String(50), nullable=True))
26+
op.add_column('hosts', sa.Column('last_os_detection', sa.DateTime(), nullable=True))
27+
28+
# Add compatibility fields to scap_content table
29+
op.add_column('scap_content', sa.Column('os_family', sa.String(50), nullable=True))
30+
op.add_column('scap_content', sa.Column('compliance_framework', sa.String(100), nullable=True))
31+
32+
33+
def downgrade() -> None:
34+
"""Remove compatibility fields from Host and ScapContent models"""
35+
36+
# Remove fields from scap_content table
37+
op.drop_column('scap_content', 'compliance_framework')
38+
op.drop_column('scap_content', 'os_family')
39+
40+
# Remove fields from hosts table
41+
op.drop_column('hosts', 'last_os_detection')
42+
op.drop_column('hosts', 'architecture')
43+
op.drop_column('hosts', 'os_version')
44+
op.drop_column('hosts', 'os_family')
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""Add os_version field to ScapContent model
2+
3+
Revision ID: 007
4+
Revises: 006
5+
Create Date: 2025-09-02 17:00:00.000000
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
from sqlalchemy.dialects import postgresql
11+
12+
# revision identifiers
13+
revision = '007'
14+
down_revision = '006'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade() -> None:
20+
"""Add os_version field to ScapContent model"""
21+
22+
# Add os_version field to scap_content table
23+
op.add_column('scap_content', sa.Column('os_version', sa.String(100), nullable=True))
24+
25+
26+
def downgrade() -> None:
27+
"""Remove os_version field from ScapContent model"""
28+
29+
# Remove os_version field from scap_content table
30+
op.drop_column('scap_content', 'os_version')

backend/app/database.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ class Host(Base):
115115
ip_address = Column(String(45), nullable=False) # IPv4 or IPv6
116116
display_name = Column(String(255), nullable=True)
117117
operating_system = Column(String(255), nullable=True)
118+
os_family = Column(String(50), nullable=True) # Added for compatibility validation
119+
os_version = Column(String(100), nullable=True) # Added for compatibility validation
120+
architecture = Column(String(50), nullable=True) # Added for compatibility validation
121+
last_os_detection = Column(DateTime, nullable=True) # Added for OS detection tracking
118122
status = Column(String(50), default="offline", nullable=False)
119123
port = Column(Integer, default=22, nullable=False)
120124
username = Column(String(50), nullable=True) # Made optional
@@ -142,6 +146,9 @@ class ScapContent(Base):
142146
profiles = Column(Text, nullable=True) # JSON array of available profiles
143147
description = Column(Text, nullable=True)
144148
version = Column(String(50), nullable=True)
149+
os_family = Column(String(50), nullable=True) # Added for compatibility validation
150+
os_version = Column(String(100), nullable=True) # Added for OS version compatibility validation
151+
compliance_framework = Column(String(100), nullable=True) # Added for compliance tracking
145152
uploaded_by = Column(Integer, ForeignKey("users.id"), nullable=False)
146153
uploaded_at = Column(DateTime, default=datetime.utcnow, nullable=False)
147154
file_hash = Column(String(64), nullable=False) # SHA-256 hash for integrity

backend/app/models/scan_models.py

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)