{{-- Global Loader Styles --}}
{{-- Page Header --}}

Firewall Management

Configure firewall rules, policies, aliases, and IPSets for your virtual machine

{{-- Error Modal --}} @if($error && $showErrorModal)

Error

{{ $error }}

@endif {{-- Main Firewall Toggle & Status --}}

Master Firewall Control

@if($firewallEnabled) ✓ Active - Your VM is protected by firewall rules @else ⚠ Disabled - Your VM has no firewall protection @endif

@if($firewallEnabled) @else @endif
{{-- Firewall Policies & Network Adapters Grid --}} @if($firewallEnabled)
{{-- Default Policies Card --}}

Default Policies

Control default traffic behavior

Default action for incoming traffic not matching any rule

Default action for outgoing traffic not matching any rule

{{-- Network Adapters --}}

Network Adapters

Per-device firewall control

@if(count($networkAdapters) > 0)
@foreach($networkAdapters as $adapter)
{{ $adapter['name'] }} @if($adapterFirewallStates[$adapter['name']] ?? false) Active @else Off @endif
{{ ucfirst($adapter['model'] ?? 'Unknown') }} @if($adapter['mac']) {{ $adapter['mac'] }} @endif
@if($adapterFirewallStates[$adapter['name']] ?? false) @else @endif
@endforeach
@else

No network adapters found

@endif
{{-- Policy Info Modal --}} @if($showPolicyInfoModal)

Understanding Firewall Policies

How default policies control your network traffic

Policy In (Incoming Traffic)

Controls what happens to traffic coming INTO your VM when it doesn't match any explicit firewall rule.

  • ACCEPT: Allow all incoming traffic by default (permissive, requires explicit DENY rules)
  • REJECT: Block incoming traffic and send rejection notification to sender
  • DROP: Silently discard incoming traffic without notifying sender (recommended)

Policy Out (Outgoing Traffic)

Controls what happens to traffic going OUT of your VM when it doesn't match any explicit firewall rule.

  • ACCEPT: Allow all outgoing traffic by default (recommended for most VMs)
  • REJECT: Block outgoing traffic and notify your VM
  • DROP: Silently discard outgoing traffic

Creating a Whitelist Configuration

To create a strict whitelist (only allow specific traffic):

  1. Set Policy In to DROP
  2. Set Policy Out to DROP (if restricting outbound)
  3. Create explicit ACCEPT rules for allowed traffic
  4. Everything not explicitly allowed will be blocked

Additional Filters

IP Filter: Validates that source/destination IP addresses in packets match the VM's assigned IPs. Helps prevent IP spoofing.

MAC Filter: Validates that MAC addresses match the VM's network adapters. Provides additional layer of security.

@endif {{-- Tabs Navigation --}}
{{-- Tab Contents --}}
{{-- RULES TAB --}}

Firewall Rules

@if(count($rules) > 0)
@foreach($rules as $index => $rule) @endforeach
Order Pos Action Direction Source Destination Protocol Ports Status Actions
@if($index > 0) @else
@endif @if($index < count($rules) - 1) @else
@endif
{{ $rule['pos'] ?? '-' }} @php $actionClass = match($rule['action'] ?? '') { 'ACCEPT' => 'bg-success/20 text-success', 'REJECT' => 'bg-warning/20 text-warning', 'DROP' => 'bg-error/20 text-error', default => 'bg-base/20 text-base/60' }; @endphp {{ $rule['action'] ?? '-' }} {{ strtoupper($rule['type'] ?? 'IN') }}
{{ $rule['source'] ?? '-' }} @php $ruleSourceIP = $rule['source'] ?? ''; @endphp @if($ruleSourceIP && $ruleSourceIP !== '-' && $this->checkIsPublicIP($ruleSourceIP))
{{-- IP Location Modal (same as logs) --}}
@endif
{{ $rule['dest'] ?? '-' }} @php $ruleDestIP = $rule['dest'] ?? ''; @endphp @if($ruleDestIP && $ruleDestIP !== '-' && $this->checkIsPublicIP($ruleDestIP))
{{-- IP Location Modal (same structure) --}}
@endif
{{ strtoupper($rule['proto'] ?? ($rule['macro'] ?? 'ANY')) }} {{ $rule['dport'] ?? $rule['sport'] ?? '-' }} @if(isset($rule['enable']) && $rule['enable'] == 0) Disabled @else Enabled @endif
@else

No Firewall Rules

Create your first rule to control network traffic

@endif
{{-- ALIASES TAB --}}

IP Aliases

Create named references to IP addresses or CIDR ranges

@if(count($aliases) > 0)
@foreach($aliases as $alias)
{{ $alias['name'] }}
{{ $alias['cidr'] }}
@if(!empty($alias['comment']))
{{ $alias['comment'] }}
@endif
@endforeach
@else

No IP Aliases

Create aliases to simplify rule management

@endif
{{-- IPSETS TAB --}}

IP Sets

Group multiple IPs/CIDRs for easier rule management

{{-- IPSets List --}}

Available IP Sets

@if(count($ipsets) > 0)
@foreach($ipsets as $ipset)
{{ $ipset['name'] }}
@if(!empty($ipset['comment']))
{{ $ipset['comment'] }}
@endif
@endforeach
@else

No IP Sets created yet

@endif
{{-- IPSet Members --}}
@if($selectedIPSetName)

Members of: {{ $selectedIPSetName }}

@if(count($ipsetMembers) > 0)
@foreach($ipsetMembers as $member)
{{ $member['cidr'] }}
@if(!empty($member['comment']))
{{ $member['comment'] }}
@endif @if(isset($member['nomatch']) && $member['nomatch']) No Match @endif
@endforeach
@else

