{% extends 'base.html' %} {% load static %} {% block title %}Security Compliance Report{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

Security Compliance Report

{{ total_security_events }}
Security Events
{{ compliance_metrics.password_changes }}
Password Changes
{{ compliance_metrics.role_changes }}
Role Changes
{{ compliance_metrics.critical_permission_grants }}
Critical Permissions
📊 Compliance Score
{% with score=85 %}
{{ score }}%
Based on security events, failed access attempts, and policy violations
{% endwith %}
📊 Security Alerts by Severity
Failed Access Attempts
{% for attempt in failed_access %} {% empty %} {% endfor %}
User IP Address Attempts Risk Level
{{ attempt.user__first_name }} {{ attempt.user__last_name }} {{ attempt.ip_address|default:"-" }} {{ attempt.count }} {% if attempt.count > 10 %} High {% elif attempt.count > 5 %} Medium {% else %} Low {% endif %}
No failed access attempts
🛡️ Permission Escalations
{% for escalation in permission_escalations %}
{{ escalation.user.get_full_name }}
Permission: {{ escalation.permission_name }}
Changed by: {{ escalation.changed_by.get_full_name }}
{{ escalation.timestamp|timesince }} ago
Escalation
{% empty %}

No permission escalations detected

{% endfor %}
🌐 Suspicious IP Addresses
{% for ip in suspicious_ips %}
{{ ip.ip_address }}
{{ ip.unique_users }} unique users
{{ ip.event_count }} events
{% empty %}

No suspicious IP addresses detected

{% endfor %}
⬇️ Data Export Activities
{% for export in data_exports %}
{{ export.user.get_full_name }}
{{ export.action }}
{{ export.description|truncatechars:60 }}
{{ export.timestamp|timesince }} ago
Export
{% empty %}

No data exports in this period

{% endfor %}
⚠️ Open Security Alerts
View All Alerts
{% for alert in open_alerts %}
{{ alert.title }} {{ alert.severity|title }} {{ alert.alert_type|title }}

{{ alert.description|truncatechars:150 }}

{% if alert.user %} User: {{ alert.user.get_full_name }} {% endif %} {% if alert.ip_address %} | IP: {{ alert.ip_address }} {% endif %}
{{ alert.created_at|timesince }} ago
{% empty %}
No Open Security Alerts

All security alerts have been resolved.

{% endfor %}
💡 Security Recommendations
Immediate Actions
    {% if total_security_events > 20 %}
  • ⚠️ Review and address {{ total_security_events }} security events
  • {% endif %} {% if compliance_metrics.critical_permission_grants > 2 %}
  • 🔑 Audit {{ compliance_metrics.critical_permission_grants }} critical permission grants
  • {% endif %} {% for attempt in failed_access %} {% if attempt.count > 10 %}
  • Investigate {{ attempt.count }} failed attempts from {{ attempt.user__first_name }} {{ attempt.user__last_name }}
  • {% endif %} {% endfor %}
Preventive Measures
  • Implement multi-factor authentication
  • Set up automated security monitoring
  • Conduct security awareness training
  • 🔄 Regular permission audits
{% endblock %} {% block extra_js %} {% endblock %}