@@ -28,6 +28,8 @@ tasks feasible.
2828 - [ network_address_aliases_update] ( #user-content-network_address_aliases_update ) - Update a address aliaes. Returns newest result
2929 - [ network_address_aliases_delete] ( #user-content-network_address_aliases_delete ) - delete a address aliaes. Returns newest result
3030 - [ filter_rules_get] ( #user-content-filter_rules_get ) - Returns firewall filters.
31+ - [ filter_rules_create] ( #user-content-filter_rules_create ) - Creates firewall filters.
32+ - [ filter_rules_delete] ( #user-content-filter_rules_delete ) - Deletes firewall filters.
3133
3234
3335## Approach
@@ -916,13 +918,13 @@ curl \
916918 - HTTP: **POST**
917919 - Params: none
918920 - Request body: json
919- - **name** :<string> name of aliases
920- - **type** :<string> type of aliases. **MUST** be ` network` for now.
921- - **cidr_addresses** : < list of <object> > name alias what
921+ - **name** :< string > name of aliases
922+ - **type** :< string > type of aliases. **MUST** be ` network` for now.
923+ - **cidr_addresses** : < list of < object > > name alias what
922924 - **address** an ip address or a network prefix.
923925 - **details** a description of this address. for human readable documentation.
924- - **descr** : <string> the description of current aliases.
925- - Response: json <object>: the items after created
926+ - **descr** : < string > the description of current aliases.
927+ - Response: json < object >: the items after created
926928
927929*Example Request*
928930` ` ` bash
@@ -969,13 +971,13 @@ curl \
969971 - HTTP: **POST**
970972 - Params: none
971973 - Request body: json
972- - **name** :<string> name of aliases. identiy which aliases frr modify
973- - **type** :<string> type of aliases. **MUST** be ` network` for now.
974- - **cidr_addresses** : < list of <object> > name alias what
974+ - **name** :< string > name of aliases. identiy which aliases frr modify
975+ - **type** :< string > type of aliases. **MUST** be ` network` for now.
976+ - **cidr_addresses** : < list of < object > > name alias what
975977 - **address** an ip address or a network prefix.
976978 - **details** a description of this address. for human readable documentation.
977- - **descr** : <string> the description of current aliases.
978- - Response: json <object>: the items after created
979+ - **descr** : < string > the description of current aliases.
980+ - Response: json < object >: the items after created
979981
980982*Example Request*
981983` ` ` bash
@@ -1022,8 +1024,8 @@ curl \
10221024 - HTTP: **POST**
10231025 - Params: none
10241026 - Request body: json
1025- - **name** :<string> name of aliases. identiy which aliase to delete
1026- - Response: json <object>: the items after created
1027+ - **name** :< string > name of aliases. identiy which aliase to delete
1028+ - Response: json < object >: the items after created
10271029
10281030*Example Request*
10291031` ` ` bash
@@ -1149,6 +1151,67 @@ curl \
11491151 }
11501152}
11511153` ` `
1154+ ---
1155+ ### filter_rules_create
1156+ - Creates firewall filters
1157+ - HTTP: **POST**
1158+ - Params: none
1159+ - Request body: json
1160+ - **position**: < int >: insert to which position.
1161+ - **rule**: < object >: what is the rule.
1162+ - **type** :< string > : Type of filter. could take value: pass / block / reject
1163+ - **ipprotocol**: < string >: Which network type? could take value: inet / inet6 / inet46
1164+ - **protocol**: < string >: if seted. could only take value: tcp. used for port match.
1165+ - **descr** : < string > : Used for description.
1166+ - **interface**: < string >: To which interface. e.g. WAN
1167+ - **source**: < object > : match source item.
1168+ - ` {" any" : " " }` : matchs any address.
1169+ - ` {" address" : " network_address_aliases" }` : matchs any network_address_aliases.
1170+ - ` {" address" : " 1.2.3.4" }` : matchs address 1.2.3.4
1171+ - ` {" any" : " " , " port" : " 443-443" }: matchs 443 port . uses with protocol
1172+ - ** destination** : < object > : match description. -- same as above.
1173+ - Response: json < object > : the items after created
1174+
1175+ * Test it carefully before going to wild please . USE AT YOUR OWN RISK *
1176+
1177+ * Example Request*
1178+ ` ` ` bash
1179+ curl \
1180+ -X POST \
1181+ --silent \
1182+ --insecure \
1183+ --header "fauxapi-auth: <auth-value>" \
1184+ --data '{"position": 1, "rule": {"type": "reject", "ipprotocol": "inet", "descr": "testobject", "interface": "wan", "source": {"any": ""}, "destination": {"address": "1.2.3.4"}}}' \
1185+ "https://<host-address>/fauxapi/v1/?action=filter_rules_create"
1186+ ` ` `
1187+ * Example Response*
1188+ Same As [filter_rules_get](#user- content- filter_rules_get)
1189+ -- -
1190+ ### filter_rules_delete
1191+ - Returns firewall filters.
1192+ - HTTP : ** POST **
1193+ - Params: none
1194+ - Request body: json
1195+ - ** position** : < int> : deletes which position.
1196+
1197+ * Test it carefully before going to wild please . USE AT YOUR OWN RISK *
1198+
1199+ 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.
1200+
1201+ *Example Request*
1202+ ```bash
1203+ curl \
1204+ -X POST \
1205+ --silent \
1206+ --insecure \
1207+ --header "fauxapi-auth: <auth-value>" \
1208+ --data ' {" position" : 1 }' \
1209+ "https://<host-address>/fauxapi/v1/?action=filter_rules_delete"
1210+ ```
1211+
1212+ *Example Response*
1213+ Same As [filter_rules_get](#user-content-filter_rules_get)
1214+
11521215---
11531216
11541217## Versions and Testing
0 commit comments