No members in this IPSet

@endif @else

Select an IP Set to view its members

@endif
{{-- LOGS TAB --}}

Firewall Logs

Showing the latest logs first (most recent at top)

@if($lastLogRefresh) • Last updated: {{ $lastLogRefresh }} @endif • Auto-refreshes every 30s
@if(!empty($logError))

{{ $logError }}

@endif @if(!$logsLoaded && count($firewallLogs) === 0)

Loading firewall logs...

@elseif(count($firewallLogs) > 0)
@foreach($this->paginatedLogs as $log) @endforeach
Time Action Source Destination Protocol Port Analysis
@if(isset($log['timestamp_iso']) && $log['timestamp_iso'] !== '-')
@else {{ $log['timestamp_display'] ?? $log['timestamp'] ?? '-' }} @endif
{{ $log['action'] ?? '-' }}
{{ $log['source'] ?? '-' }} @php $sourceIP = $log['source'] ?? ''; @endphp @if($sourceIP && $sourceIP !== '-' && $this->checkIsPublicIP($sourceIP))
{{-- IP Location Modal --}}
@endif
{{ $log['destination'] ?? '-' }} @php $destIP = $log['destination'] ?? ''; @endphp @if($destIP && $destIP !== '-' && $this->checkIsPublicIP($destIP))
{{-- IP Location Modal --}}
@endif
{{ $log['protocol'] ?? '-' }} {{ $log['destination_port'] ?? '-' }} @php $sourceIP = $log['source'] ?? ''; $destIP = $log['destination'] ?? ''; $sourcePort = $log['source_port'] ?? ''; $destPort = $log['destination_port'] ?? ''; $protocol = $log['protocol'] ?? ''; @endphp
{{-- Network Analysis Modal --}}
{{-- Pagination Controls --}}
{{-- Records per page selector --}}
per page
{{-- Page info and navigation --}}
Showing {{ (($currentPage - 1) * $perPage) + 1 }} - {{ min($currentPage * $perPage, count($firewallLogs)) }} of {{ count($firewallLogs) }} logs
{{-- First page --}} {{-- Previous page --}} {{-- Page numbers --}} @php $totalPages = $this->totalPages; $startPage = max(1, $currentPage - 2); $endPage = min($totalPages, $currentPage + 2); @endphp @if($startPage > 1) @if($startPage > 2) ... @endif @endif @for($i = $startPage; $i <= $endPage; $i++) @endfor @if($endPage < $totalPages) @if($endPage < $totalPages - 1) ... @endif @endif {{-- Next page --}} {{-- Last page --}}
@else

No Firewall Logs

Logs will appear here when the firewall blocks or allows traffic

@endif
@else

Firewall Protection Disabled

Your virtual machine is currently unprotected. Enable the firewall above to secure your network traffic with customizable rules.

Traffic Control

Define rules to allow or block specific connections

Monitor Activity

Track and log all firewall events in real-time

Flexible Policies

Configure default behavior for incoming and outgoing traffic

@endif {{-- Rule Form Modal --}} @if($showRuleForm)

{{ $editingRuleIndex !== null ? 'Edit' : 'Create' }} Firewall Rule

{{-- Action --}}
{{-- Type --}}
{{-- Macro --}}

Selecting a macro will automatically set the protocol and port(s)

{{-- Interface --}}
{{-- Source --}}

Can use alias names or leave empty for any source

{{-- Destination --}}
{{-- Protocol --}}
{{-- Destination Port --}}
{{-- Source Port --}}
{{-- Log Level --}}
{{-- Comment --}}
{{-- Enable --}}
@endif {{-- Delete Rule Modal --}} @if($showDeleteRuleModal && $deletingRuleIndex !== null && isset($rules[$deletingRuleIndex])) @php $ruleToDelete = $rules[$deletingRuleIndex]; @endphp

Delete Firewall Rule

Are you sure you want to delete this rule? This action cannot be undone.

Action: {{ $ruleToDelete['action'] ?? '-' }}
Source: {{ $ruleToDelete['source'] ?? 'Any' }}
Destination: {{ $ruleToDelete['dest'] ?? 'Any' }}
@endif {{-- Alias Form Modal --}} @if($showAliasForm)

{{ $editingAliasName ? 'Edit' : 'Create' }} IP Alias

@error('aliasName') {{ $message }} @enderror
@error('aliasCidr') {{ $message }} @enderror
@endif {{-- Delete Alias Modal --}} @if($showDeleteAliasModal && $deletingAliasName)

Delete IP Alias

Delete alias "{{ $deletingAliasName }}"?

This may affect firewall rules using this alias.

@endif {{-- IPSet Form Modal --}} @if($showIPSetForm)

Create IP Set

@error('ipsetName') {{ $message }} @enderror

After creating the IPSet, you can add IP addresses and CIDR ranges to it.

@endif {{-- Delete IPSet Modal --}} @if($showDeleteIPSetModal && $deletingIPSetName)

Delete IP Set

Delete IPSet "{{ $deletingIPSetName }}"?

All members will be removed and rules using this IPSet may be affected.

@endif {{-- IPSet Member Form Modal --}} @if($showIPSetMemberForm && $selectedIPSetName)

Add IP/CIDR to {{ $selectedIPSetName }}

@error('memberCidr') {{ $message }} @enderror
@endif {{-- Delete IPSet Member Modal --}} @if($showDeleteIPSetMemberModal && $deletingMemberCidr)

Remove Member

Remove "{{ $deletingMemberCidr }}" from {{ $selectedIPSetName }}?

@endif
@script @endscript