# Secure REST API endpoints of genieacs-nbi

**URL:** <https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093>\
**Category:** Uncategorized\
**Created:** [September 29, 2020, 9:21am UTC](https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093 "2020-09-29T09:21:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravishekhar](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@ravishekhar](https://forum.genieacs.com/u/ravishekhar)\
**Post date:** [September 29, 2020, 9:21am UTC](https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093/1 "2020-09-29T09:21:19Z")

</div>

Is there a way to secure the REST API of geneiacs-nbi server. I’m able to access the following endpoints without any security like basic-auth

- /users
- /config
- /files
- /objects

As per the security guys in my org, this is a vulnerability in the Information disclosure category.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 29, 2020, 4:33pm UTC](https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093/2 "2020-09-29T16:33:45Z")

</div>

You can put a reverse proxy in front of the NBI like nginx or apache.

---

<div class="post-metadata">

**Author:** ![perotta](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@perotta](https://forum.genieacs.com/u/perotta)\
**Post date:** [October 6, 2020, 10:10pm UTC](https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093/3 "2020-10-06T22:10:19Z")

</div>

Yes, it’s for sure a huge security hole if you let the API wide open, but you don’t need an authentication system on the GenieACS NBI service in order to secure it.

You can use a proxy as akcoder suggested but you can also simply use firewall. The purpose of the API is integrate GenieACS to other services of your company, so make sure that only the IP address of those services have access to it.

---

<div class="post-metadata">

**Author:** ![ravishekhar](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@ravishekhar](https://forum.genieacs.com/u/ravishekhar)\
**Post date:** [October 12, 2020, 4:42am UTC](https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093/4 "2020-10-12T04:42:01Z")

</div>

Yes, for now I’ve restricted NBI access using IP Tables.

The argument put forth by security team of my org is that even in private network, information should not be disclosed.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [October 12, 2020, 8:30pm UTC](https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093/5 "2020-10-12T20:30:39Z")

</div>

> [@ravishekhar](#):
>
> even in private network, information should not be disclosed

Agreed. This is why we are doing auth, SSL and firewalls even on our private CPE management network. The number one rule of security is trust no one, especially not equipment that has a connection to the internet.

---

<div class="post-metadata">

**Author:** ![perotta](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@perotta](https://forum.genieacs.com/u/perotta)\
**Post date:** [October 13, 2020, 1:02pm UTC](https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093/6 "2020-10-13T13:02:27Z")

</div>

akcoder your setup is very cool. Security is never too much

On my company, we chose not to have authentication because we use NBI on a very simple way. Instead, 7557 input is closed for everyone, so no one excepts the own machine has full access to it. Then, I wrote a little daemon on the same machine that pulls “tasks” from our private API.

What is cool about our implementation, is that even if someone hacks a priveleged server, like our private API, they won’t have full control over all CPE devices because they can only fire specific tasks and query for specific parameters. And that’s a big part of it.

Not only GenieACS does not have authentication, but doesn’t have any kind of ACL. So this is a very primitive way for us to limit not only WHO can make changes on CPEs but also WHAT KIND of changes they are alllowed to do.

Always be paranoid when it comes to security.

---

<div class="post-metadata">

**Author:** ![markabrahams](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@markabrahams](https://forum.genieacs.com/u/markabrahams)\
**Post date:** [April 4, 2022, 1:47pm UTC](https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093/7 "2022-04-04T13:47:01Z")

</div>

I prefer services that implement their own security, or at least give you an option to do so, over outsourcing their security to some other place.

As such, I’ve created this PR:

> <https://github.com/genieacs/genieacs/pull/374>
>
> This PR provides an HTTP-header-based NBI authentication solution for the securi…ty issue raised in this forum post:
> https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093
> 
> The solution adds an optional configuration parameter "NBI\_AUTHENTICATION\_KEY", which - when present - is required to be present in an "x-api-key" HTTP header of any incoming request. When the "NBI\_AUTHENTICATION\_KEY" configuration parameter is absent, the current behaviour stands i.e. no authentication is required.

to add HTTP header authentication to the GenieACS NBI.

---

<div class="post-metadata">

**Author:** ![whaller](https://avatars.discourse-cdn.com/v4/letter/w/919ad9/32.png) [@whaller](https://forum.genieacs.com/u/whaller)\
**Post date:** [April 26, 2024, 10:24pm UTC](https://forum.genieacs.com/t/secure-rest-api-endpoints-of-genieacs-nbi/1093/8 "2024-04-26T22:24:35Z")

</div>

I’m new to GenieACS and have it up and running with auth enabled for cwmp but am struggling with your PR. currently deployed version v1.2.9+20220822165235 which doesn’t appear to include instructions or your PR. how do I update my deployment to include your nbi-authentication? any guidance on configuring once updated would be appreciated.
