Programmatically build module permission list
You can list all available permissions with PermissionHandler:

$permissions = \Drupal::service('user.permissions')-&gt;getPermissions();


You'll find the module name in the provider property of the permissions:

$permissions_by_provider = [];
foreach ($permissions as $key =&gt; $permission) {
  $permissions_by_provider[$permission['provider']][] = $key;
}