Bug 1935261

Summary: [RFE] Enable connecting to WiFI and VPN connections at the GDM login
Product: Red Hat Enterprise Linux 8 Reporter: Phil Jasbutis <pjasbuti>
Component: gnome-shellAssignee: Florian Müllner <fmuellner>
Status: CLOSED ERRATA QA Contact: Michael Boisvert <mboisver>
Severity: medium Docs Contact: Marek Suchánek <msuchane>
Priority: medium    
Version: 8.3CC: fmuellner, hdegoede, jadahl, mboisver, mclasen, sbarcomb, tpelka, tpopela, tscherf
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gdm-40.0-3.el8, gnome-shell-3.32.2-32.el8 Doc Type: Enhancement
Doc Text:
.You can now connect to network at the login screen With this update, you can now connect to your network and configure certain network options at the GNOME Display Manager (GDM) login screen. As a result, you can log in as an enterprise user whose home directory is stored on a remote server. The login screen supports the following network options: * Wired network * Wireless network, including networks protected by a password * Virtual Private Network (VPN) The login screen cannot open windows for additional network configuration. As a consequence, you cannot use the following network options at the login screen: * Networks that open a captive portal * Modem connections * Wireless networks with enterprise WPA or WPA2 encryption that have not been preconfigured The network options at the login screen are disabled by default. To enable the network settings, use the following procedure: . Create the `/etc/polkit-1/rules.d/org.gnome.gdm.rules` file with the following content: + ---- polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.NetworkManager.network-control" && subject.user == "gdm") { return polkit.Result.YES; } return polkit.Result.NOT_HANDLED; }); ---- . Restart GDM: + ---- # systemctl restart gdm ---- + WARNING: Restarting GDM terminates all your graphical user sessions. . At the login screen, access the network settings in the menu on the right side of the top panel.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:34:12 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Phil Jasbutis 2021-03-04 15:02:14 UTC
3. What is the nature and description of the request?

- RHEL Workstation running outside enterprise network where auth server and NFS share (for userhomes) are located
- Setting up network and VPN connection (PKI/OTP/RSA) prior login is required to prevent local data or authentication source


4. Why does the customer need this? (List the business requirements here)

- Using local user accounts, local passwords and storing local userdata (home directory) is prohibited by enterprise policies
- enable users work with enterprise login from any location where internet connection is available
- fulfill enterprise compliance and security policies


5. How would the customer like to achieve this? (List the functional requirements here)

- on GDM login screen there should be a possibility to activate a predefined network and VPN connection
- in case the connection requires user input for authentication (Wifi-password, RSA, PKI pin, ...) there should be a dialog
- nm-applet on gdm login screen is available and shows system connections but these can't be enabled/disabled


6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

- on GDM, network connections should be allowed to be enabled/disabled.
- when activating a connection that requires user input (password, PKI pin, ...) there should be an input dialog.
- after required network connection is established, login works as from enterprise network


7. Is there already an existing RFE upstream or in Red Hat Bugzilla?

- https://bugzilla.redhat.com/908091


8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

- asap


9. Is the sales team involved in this request and do they have any additional input?

- no


10. List any affected packages or components.

-> gdm, gnome-shell, gnome-session, NetworkManager


11. Would the customer be able to assist in testing this functionality if implemented?

-> yes

Comment 10 Michael Boisvert 2021-06-10 00:02:25 UTC
On gdm-40.0-3.el8 and gnome-shell-3.32.2-31.el8, I still see all networking options greyed out at the GDM login screen. Am I missing something?

Comment 11 Florian Müllner 2021-06-10 00:38:29 UTC
Ray and I agreed to be conservative and not change the default behavior. That's why gdm installs a default polkit rule that disables network-configuration for the gdm user. It can be overriden by something like

