Recent Posts

Pages: 1 ... 8 9 [10]
91
Dev Stuff / Canned Perl based Dashboard JSON XHR Request Data Responses
« Last post by razwall on November 20, 2024, 12:44:56 PM »
[code]#!/usr/bin/perl -W

#print "Content-Type: Text/HTML\n\n";

if ($ENV{'REQUEST_METHOD'} eq 'GET') {
      $in = $ENV{'QUERY_STRING'};
}
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
$in = <STDIN>;
}

@in = split(/&/, $in);
foreach(@in) {
($k,$v) = split(/=/,$_);
$k =~ tr/+/ /;
$k =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$k =~ s/\+/ /g;
$v =~ tr/+/ /;
$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$v =~ s/\+/ /g;
#$v =~ s///g;
${$k} = $v;
#print "$k = $v\n";
}

print "Content-Type: application/json\n\n";


if($plugin eq  "hardware") {
print qq~
{"cached": false, "time": 1731600469.0089741, "storage": [{"USAGE": "3", "TOTAL": "15993 MB", "NAME": "Memory", "KEY":
"memory"}, {"USAGE": "0", "TOTAL": "15991 MB", "NAME": "Swap", "KEY": "swap"}, {"USAGE": "19", "TOTAL": "4.8G", "NAME":
"Main disk", "KEY": "df-root"}, {"USAGE": "16", "TOTAL": "117.8G", "NAME": "Data disk", "KEY": "df-var"}, {"USAGE": "8",
"TOTAL": "120M", "NAME": "Configuration disk", "KEY": "df-var/efw"}, {"USAGE": "5", "TOTAL": "78.5G", "NAME": "Log disk",
"KEY": "df-var/log"}], "cpustat": {"global": {"system": 487798, "cpu_id": "global", "idle": 197231268, "user": 1720558,
"total": 199439624, "nice": 0}, "1": {"system": 59522, "cpu_id": "1", "idle": 24677804, "user": 204225, "total": 24941551,
"nice": 0}, "0": {"system": 58756, "cpu_id": "0", "idle": 24606690, "user": 241307, "total": 24906753, "nice": 0}, "3":
{"system": 58025, "cpu_id": "3", "idle": 24693697, "user": 187583, "total": 24939305, "nice": 0}, "2": {"system": 60161,
"cpu_id": "2", "idle": 24660268, "user": 205603, "total": 24926032, "nice": 0}, "5": {"system": 65200, "cpu_id": "5",
"idle": 24647361, "user": 210924, "total": 24923485, "nice": 0}, "4": {"system": 65501, "cpu_id": "4", "idle": 24638473,
"user": 232284, "total": 24936258, "nice": 0}, "7": {"system": 59403, "cpu_id": "7", "idle": 24656967, "user": 200100,
"total": 24916470, "nice": 0}, "6": {"system": 61230, "cpu_id": "6", "idle": 24650008, "user": 238532, "total": 24949770,
"nice": 0}}}
~;
}

if($plugin eq "uplinks") {
print qq~
{"cacheHitAt": 1731600455.4530821, "cachedOn": 1731600454.6696789, "time": 1731600454.66975, "uplinks": [{"status":
"ACTIVE", "defaultGatewayTimestamp": 1731349117.8499999, "managed": "on", "shouldBeUp": true, "canStart": true,
"isLinkAlive": true, "data": {"name": "'Main uplink'", "ip": "x.x.x.x", "last_retry": "", "interface": "eth3", "type":
"STATIC", "gateway": "x.x.x.x"}, "defaultGateway": true, "uptime": "2d 21h 50m 14s", "name": "main", "isLinkActive":
true, "enabled": "on", "autostart": "on", "hasChanged": true}, {"status": "ACTIVE", "defaultGatewayTimestamp": -1,
"managed": "on", "shouldBeUp": true, "canStart": true, "isLinkAlive": true, "data": {"name": "'ITD WAN'", "ip":
"X.x.x.x", "last_retry": "", "interface": "eth2", "type": "DHCP", "gateway": "x.x.x.x"}, "defaultGateway": false,
"uptime": "2d 21h 49m 37s", "name": "uplink1", "isLinkActive": true, "enabled": "on", "autostart": "on", "hasChanged":
true}], "cached": true}
~;
}

