Commit Graph

91 Commits

Author SHA1 Message Date
Clemens Schwaighofer
3aa6de7e23 check last login shellcheck fixes 2024-09-06 14:44:34 +09:00
Clemens Schwaighofer
3c160a62e7 Merge branch 'development' into shellecheck-cleanup 2024-09-06 14:37:37 +09:00
Clemens Schwaighofer
ca4616c5ee Text fix for error strings in last login check v0.19.1 2024-09-06 14:36:09 +09:00
Clemens Schwaighofer
251b0bf981 SSH login last date check was wrong 2024-09-06 14:34:38 +09:00
Clemens Schwaighofer
6daccfe57c Check last login update with more days info
if WARN then write WARN instead of OK.
Add day numbers if OK

Some minor shellscript updates
2024-09-06 14:25:28 +09:00
Clemens Schwaighofer
91f096ab0c Merge branch 'master' into shellecheck-cleanup 2024-09-06 10:58:13 +09:00
Clemens Schwaighofer
935d6a84c9 Add login shell type select (bash login or no login), fix ssh base groups
no ssh allow/forward/reject base group was set if an optional sub group was set

Add possibility to chose no login when setting the ssh access type to "...|no_login"
v0.19.0
2024-09-06 10:44:31 +09:00
Clemens Schwaighofer
ee7cc8555e Merge branch 'development' into shellecheck-cleanup 2024-09-04 14:05:51 +09:00
Clemens Schwaighofer
83f84abd46 Fix skip naming for zip/move creation v0.18.1 2024-09-04 14:04:25 +09:00
Clemens Schwaighofer
090d6f9cec Download zip file message only if there is a file to download 2024-09-04 13:44:47 +09:00
Clemens Schwaighofer
5659cc010f Update zip file/clean up skip with skip information 2024-09-04 13:43:24 +09:00
Clemens Schwaighofer
0bd40cdd73 Create user: skip zip creation run if there are no PEM files
Avoid "file not found" zip file creation and remove if there are no
PEM files created, eg if we have a pre defined pub file
2024-09-04 13:21:36 +09:00
Clemens Schwaighofer
e4ed6fed8d shellcheck based code cleanup 2024-09-04 11:16:05 +09:00
Clemens Schwaighofer
5bf30a8b2f Add shellcheckrc 2024-09-03 12:47:52 +09:00
Clemens Schwaighofer
26c007dba6 Remove error=1 debug set v0.18.0 2024-02-15 18:10:53 +09:00
Clemens Schwaighofer
785e3c116d Fix password set length check 2024-02-15 18:07:53 +09:00
Clemens Schwaighofer
adbfeb0074 Password length set, auto set if not set, and set for pwgen actually 2024-02-15 18:05:03 +09:00
Clemens Schwaighofer
8c7ef32894 Create user script update: allow no password, allow different password length 2024-02-15 18:03:16 +09:00
Clemens Schwaighofer
70ef7a3fc5 Check last login mandatory settings now has combined abort
set an error flag and check all settings before exit program
v0.17.10
2024-02-14 14:46:17 +09:00
Clemens Schwaighofer
89252af50b Bug fix for json export with double quotes v0.17.9 2023-12-22 13:39:18 +09:00
Clemens Schwaighofer
8fb833d3c4 Fix the call for getting instance data
Do not use name alias, use the IP address for this
v0.17.8
2023-12-22 13:31:33 +09:00
Clemens Schwaighofer
694f04313c Add Account, Region and Instance info for each report
So we can easy match up user reports to other information we collect
v0.17.7
2023-12-22 11:54:34 +09:00
Clemens Schwaighofer
50e28c7cfd Check that fallback last access file exists v0.17.6 2023-12-21 16:43:57 +09:00
Clemens Schwaighofer
65b7a6ad43 Fix date check for account created date
Use regex to check instead of empty string.
A comment could be set instead of a date
2023-12-21 16:39:05 +09:00
Clemens Schwaighofer
244461d466 sshforward group typo in lock and unlock users v0.17.5 2023-12-21 16:11:31 +09:00
Clemens Schwaighofer
66213dfd65 Text fixes for check last login v0.17.4 2023-12-21 16:06:53 +09:00
Clemens Schwaighofer
39da44b546 Wrong unlock account var used for unlock users v0.17.3 2023-12-21 16:01:35 +09:00
Clemens Schwaighofer
d4bb06e3e1 Fix lock user flow to only lock if the user is not in the reject group 2023-12-21 15:58:28 +09:00
Clemens Schwaighofer
cc647de495 Readme update 2023-12-21 15:14:57 +09:00
Clemens Schwaighofer
68b450baaf Add warning message for logins v0.17.2 2023-12-21 13:46:58 +09:00
Clemens Schwaighofer
8452a1b8c0 Fix pre check for ssh login checks v0.17.1 2023-12-21 13:35:50 +09:00
Clemens Schwaighofer
3fcb74ac47 Update check last login script with better reporting and csv/json output
Now for each ssh group we report last login/account create stats.
Add the main user group to output
Add unlock user commands for locked users

