-
Notifications
You must be signed in to change notification settings - Fork 60
New API for network rules #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e9b5756 to
e27c740
Compare
901bde5 to
80332b2
Compare
network_address_aliases_get
---
- Returns address aliaes used by rules.
- HTTP: **GET**
- Params: none
*Example Request*
```bash
curl \
-X GET \
--silent \
--insecure \
--header "fauxapi-auth: <auth-value>" \
"https://<host-address>/fauxapi/v1/?action=network_address_aliases_get"
```
*Example Response*
```javascript
{
"callid": "5e205fc052956",
"action": "network_address_aliases_get",
"message": "ok",
"data": {
"aliases": {
"alias": [
{
"name": "EasyRuleBlockHostsWAN",
"type": "network",
"address": "1.2.3.4/32 5.6.7.8/32",
"descr": "Hosts blocked from Firewall Log view",
"detail": "Entry added Fri, 27 Dec 2019 00:53:01 -0800||\u5df2\u6dfb\u52a0\u6761\u76ee Thu, 16 Jan 2020 03:42:37 -0800"
}
]
}
}
}
```
filter_rules_get
---
- Returns address aliaes used by rules.
- HTTP: **GET**
- Params: none
*Example Request*
```bash
curl \
-X GET \
--silent \
--insecure \
--header "fauxapi-auth: <auth-value>" \
"https://<host-address>/fauxapi/v1/?action=filter_rules_get"
```
*Example Response*
```javascript
{
"callid": "5e2060797a602",
"action": "filter_rules_get",
"message": "ok",
"data": {
"filter": {
"rules": [
{
"id": "",
"tracker": "1579178400",
"type": "pass",
"interface": "wan",
"ipprotocol": "inet",
"tag": "",
"tagged": "",
"max": "",
"max-src-nodes": "",
"max-src-conn": "",
"max-src-states": "",
"statetimeout": "",
"statetype": "keep state",
"os": "",
"protocol": "tcp",
"source": {
"address": "1.2.1.1"
},
"destination": {
"any": "",
"port": "1-65535"
},
"descr": "",
"updated": {
"time": "1579178400",
"username": "[email protected] (Local Database)"
},
"created": {
"time": "1579178400",
"username": "[email protected] (Local Database)"
}
},
{
"type": "block",
"interface": "wan",
"ipprotocol": "inet",
"source": {
"address": "EasyRuleBlockHostsWAN"
},
"destination": {
"any": ""
},
"descr": "Easy Rule: Blocked from Firewall Log View",
"created": {
"time": "1577436781",
"username": "Easy Rule"
},
"tracker": "1577436781"
},
{
"type": "drop",
"ipprotocol": "inet",
"descr": "Default allow LAN to any rule",
"interface": "lan",
"source": {
"network": "lan"
},
"destination": {
"ip": "192.10.1.1"
}
}
]
}
}
}
```
Signed-off-by: lilinzhe <[email protected]>
Signed-off-by: lilinzhe <[email protected]>
Signed-off-by: lilinzhe <[email protected]>
Signed-off-by: lilinzhe <[email protected]>
Signed-off-by: lilinzhe <[email protected]>
80332b2 to
8367013
Compare
|
would it be possible to merge this as its exactly what I am currently looking for ! |
|
Hi, @Korvuss You may want to review issues #56 . Thanks. |
|
Hi @slayercat pardon the long delay in my getting to this. The code is well written, but you are re-declaring the namespace in an unexpected location This is messy and almost looks as if it is an accidental piece of code that has crept in at development time Also - can you propose some tests for this? I'll add them to the Python client interface examples that get used in the test harness |
GETnetwork_address_aliases_get - Returns address aliaes used by rules.POSTnetwork_address_aliases_create - Creates An network aliaes for rulesPOSTnetwork_address_aliases_update - Update a address aliaes. Returns newest resultPOSTnetwork_address_aliases_delete - Delete a address aliaes. Returns newest resultGETfilter_rules_get - Returns firewall filters.POSTfilter_rules_create - Creates firewall filters.POSTfilter_rules_delete - Deletes firewall filters.Closes #50
Signed-off-by: lilinzhe [email protected]