if($plugin eq "service") {
print qq~
{"cacheHitAt": 1731600439.1212721, "tail-smtp/connections-virus": {"value": 0.0}, "tail-smtp/connections-spam": {"value":
0.0}, "tail-pop/connections-virus": {"value": 0.0}, "tail-smtp/connections-noqueue": {"value": 0.0},
"tail-http/connections-denied": {}, "cached": true, "tail-pop/connections-scanned": {"value": 0.0},
"tail-smtp/connections-clean": {"value": 0.0}, "time": 1731600436.315294, "tail-smtp/connections-incoming": {"value": 0.0},
"memory/memory-used": {"value": 521613300.0}, "tail-http/connections-hit": {}, "tail-http/connections-miss": {},
"tail-pop/connections-spam": {"value": 0.0}, "tail-http/connections-virus": {}, "cachedOn": 1731600436.315212,
"filecount-postfix_queue/files": {"value": 0.0}, "tail-smtp/connections-sent": {"value": 0.0}}
~;
}

if($plugin eq "network") {
print qq~
{"cached": false, "interfaces": {"collectd": {"netlink-br1/if_octets": {"rx": 1614897.0, "tx": 2907912.0}, "netlink-br0/if_octets": {"rx": 101043.5, "tx": 2187896.0}, "netlink-eth3/if_octets": {"rx": 5233503.0, "tx": 1751013.0}, "netlink-eth0.600/if_octets": {"rx": 0.0, "tx": 0.0}, "netlink-eth0.1/if_octets": {"rx": 103100.10000000001, "tx": 2187875.0}, "netlink-eth1.200/if_octets": {"rx": 1616984.0, "tx": 2907913.0}, "netlink-eth1.500/if_octets": {"rx": 0.0, "tx": 4781.5600000000004}, "netlink-eth2/if_octets": {"rx": 0.0, "tx": 0.0}, "netlink-eth0.700/if_octets": {"rx": 20.399819999999998, "tx": 248.39779999999999}, "netlink-br2/if_octets": {"rx": 0.0, "tx": 0.0}}, "devices": {"eth2": {"STATUS": "Up", "BRIDGE": false, "CHECKED": "checked", "CLASS": "red", "LINK": "Up", "IN": "", "DEVICE": "eth2", "TYPE": "ethernet", "DISPLAY": "eth2", "OUT": ""}, "eth3": {"STATUS": "Up", "BRIDGE": false, "CHECKED": "checked", "CLASS": "red", "LINK": "Up", "IN": "", "DEVICE": "eth3", "TYPE": "ethernet", "DISPLAY": "eth3", "OUT": ""}, "br2": {"STATUS": "Up", "BRIDGE": true, "CHECKED": "checked", "CLASS": "blue", "LINK": "Up", "IN": "", "DEVICE": "br2", "PHYSICAL": [{"STATUS": "Up", "CHECKED": "", "LINK": "Up", "IN": "", "DEVICE": "eth0.600", "TYPE": "ethernet", "DISPLAY": "eth0_600", "OUT": ""}], "TYPE": "ethernet", "DISPLAY": "br2", "OUT": ""}, "br1": {"STATUS": "Up", "BRIDGE": true, "CHECKED": "checked", "CLASS": "orange", "LINK": "Up", "IN": "", "DEVICE": "br1", "PHYSICAL": [{"STATUS": "Up", "CHECKED": "", "LINK": "Up", "IN": "", "DEVICE": "eth1.200", "TYPE": "ethernet", "DISPLAY": "eth1_200", "OUT": ""}, {"STATUS": "Up", "CHECKED": "", "LINK": "Up", "IN": "", "DEVICE": "eth1.500", "TYPE": "ethernet", "DISPLAY": "eth1_500", "OUT": ""}], "TYPE": "ethernet", "DISPLAY": "br1", "OUT": ""}, "br0": {"STATUS": "Up", "BRIDGE": true, "CHECKED": "checked", "CLASS": "green", "LINK": "Up", "IN": "", "DEVICE": "br0", "PHYSICAL": [{"STATUS": "Up", "CHECKED": "", "LINK": "Up", "IN": "", "DEVICE": "eth0.700", "TYPE": "ethernet", "DISPLAY": "eth0_700", "OUT": ""}, {"STATUS": "Up", "CHECKED": "", "LINK": "Up", "IN": "", "DEVICE": "eth0.1", "TYPE": "ethernet", "DISPLAY": "eth0_1", "OUT": ""}], "TYPE": "ethernet", "DISPLAY": "br0", "OUT": ""}}}, "names": ["collectd", "devices"], "time": 1731969100.4881721}
~;
}