Add CSV and JSON formatted output
v0.17.0
2023-12-21 13:23:35 +09:00
Clemens Schwaighofer
70212da3cb systemd logs end with dot and we split, so we missed user names with . inside v0.16.4 2023-12-20 17:51:35 +09:00
Clemens Schwaighofer
168cf9db15 Create user output was using wrong var for SSH access type v0.16.3 2023-08-21 09:41:23 +09:00
Clemens Schwaighofer
92ef3f0f2e The GO flag for create_user was default 1 instead of 0
Script must be run with -g flag but for that the GO flag must be default
0.
v0.16.2
2023-08-21 09:38:00 +09:00
Clemens Schwaighofer
f181ee74e3 Bug fix: missing ;; in case in create_user script v0.16.1 2023-08-21 09:36:42 +09:00
Clemens Schwaighofer
93224e3768 Update create/delete scripts, add rename script
rename user script added: renames user, home dir and connected files.

delete script fix with remove of not needed options (-g)

Update all scripts to exit only after all errors are shown, unless it
is a critical run error.
v0.16.0
2023-08-08 10:50:08 +09:00
Clemens Schwaighofer
571ddcc717 AWS user account management scripts updates
- start option for create users (-g)
- delete user script
- update documentation
- user lock user script in check user flow output
- create user has check for valid username/group name
v0.15.0
2023-08-07 07:29:24 +09:00
Clemens Schwaighofer
eb194c2f1c The check last login loop for listing ssh reject users was wrong
The inside variable user "username" instead of "user"
v0.14.1
2023-08-02 09:51:10 +09:00
Clemens Schwaighofer
a1af63de39 Add ignore from file for authorized keys move v0.14.0 2023-06-01 17:33:22 +09:00
Clemens Schwaighofer
b5854f93c4 Text typo fix 2023-06-01 16:12:25 +09:00
Clemens Schwaighofer
5735cf2ffb bug fixes in ls for ssh key move 2023-06-01 15:41:26 +09:00
Clemens Schwaighofer
081bb1cc4c ssh key change file name had .sh.sh extension 2023-06-01 15:35:12 +09:00
Clemens Schwaighofer
e02822f06d wrong order for not moved ssh key check with master users 2023-06-01 15:30:19 +09:00
Clemens Schwaighofer
2956998762 used print instead of echo for info message in ssh key move 2023-06-01 15:28:56 +09:00
Clemens Schwaighofer
46dc2be34d Update ssh key move script
admin/ubuntu/ec2-user keys must move too, but the folders don't get
auto removed
2023-06-01 14:46:46 +09:00
Clemens Schwaighofer
43ef147de6 Fixes in create user script with central SSH location and dynamic home
Missing username in create folder path for adding new user

check if pub key exists in central location ran even if central file
was missing.

Fixed check for .ssh or central place to use.

File check before trying to remove chattr "i" flag, can't do that if the
file does not exists.
v0.13.1
2023-05-23 09:08:14 +09:00
Clemens Schwaighofer
fa7e7fbe86 Script to move authorized_keys to central location
If there is a ssh setting that we have a central location for SSH keys
move all users ssh keys there.
Currently skipped are core admin users, they will move later once all
tests are done
v0.13.0
2023-05-16 08:58:53 +09:00
Clemens Schwaighofer
fa3c4e0c6e Bug in user create test output
Missing ! for central ssh authorized_file check in pub key update flow
v0.12.0
2023-04-05 13:27:05 +09:00
Clemens Schwaighofer
ebf0eaf412 Bug fixes in user create for new ssh key central location
* Bug with existing ssh key but not in ssh authorized_file
The correct public key location was not set for the existing file

* Bug with attr set on authorzied_file update if central location
If a central location the +i attrib must be removed first
It will set always in the folder rights change

* Change the authorized file group to root for central file location
2023-04-05 13:24:15 +09:00