Question: I want to try and configure a Filter in Envoy Proxy to block ingress and egress to the service based on some IP's, hostname, routing table, etc.

I have searched for the documentation and see it's possible. But didn't get any examples, of its usage. 

Can someone point out some example of how It can be done?

* One configuration example is present on this page:
<https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/rbac/v2alpha/rbac.proto>

	+ But this is for a service account, like in Kubernetes.
* The closest to what I want, I can see here in this page:
<https://www.envoyproxy.io/docs/envoy/latest/configuration/network_filters/rbac_filter#statistics>  

	+ Mentioned as, *"The filter supports configuration with either a safe-list (ALLOW) or block-list (DENY) set of policies based on properties of the connection (IPs, ports, SSL subject)."*
	+ But it doesn't show how to do it.

I have figured out something like this:

```
network_filters:
   - name: service-access
     config: 
        rules: 
           action: ALLOW
           policies:
             "service-access":
                 principals:
                    source_ip: 192.168.135.211
                 permissions:
                    - destination_ip: 0.0.0.0
                    - destination_port: 443

```

**But I am not able to apply this network filter. All the configurations give me configuration error.**

Answer: 
```
ionic cordova platform add browser

```

and then

```
ionic cordova run browser

```

I had to run the 2nd command. With the first command, As it didn't build for me after first command. After this, it worked.
I'm using sqlite whit angular 6 and ionic v4 too, I think the way you are returning all the object of the db is some dirty, you would execute all the interactions whit the db on the service and return only the results.

```
import { Injectable } from '@angular/core';
import { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';

@Injectable()
export class SQLiteService {

  constructor(
    private sqlite: SQLite
  ) {}

  rawQuery(queryText: string, params?: any[]): any {
    return new Promise((resolve, reject) => {
      this.sqlite.create({name: 'data.db', location: 'default'}).then((db: SQLiteObject) => {
        db.executeSql(queryText, params || []).then((data) => {
          resolve(data);
        }).catch(error => reject(error));
      }).catch(error => reject(error));
    });
  }
}

```