diff --git a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
index 09d09a8d..7d370668 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
@@ -79,6 +79,10 @@ overview of their function and contents.
For example, ``*.foo.bar`` is supported, while ``*aa.foo.bar``
is not.

+      -  Limited path control is also possible like. ::
+
+            BB_ALLOWED_NETWORKS = "github.com/your_project bitbucket.org/your_company"
+
-  Mirrors not in the host list are skipped and logged in debug.

-  Attempts to access networks not in the host list cause a failure.
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 5a7a6024..d90d9cc9 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1165,12 +1165,27 @@ def trusted_network(d, url):

network = network.split(':')[0]
network = network.lower()
+    path = path.lower()
+
+    for host_path in trusted_hosts.split(" "):
+        host_path = host_path.lower()
+        is_trusted = False
+        split_data = host_path.split("/", 1)
+        host = split_data[0]
+        trusted_path = None
+        if len(split_data) == 2:
+            trusted_path = "/" + split_data[1]

-    for host in trusted_hosts.split(" "):
-        host = host.lower()
if host.startswith("*.") and ("." + network).endswith(host[1:]):
-            return True
-        if host == network:
+            is_trusted = True
+        elif host == network:
+            is_trusted = True
+
+        if trusted_path and is_trusted:
+            if not path.startswith(trusted_path):
+                is_trusted = False
+
+        if is_trusted:
return True

return False
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index f3890321..3fbe7a01 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -1323,6 +1323,18 @@ class TrustedNetworksTest(FetcherTest):
self.d.setVar("BB_ALLOWED_NETWORKS", "server1.org server2.org server3.org")
self.assertFalse(bb.fetch.trusted_network(self.d, url))

+    def test_trusted_network_path(self):
+        # Ensure trusted_network returns true when the host and path IS in the list.
+        url = "git://Someserver.org/RightPath/foo;rev=1;branch=master"
+        self.d.setVar("BB_ALLOWED_NETWORKS", "server1.org *.someserver.org/rightpath server2.org")
+        self.assertTrue(bb.fetch.trusted_network(self.d, url))
+
+    def test_untrusted_network_path(self):
+        # Ensure trusted_network returns False when the host is in list but the path is wrong.
+        url = "git://Someserver.org/WrongPath/foo;rev=1;branch=master"
+        self.d.setVar("BB_ALLOWED_NETWORKS", "server1.org *.someserver.org/rightpath server2.org")
+        self.assertFalse(bb.fetch.trusted_network(self.d, url))
+
class URLHandle(unittest.TestCase):

datatable = {
