53 lines
2.0 KiB
Python
53 lines
2.0 KiB
Python
"""
|
|
URL configuration for security app
|
|
"""
|
|
from django.urls import path, include
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from .views.security import (
|
|
DataClassificationViewSet, RoleViewSet, UserViewSet,
|
|
MFADeviceViewSet, AuditLogViewSet, SSOProviderViewSet,
|
|
AccessPolicyViewSet, login_view, logout_view, user_profile,
|
|
change_password, mfa_status
|
|
)
|
|
from .views.zero_trust import (
|
|
DevicePostureViewSet, GeolocationRuleViewSet, RiskAssessmentViewSet,
|
|
AdaptiveAuthenticationViewSet, UserBehaviorProfileViewSet,
|
|
zero_trust_status, perform_risk_assessment
|
|
)
|
|
|
|
# Create router for ViewSets
|
|
router = DefaultRouter()
|
|
router.register(r'classifications', DataClassificationViewSet)
|
|
router.register(r'roles', RoleViewSet)
|
|
router.register(r'users', UserViewSet)
|
|
router.register(r'mfa-devices', MFADeviceViewSet, basename='mfadevice')
|
|
router.register(r'audit-logs', AuditLogViewSet)
|
|
router.register(r'sso-providers', SSOProviderViewSet)
|
|
router.register(r'access-policies', AccessPolicyViewSet)
|
|
|
|
# Zero Trust ViewSets
|
|
router.register(r'device-postures', DevicePostureViewSet, basename='deviceposture')
|
|
router.register(r'geolocation-rules', GeolocationRuleViewSet)
|
|
router.register(r'risk-assessments', RiskAssessmentViewSet, basename='riskassessment')
|
|
router.register(r'adaptive-auth', AdaptiveAuthenticationViewSet)
|
|
router.register(r'behavior-profiles', UserBehaviorProfileViewSet, basename='behaviorprofile')
|
|
|
|
app_name = 'security'
|
|
|
|
urlpatterns = [
|
|
# API router
|
|
path('api/', include(router.urls)),
|
|
|
|
# Authentication endpoints
|
|
path('api/auth/login/', login_view, name='login'),
|
|
path('api/auth/logout/', logout_view, name='logout'),
|
|
path('api/auth/profile/', user_profile, name='user-profile'),
|
|
path('api/auth/change-password/', change_password, name='change-password'),
|
|
path('api/auth/mfa-status/', mfa_status, name='mfa-status'),
|
|
|
|
# Zero Trust endpoints
|
|
path('api/zero-trust/status/', zero_trust_status, name='zero-trust-status'),
|
|
path('api/zero-trust/assess/', perform_risk_assessment, name='risk-assessment'),
|
|
]
|