Page MenuHomeDevCentral

Create an ops group with full sudo capability
ClosedPublic

Authored by dereckson on Oct 19 2017, 16:47.
Tags
None
Referenced Files
F2849241: D1067.id2873.diff
Thu, Apr 25, 02:48
Unknown Object (File)
Wed, Apr 24, 11:30
Unknown Object (File)
Wed, Apr 24, 08:59
Unknown Object (File)
Tue, Apr 23, 06:48
Unknown Object (File)
Tue, Apr 23, 01:07
Unknown Object (File)
Sun, Apr 21, 22:07
Unknown Object (File)
Sun, Apr 21, 09:24
Unknown Object (File)
Fri, Apr 19, 19:11
Subscribers
None

Details

Summary

The 'ops' group contains operations squad members with root access
to Eglide or the Docker engine (dereckson, sandlayth).

The GID is keep in sync with Woods Cloud groups configuration.

This will allow to drop the kludge to restore a wheel group,
and avoid to fight OS like Debian who want to manage such gid=0 group.

Ref T1034.

Test Plan

sudo whoami

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Oct 19 2017, 21:46

@Sandlayth As Salt master isn't available, could you put the roles/core/sudo/files/ops file in /etc/sudoers.d/ops
+ add the following line:

%wheel ALL = (ALL) NOPASSWD: ALL

I'll then do the deployment through salt-call.

Now we've a correct state

Salt master
$ salt eglide state.apply roles/shellserver/users

----------                                                                                                                                                     
          ID: group_ops                                                                 
    Function: group.present                                                                                                                                    
        Name: ops                                                                                                                                            
      Result: True                                                                                                                                             
     Comment: New group ops created                                                                                                                            
     Started: 00:56:24.790152                                                                                                                                
    Duration: 835.725 ms                                                                    
     Changes:                                                                               
              ----------                                                                                                                                     
              gid:                                                                                                                                           
                  3001                                                            
              members:                                                                                                                                       
                  - dereckson                                                                                                                                
                  - sandlayth                                                                                                                                  
              name:                                                                                                                                          
                  ops                                                                       
              passwd:                                                                                                                                        
                  x                       

$ salt eglide state.apply roles/core/sudo
eglide:
----------
          ID: /etc/sudoers.d/ops
    Function: file.managed
      Result: True
     Comment: File /etc/sudoers.d/ops updated
     Started: 01:27:44.142002
    Duration: 217.149 ms
     Changes:   
              ----------
              diff:
                  New file
              mode:
                  0644

Summary for eglide
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
Total run time: 217.149 ms
Eglide
$ id
uid=5001(dereckson) gid=5001(dereckson) groups=5001(dereckson),0(wheel),200(shell),828(deployment),829(nasqueron-irc),3001(ops)
$ sudo whoami
root
$ sudo salt-call --local test.ping
local:
    True
This revision was automatically updated to reflect the committed changes.