diff --git a/extensions/Servers/Proxmox/views/firewall.blade.php b/extensions/Servers/Proxmox/views/firewall.blade.php index e69de29bb..894254547 100644 --- a/extensions/Servers/Proxmox/views/firewall.blade.php +++ b/extensions/Servers/Proxmox/views/firewall.blade.php @@ -0,0 +1,1352 @@ + + @if(!$status) + + Unable to Load Server Status +

Could not retrieve status from hypervisor:

+ + + Retry + +
+ @else + + {{-- Global Loader Styles --}} + + +
+ + {{-- Page Header --}} +
+ + + +

+ The Firewall Management interface provides comprehensive control over your virtual machine's network security, including rule-based filtering, IP aliases, and security policies. +

+
+

Firewall Rules: Create granular rules to allow or block specific traffic patterns.

+

IP Aliases: Define named groups of IP addresses for easier rule management.

+

IP Sets: Manage collections of IP addresses for advanced filtering.

+

Security Logs: Monitor firewall activity and blocked attempts.

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

{{ $error }}

+ + + Close + + +
+ @endif + + {{-- Master Firewall Control --}} +
+
+
+ +

Master Firewall Control

+
+ + @if($status->status === 'running') + + Running + @else + + Stopped + @endif + +
+ +
+
+
+ +
+
+

Firewall Status

+

+ @if($firewallEnabled) + + + + + + Active - Your VM is protected + + @else + + + Disabled - No firewall protection + + @endif +

+
+
+
+
+ + {{ $firewallEnabled ? 'Enabled' : 'Disabled' }} + + +
+ + + {{ $firewallEnabled ? 'Disabling...' : 'Enabling...' }} + +
+
+
+ + @if($firewallEnabled) + {{-- Firewall Configuration --}} +
+ + {{-- Default Policies --}} +
+
+ +

Default Policies

+
+ +
+ + + + + + + + + + + + + + Update Policies + Updating... + +
+
+ + {{-- Network Adapters --}} +
+
+ +

Network Adapters

+
+ +
+ @if(count($networkAdapters) > 0) +
+ @foreach($networkAdapters as $adapter) +
+
+
+ {{ $adapter['name'] }} + + {{ ($adapterFirewallStates[$adapter['name']] ?? false) ? 'Active' : 'Off' }} + +
+
+ {{ ucfirst($adapter['model'] ?? 'Unknown') }} + @if($adapter['mac']) + {{ $adapter['mac'] }} + @endif +
+
+
+ + {{ ($adapterFirewallStates[$adapter['name']] ?? false) ? 'On' : 'Off' }} + + + + + +
+
+ @endforeach +
+ @else + + @endif +
+
+
+ + {{-- Firewall Management Tabs --}} +
+
+ + + + + +
+ +
+ {{-- RULES TAB --}} +
+
+

Firewall Rules

+ +
+ + @if(count($rules) > 0) +
+ + + + + + + + + + + + + + + + + @foreach($rules as $index => $rule) + + + + + + + + + + + + + @endforeach + +
OrderPosActionDirectionSourceDestinationProtocolPortsStatusActions
+
+ @if($index > 0) + + @else +
+ @endif + @if($index < count($rules) - 1) + + @else +
+ @endif +
+
{{ $rule['pos'] }} + + {{ $rule['action'] }} + + {{ $rule['direction'] ?? 'IN' }}{{ $rule['source'] ?? '-' }}{{ $rule['dest'] ?? '-' }}{{ $rule['proto'] ?? '-' }}{{ $rule['dport'] ?? $rule['sport'] ?? '-' }} + + @if($rule['enable']) + + Enabled + @else + Disabled + @endif + + +
+ + + +
+
+
+ @else + + + + Add Rule + + + + @endif +
+ + {{-- ALIASES TAB --}} +
+
+

IP Aliases

+ +
+ + @if(count($aliases) > 0) +
+ @foreach($aliases as $alias) +
+
+
+

{{ $alias['name'] }}

+

{{ $alias['comment'] ?? 'No description' }}

