@@ -29,6 +29,8 @@ tasks feasible.
2929 - [ network_address_aliases_update] ( #user-content-network_address_aliases_update ) - Update a address aliaes. Returns newest result
3030 - [ network_address_aliases_delete] ( #user-content-network_address_aliases_delete ) - delete a address aliaes. Returns newest result
3131 - [ filter_rules_get] ( #user-content-filter_rules_get ) - Returns firewall filters.
32+ - [ filter_rules_create] ( #user-content-filter_rules_create ) - Creates firewall filters.
33+ - [ filter_rules_delete] ( #user-content-filter_rules_delete ) - Deletes firewall filters.
3234
3335
3436## Approach
@@ -977,13 +979,13 @@ curl \
977979 - HTTP: **POST**
978980 - Params: none
979981 - Request body: json
980- - **name** :<string> name of aliases
981- - **type** :<string> type of aliases. **MUST** be ` network` for now.
982- - **cidr_addresses** : < list of <object> > name alias what
982+ - **name** :< string > name of aliases
983+ - **type** :< string > type of aliases. **MUST** be ` network` for now.
984+ - **cidr_addresses** : < list of < object > > name alias what
983985 - **address** an ip address or a network prefix.
984986 - **details** a description of this address. for human readable documentation.
985- - **descr** : <string> the description of current aliases.
986- - Response: json <object>: the items after created
987+ - **descr** : < string > the description of current aliases.
988+ - Response: json < object >: the items after created
987989
988990*Example Request*
989991` ` ` bash
@@ -1030,13 +1032,13 @@ curl \
10301032 - HTTP: **POST**
10311033 - Params: none
10321034 - Request body: json
1033- - **name** :<string> name of aliases. identiy which aliases frr modify
1034- - **type** :<string> type of aliases. **MUST** be ` network` for now.
1035- - **cidr_addresses** : < list of <object> > name alias what
1035+ - **name** :< string > name of aliases. identiy which aliases frr modify
1036+ - **type** :< string > type of aliases. **MUST** be ` network` for now.
1037+ - **cidr_addresses** : < list of < object > > name alias what
10361038 - **address** an ip address or a network prefix.
10371039 - **details** a description of this address. for human readable documentation.
1038- - **descr** : <string> the description of current aliases.
1039- - Response: json <object>: the items after created
1040+ - **descr** : < string > the description of current aliases.
1041+ - Response: json < object >: the items after created
10401042
10411043*Example Request*
10421044` ` ` bash
@@ -1083,8 +1085,8 @@ curl \
10831085 - HTTP: **POST**
10841086 - Params: none
10851087 - Request body: json
1086- - **name** :<string> name of aliases. identiy which aliase to delete
1087- - Response: json <object>: the items after created
1088+ - **name** :< string > name of aliases. identiy which aliase to delete
1089+ - Response: json < object >: the items after created
10881090
10891091*Example Request*
10901092` ` ` bash
@@ -1210,6 +1212,68 @@ curl \
12101212 }
12111213}
12121214` ` `
1215+ ---
1216+ ### filter_rules_create
1217+ - Creates firewall filters
1218+ - HTTP: **POST**
1219+ - Params: none
1220+ - Request body: json
1221+ - **position**: < int >: insert to which position.
1222+ - **rule**: < object >: what is the rule.
1223+ - **type** :< string > : Type of filter. could take value: pass / block / reject
1224+ - **ipprotocol**: < string >: Which network type? could take value: inet / inet6 / inet46
1225+ - **protocol**: < string >: if seted. could only take value: tcp. used for port match.
1226+ - **descr** : < string > : Used for description.
1227+ - **interface**: < string >: To which interface. e.g. WAN
1228+ - **source**: < object > : match source item.
1229+ - ` {" any" : " " }` : matchs any address.
1230+ - ` {" address" : " network_address_aliases" }` : matchs any network_address_aliases.
1231+ - ` {" address" : " 1.2.3.4" }` : matchs address 1.2.3.4
1232+ - ` {" any" : " " , " port" : " 443-1000" }` : matchs 443 to 1000 port. uses with protocol
1233+ - **destination**: < object >: match description. -- same as above.
1234+ - Response: json < object >: the items after created
1235+
1236+ *Test it carefully before going to wild please. USE AT YOUR OWN RISK*
1237+
1238+ *Example Request*
1239+ ` ` ` bash
1240+ curl \
1241+ - X POST \
1242+ -- silent \
1243+ -- insecure \
1244+ -- header " fauxapi-auth: <auth-value>" \
1245+ -- data ' {"position": 1, "rule": {"type": "reject", "ipprotocol": "inet", "descr": "testobject", "interface": "wan", "source": {"any": ""}, "destination": {"address": "1.2.3.4"}}}' \
1246+ " https://<host-address>/fauxapi/v1/?action=filter_rules_create"
1247+ ` ` `
1248+ *Example Response*
1249+ Same As [filter_rules_get](#user-content-filter_rules_get)
1250+
1251+ ---
1252+ ### filter_rules_delete
1253+ - Returns firewall filters.
1254+ - HTTP: **POST**
1255+ - Params: none
1256+ - Request body: json
1257+ - **position**: <int>: deletes which position.
1258+
1259+ *Test it carefully before going to wild please. USE AT YOUR OWN RISK*
1260+
1261+ Because there's nothing like Unique ID or name in rule. Currently we could only take the position to identify which rule shell be deleted.
1262+
1263+ *Example Request*
1264+ ` ` ` bash
1265+ curl \
1266+ - X POST \
1267+ -- silent \
1268+ -- insecure \
1269+ -- header " fauxapi-auth: <auth-value>" \
1270+ -- data ' {"position": 1}' \
1271+ " https://<host-address>/fauxapi/v1/?action=filter_rules_delete"
1272+ ` ` `
1273+
1274+ *Example Response*
1275+ Same As [filter_rules_get](#user-content-filter_rules_get)
1276+
12131277---
12141278
12151279## Versions and Testing
0 commit comments