if($plugin eq "system") {
print qq~
{"kernel": 0, "uptime": "2d 21h 49m", "cached": false, "kernel_value": "4.4.145.e7.4", "":
"", "appliance": "RazWall", "version": "1.0.0", "time": 1731600403.7565579}
~;
}

if($plugin eq "signatures") {
print qq~
{"cached": false, "signatures": {"Urlfilter blacklist": "2016.08.30 10:55", "Anti-spyware lists": "2024.11.13 12:17"},
"no_signatures_msg": "No recent signature updates found", "time": 1731600380.9465301}
~;
}



[/code]
92
News / RazWall 1.0 Beta Build
« Last post by razwall on November 20, 2024, 12:07:01 PM »
Here is just a quick update on the fork of EndianCFW to RazWall.

A lot of things are still in the works. I will be cleaning up the files and structures to create the first github upload very soon. I hope people will arrive and assist in this process as things begin to pick up.
Here is the done list:

Dev Unit 1:
Remove EMI and related proprietary code. (remnants remain but are not used)
Replace efw-console I have implemented a very crude Perl based replacement
updated dashboard & overall theme
Added websocket service on Port 4000 on 127.0.0.1
Updated httpd configs and templates for proxy_wstunnel - Web socket gets proxy pass from wss://IP:10443/ws -> ws://127.0.0.1:4000
Step through code and remove all usage and mention of color zones (GREEN,BLUE,ORANGE,RED)
Step through code and replace colored zones with dynamic naming convention
Step through code and convert colored zone rules to named rules (GREEN,BLUE,ORANGE,RED) -> (LAN,WIFI,DMZ,WAN)

Dev unit 2:
Re organize all of the files structures to work primarily out of the /razwall directory
remove all path and mentions of Endian

Here is the to-do list:
[s]Consolidate all the changes from Dev unit 1 and Dev unit 2[/s]
Re-work code to expand the DHCP scopes per naming zones
Add a section to create new rule sets so instead of just LAN,WIFI,DMZ,WAN we can add custom rulesets
Figure out a packaging routine
Figure out how to rework the ISO/USB packer routine/build environment
Figure out new setup/installer scripts/programs

I hope to get some volunteers to work on some of these projects, but i know I need to publish the code first!

Here are a few screenshots of my progress:

Dashboard/Theme, Console (simple for now), Zone Setup
93
General Discussion / RazWall will be an Endian Community Fork
« Last post by razwall on November 15, 2024, 03:49:44 PM »
Welcome to the birth of RazWall!
RazWall will be a open-source fork of the Endian Community Firewall project. While Endian has been a great piece of software it seems to have fallen behind. My goal is to rekindle the excitement Endian once created by removing the proprietary code and replace it with open source adaptations while also providing some much needed upgrades. Once we have some functional code, it will be published for the world to checkout, modify, and commit changes via Githiub. Let's build something great together!

-Bryan King
"The RazWall Guy"
Pages: 1 ... 8 9 [10]