+
+
+ + +
+
+
+ @if($alias['cidr']) + @foreach(explode(',', $alias['cidr']) as $cidr) +
+ + {{ trim($cidr) }} +
+ @endforeach + @endif +
+
+ @endforeach +
+ @else + + + + Add Alias + + + + @endif +
+ + {{-- IPSETS TAB --}} +
+
+

IP Sets

+ +
+ + @if(count($ipsets) > 0) +
+ @foreach($ipsets as $ipset) +
+
+
+

{{ $ipset['name'] }}

+

{{ $ipset['comment'] ?? 'No description' }}

+
+
+ + +
+
+
+
+ Addresses: + {{ count($ipset['cidr'] ?? []) }} +
+ @if(isset($ipset['cidr']) && count($ipset['cidr']) > 0) +
+ @foreach(array_slice($ipset['cidr'], 0, 5) as $cidr) + {{ $cidr }} + @endforeach + @if(count($ipset['cidr']) > 5) +

... and {{ count($ipset['cidr']) - 5 }} more

+ @endif +
+ @endif +
+
+ @endforeach +
+ @else + + + + Add IP Set + + + + @endif +
+ + {{-- LOGS TAB --}} +
+
+

Firewall Logs

+
+ + Refresh + + + Clear Logs + +
+
+ + @if(count($firewallLogs) > 0) +
+ @foreach($firewallLogs as $log) +
+
+
+ + {{ $log['action'] }} + + {{ $log['time'] }} +
+ {{ $log['interface'] ?? 'N/A' }} +
+
+
+ Source +
{{ $log['src'] ?? 'N/A' }}
+
+
+ Destination +
{{ $log['dst'] ?? 'N/A' }}
+
+
+ Protocol +
{{ $log['proto'] ?? 'N/A' }}
+
+
+ Port +
{{ $log['dport'] ?? $log['sport'] ?? 'N/A' }}
+
+
+
+ @endforeach +
+ @else + + @endif +
+ + {{-- SAVED CONFIGURATIONS TAB --}} +
+
+

Saved Configurations

+ + Save Current Config + +
+ + @if(count($savedConfigurations) > 0) +
+ @foreach($savedConfigurations as $config) +
+
+
+

{{ $config['name'] ?? 'Configuration ' . $config['id'] }}

+

{{ $config['description'] ?? 'No description' }}

+

{{ $config['created_at'] }}

+
+
+ + +
+
+
+
Rules: {{ $config['rules_count'] ?? 0 }}
+
Aliases: {{ $config['aliases_count'] ?? 0 }}
+
IP Sets: {{ $config['ipsets_count'] ?? 0 }}
+
+
+ @endforeach +
+ @else + + + + Save Current Config + + + + @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. +
  3. Set Policy Out to DROP (if restricting outbound)
  4. +
  5. Create explicit ACCEPT rules for allowed traffic
  6. +
  7. Everything not explicitly allowed will be blocked
  8. +
+
+ +
+

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 + + {{-- 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' }}
+
+
+
+
+ + Cancel + + + Delete Rule + Deleting... + +
+
+
+ @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.

+
+
+
+ + Cancel + + + Delete + Deleting... + +
+
+
+ @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.

+
+
+
+ + Cancel + + + Delete + Deleting... + +
+
+
+ @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 }}?

+
+
+
+ + Cancel + + + Remove + Removing... + +
+
+
+ @endif + + {{-- Save Configuration Modal --}} + @if($showSaveConfigModal) +
+
+ +
+
+ +
+
+

Save Current Configuration

+

Save your current firewall rules and policies as a reusable configuration

+
+
+ +
+
+ + + @error('newConfigName') +

{{ $message }}

+ @enderror +
+ +
+

Configuration Summary

+
+
+ Rules + {{ count($rules) }} +
+
+ Incoming Policy + {{ $policyIn }} +
+
+ Outgoing Policy + {{ $policyOut }} +
+
+
+
+ +
+ + +
+
+
+ @endif + +
+ + @endif +
\ No newline at end of file