/etc/polkit-1/rules.d/org.gnome.gdm.rules:
  polkit.addRule(function(action, subject) {
      if (action.id == "org.freedesktop.NetworkManager.network-control" {
          return polkit.Result.YES;
      }

      return polkit.Result.NOT_HANDLED;
  });

Comment 12 Michael Boisvert 2021-06-10 18:21:48 UTC
Ah okay, I understand now but am still having trouble. 

I created a /etc/polkit-1/rules.d/org.gnome.gdm.rules file with the content you suggested with some additions from the git commit as follows:

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.NetworkManager.network-control" &&
        subject.user == "@GDM_USERNAME@") {
            return polkit.Result.YES;
    }

    return polkit.Result.NOT_HANDLED;
});

After restarting GDM/rebooting, I still don't have the ability to modify networking settings

Comment 13 Michael Boisvert 2021-06-10 18:30:43 UTC
Jumped the gun here. 

Replacing "@GDM_USERNAME@" with just "gdm" allows network configuration. 

So the content of the .rules file should be as follows:

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.NetworkManager.network-control" &&
        subject.user == "gdm") {
            return polkit.Result.YES;
    }

    return polkit.Result.NOT_HANDLED;
});

Comment 14 Florian Müllner 2021-06-10 18:32:25 UTC
(In reply to Michael Boisvert from comment #12)
> Ah okay, I understand now but am still having trouble. 
> 
> I created a /etc/polkit-1/rules.d/org.gnome.gdm.rules file with the content
> you suggested with some additions from the git commit as follows:
> 
> polkit.addRule(function(action, subject) {
>     if (action.id == "org.freedesktop.NetworkManager.network-control" &&
>         subject.user == "@GDM_USERNAME@") {
>             return polkit.Result.YES;
>     }
> 
>     return polkit.Result.NOT_HANDLED;
> });

The file in the git commit is a template, from which the actual rule is generated at build time: @GDM_USERNAME@ is replaced by gdm. The above override literally matches a user called @GDM_USERNAME@, which doesn't exist. It should work oif you replace it with "gdm".

Comment 15 Michael Boisvert 2021-06-10 18:37:34 UTC
(In reply to Florian Müllner from comment #14)
> (In reply to Michael Boisvert from comment #12)
> > Ah okay, I understand now but am still having trouble. 
> > 
> > I created a /etc/polkit-1/rules.d/org.gnome.gdm.rules file with the content
> > you suggested with some additions from the git commit as follows:
> > 
> > polkit.addRule(function(action, subject) {
> >     if (action.id == "org.freedesktop.NetworkManager.network-control" &&
> >         subject.user == "@GDM_USERNAME@") {
> >             return polkit.Result.YES;
> >     }
> > 
> >     return polkit.Result.NOT_HANDLED;
> > });
> 
> The file in the git commit is a template, from which the actual rule is
> generated at build time: @GDM_USERNAME@ is replaced by gdm. The above
> override literally matches a user called @GDM_USERNAME@, which doesn't
> exist. It should work oif you replace it with "gdm".

Thanks for the quick reply, I ended up figuring it out.

Comment 16 Michael Boisvert 2021-06-10 19:57:17 UTC
The next hurdle is that you cannot connect to a VPN. When attempting to connect to a VPN at the login screen, the popup where you input your pin/token never arrives. I imagine its blocked in some way. It is possible to disconnect from the VPN and adjust all WiFi settings though.

Comment 17 Florian Müllner 2021-06-10 21:39:39 UTC
Ah yes, I missed that we disable the component that is responsible for handling network secrets on the login screen. It should work now in gnome-shell-3.32.2-32.el8.

Comment 18 Michael Boisvert 2021-06-11 14:01:16 UTC
Using gdm-40.0-3.el8, gnome-shell-3.32.2-32.el8 and the polkit rule mentioned earlier, you can fully configure your networking needs at the gdm login screen.

Comment 28 errata-xmlrpc 2021-11-09 19:34:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: GNOME security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4381