summaryrefslogtreecommitdiff
path: root/google_compute_engine
Commit message (Collapse)AuthorAgeFilesLines
* Repo layout changes (#688)Liam Hopkins2018-12-1489-9641/+0
|
* Add unit test coverage for each enablement state. (#708)Max Illfelder2018-12-051-102/+76
|
* Fix logic for enabling OS Login two factor. (#707)Max Illfelder2018-12-054-27/+67
|
* Update keyword argument to UpdateOsLogin function. (#704)Max Illfelder2018-12-042-4/+5
|
* Accounts: separate gpasswd command in two (#699)Lucas Kanashiro2018-12-035-25/+36
| | | | | | | | * Accounts: separate gpasswd command in two Specify different commands to add and remove users from a group. In FreeBSD, the flags used by pw utility are not the same used by gpasswd.
* Update two factor enablement on change.Max Illfelder2018-12-032-41/+62
| | | | | Call activate when two factor enablement changes and OS Login enablement remains unchanged.
* Fix the default gpasswd_cmd in the config file. (#696)Max Illfelder2018-11-301-1/+1
| | | The gpasswd command takes in an optional argument.
* Two-factor updates: OS Login control file and metadata watcher (#684)Liam Hopkins2018-11-124-17/+114
| | | | | | | | * Allow system accounts to skip two-factor auth * Refactor control file, add two-factor support * Update account watcher to support two-factor
* Read gpasswd_cmd from config file (#658)Lucas Kanashiro2018-11-013-7/+11
| | | | | | | | | | * Read gpasswd_cmd from config file With this we can configure the specific FreeBSD command to remove an user from a group enabling the sudoers removal feature in it. * Add gpasswd_cmd to README and config file generation
* google_compute_engine: Add Fedora support to compat module (#681)Neal Gompa (ニール・ゴンパ)2018-10-302-0/+4
| | | | | | For all intents and purposes, we can pretend Fedora works like Enterprise Linux 7 systems, such as Red Hat Enterprise Linux and CentOS. Signed-off-by: Neal Gompa <ngompa13@gmail.com>
* Add prefix 'google' to scripts inside 'scripts' dir (#672)Lucas Kanashiro2018-10-262-4/+4
| | | | The scripts inside 'scripts' directory have general names that makes difficult identify from which package they belong to.
* Improvements to resolved deprecation warnings. (#678)2faMax Illfelder2018-10-2411-33/+39
| | | | | | | - Create backwards compatible parser. - Move off of deprecated methods. - Fixing PyPI build errors. - Fix linter warnings. - Fix the flake8 linter to prevent contradictory linter warnings.
* Fix testing for the UpdateSudoer method. (#677)Max Illfelder2018-10-231-8/+21
|
* Update sudoer group separate from local groups. (#675)Max Illfelder2018-10-232-24/+50
| | | | Updating a user should not override local changes to group membership beyond member in the google-sudoers group.
* Remove users from the sudoers group on removal. (#671)Max Illfelder2018-10-182-8/+70
| | | | | | | Roll forward of #656 with additional logic to prevent breaking users. This reverts commit 5f87ca2353953daf0b9ca2f9d8c2b512cfd146a2. Update user groups regardless of existence.
* Revert "Remove users from the sudoers group on removal. (#656)" (#664)Max Illfelder2018-10-112-63/+4
| | | This reverts commit 41863c9b89f1e02b5866ab263124df59b327380d.
* Remove users from the sudoers group on removal. (#656)Max Illfelder2018-09-212-4/+63
| | | | This prevents the local user account from having elevated privileges when used by OS Login.
* Remove gsutil dependency (#637)Gustavo Serra Scalet2018-09-204-85/+186
|
* Travis CI: Add Python 3.7 to the testing (#648)cclauss2018-08-291-3/+4
| | | | | | * Travis CI: Add Python 3.7 to the testing * Add Python 3.7 trove classifier to setup.py
* Fix OSLOGIN_NSS_CACHE for FreeBSD (#638)Helen Koike2018-08-181-1/+3
| | | | | Port specific files are located in /use/local/etc/ in FreeBSD. This avois having a specific patch in FreeBSD package, making it easier to maintain.
* Prevent setup of the default ethernet interface. (#630)Max Illfelder2018-07-254-14/+8
| | | | The default ethernet interface is already enabled. We should not run dhclient on the interface.
* class IpForwardingUtils implemented in distro_lib (#622)Helen Koike2018-07-2423-367/+899
| | | | | | | | | | | | | | * class IpForwardingUtils implemented in distro_lib The old implementation of IpForwardingUtils uses ip route command, but this is not suported in FreeBSD. This commit moves the implementation to distro_lib and transforms IpForwardingUtils into an interface class, allowing each distro to chose which implementation to use. class IpForwardingUtilsIprouteTest: contains the old implemetation using ip route command class IpForwardingUtilsIfconfig: contains an implementation using ifconfig command
* Account daemon does not verify username is 32 characters or less (#624)Justin Wilson2018-07-132-1/+2
| | | | | | | A user with a username greater than 32 characters (name and email with special characters converted to _) logged into an instance with OS Login enabled. The user received "No user exists for uid XXXX" messages when attempting to run programs. This change verifies that usernames are at most 32 characters.
* Rename distro directory to distro_lib. (#619)Max Illfelder2018-05-3134-73/+73
| | | This prevents conflicts with the Python 3 distro module.
* Revert "instance_setup: _StartSshd: test rc.d for FreeBSD (#593)" (#611)Helen Koike2018-05-162-23/+1
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 8093d7c6cb798d7c6fad7247313d8d66b892dde8. Reason: google_instance_setup starts sshd after generating host keys, but when FreeBSD boots, this service starts before sshd. FreeBSD starts sshd through rc utility on boot regardless if it was already started before. Causing the following error: ``` Starting sshd. May 15 16:51:18 freebsd sshd[1365]: error: Bind to port 22 on :: failed: Address already in use. May 15 16:51:18 freebsd sshd[1365]: error: Bind to port 22 on :: failed: Address already in use. May 15 16:51:18 freebsd sshd[1365]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use. May 15 16:51:18 freebsd sshd[1365]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use. May 15 16:51:18 freebsd sshd[1365]: fatal: Cannot bind any address. May 15 16:51:18 freebsd sshd[1365]: fatal: Cannot bind any address. ``` Solution: Don't start ssh in instance_setup for FreeBSD, let the rc utility to start it.
* Add default_shell in instance_config (#609)Helen Koike2018-05-154-5/+15
| | | | | | | | | | | | * Add default_shell in instance_config In some systems, bash is not necessarily installed and not necessarily the default shell. FreeBSD for instance doesn't come with bash by default. Add default_shell option and let the system to chose which shell to use to execute metadata startup/shutdown scripts. Fallback to bash
* Add HandleClockSync in distro/utils.py for FreeBSD (#592)Helen Koike2018-05-1523-36/+331
| | | | | | | | | | | * Add HandleClockSync in distro/utils.py for FreeBSD - There is no hwclock for FreeBSD, use ntpdate instead. - Check in compat.py if the system is FreeBSD and don't call distro.linux_distribution() if true - Migrate distro specific logic for clock sync to distro/utils. - Add the following functions to distro/helpers: def CallHwclock(logger): # Logic used by Linux systems def CallNtpdate(logger): # Logic used by FreeBSD - Add mock tests accordingly
* Prevent log spam from the IP forwarding daemon. (#608)Max Illfelder2018-05-142-2/+3
| | | | | Forwarded IPs are returned with a local prefix. The agent splits on the space and tries to add a route for the IP "local" which generates log spam. We should strip out the local prefix to prevent this issue.
* Prevent delay in configuring IP forwarding routes. (#605)Max Illfelder2018-05-104-60/+66
| | | | Add support for enabling network interfaces if they appear while the VM is running.
* instance_setup: _StartSshd: test rc.d for FreeBSD (#593)Helen Koike2018-05-072-1/+23
| | | | | FreeBSD uses the rc utility. The path for sshd service in FreeBSD is /etc/rc.d/sshd. Check for this path and add an appropriate mock test
* Update the name of the passwd cache file. (#597)Max Illfelder2018-05-042-2/+2
| | | | When we enable and disable OS Login, this is the file that should be updated or removed.
* Create Network Daemon (#556)ryanwe2018-04-0217-553/+678
| | | | | | | | * Refactor network_setup and ip_forwarding. * Update and add tests. * Update configurations to remove network_setup and ip_forwarding_daemon. * Update configurations to start network_setup daemon. * Update documentation.
* Create home directory if it does not exist. (#577)Adam2018-03-202-1/+42
| | | | | In _UpdateAuthorizedKeys, before creating ssh dir, also create home dir if it does not exist. This can happen if _GetUser (getpwnam) returns non-local user info (e.g., from LDAP).
* Update the default value for cache update time. (#576)Max Illfelder2018-03-151-1/+1
| | | | The cache file should always be updated when the account daemon starts and OS Login is enabled.
* Add logic for when the NSS cache does not exist. (#575)Max Illfelder2018-03-122-4/+24
|
* Use python3-distro in python 3.6 and above. (#574)Zach Marano2018-03-091-1/+1
|
* Accounts daemon updates the OS Login NSS cache. (#570)Max Illfelder2018-03-083-8/+148
| | | | | | | | * Accounts daemon updates the OS Login NSS cache. This includes testing for updates to the OS Login NSS cache. * Remove the OS Login NSS cache on deactivation.
* Fix documentation for regenerating boto config. (#557)Max Illfelder2018-02-161-1/+1
|
* Muti-Nic network setup support for SUSE 11 and 12. (#547)ryanwe2018-02-1210-11/+332
| | | | | | | | | | | | | | | | | | Muti-Nic network setup support for SUSE 11 and 12. Adds network setup logic to handle multiple Nics for SUSE 11 and 12. For SUSE 11 - Run dhcpcd on additional Nics. For SUSE 12 - For additional Nics, create the ifcfg-eth* files. - Run wicked ifup eth1... to active the Nics. Requires installation of `distro` package for python 3.5 and above. Requires updated `setuptools` for all packages.
* Remove utils dependency on logger. (#546)Max Illfelder2018-01-302-13/+3
| | | | This removes a circular dependency - compat imports utils and logger imports compat.
* Create directories in the Python package for distro-specific logic. (#535)ryanwe2018-01-3026-177/+671
| | | | | - Finish creating distro directories. - Import correct module based on distro type. - Refactor 'network_setup' to use these new directories.
* Fix linter errors caught by flake8. (#519)Max Illfelder2017-11-173-3/+0
|
* Generate SSH host keys when none are present. (#510)Max Illfelder2017-10-273-8/+21
| | | | Provide an instance config option for specifying which host key types to generate.
* Activating OS Login should log as informational. (#509)Max Illfelder2017-10-262-4/+4
|
* OS Login activation via the accounts daemon. (#494)Rick Wright2017-10-135-25/+499
| | | | Accounts daemon handles activation and deactivation of OS Login based on a metadata key.
* Use curl to download metadata script files. (#476)Max Illfelder2017-09-112-2/+91
| | | | | | | In Python versions less than 2.7.9, urllib does not check ssl certificates. - Use curl when Python version does not support ssl certificate validation. - Add curl package dependency on EL distros. - Add testing for compat file. - Improve style in the compat file.
* Use netifaces for getting mac address (#442)Helen Koike2017-08-292-2/+82
| | | | | BSD doesn't have the path /sys/class/net/<interface>/address Use netifaces instead for interoperability with BSDs systems If netifaces is not available, fallback to sysfs method
* Fix the group and user modification commands. (#460)Max Illfelder2017-08-162-14/+13
| | | Run the user commands as a list of arguments.
* Fix the group and user modification commands. (#459)Max Illfelder2017-08-163-9/+10
|
* Account commands are strings, not booleans. (#456)Max Illfelder2017-08-161-4/+4
|