Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NoCloud-Auto-Installer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
NoCloud-Auto-Installer
Commits
911f180e
Verified
Commit
911f180e
authored
Dec 20, 2019
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Validation script
parent
56cacfe0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
validate.sh
+49
-0
49 additions, 0 deletions
validate.sh
with
49 additions
and
0 deletions
validate.sh
0 → 100644
+
49
−
0
View file @
911f180e
#!/bin/bash
fail_empty
(){
if
[
-z
"
$1
"
]
then
echo
"Error :
$2
"
exit
1
else
echo
"Ok :
$1
"
fi
}
fail_not_empty
(){
if
[
!
-z
"
$1
"
]
then
echo
"Error :
$2
"
exit
1
else
echo
"Ok :
$1
"
fi
}
echo
"Automated checks"
Proto
=
$(
grep
"^Protocol 2"
/etc/ssh/sshd_config
)
fail_empty
"
$Proto
"
"SSH Protocol 2 not enforced"
Passwd
=
$(
grep
"^PasswordAuthentication no"
/etc/ssh/sshd_config
)
fail_empty
"
$Passwd
"
"SSh password allowed"
systemctl restart ssh
real_users
=
$(
egrep
"10[0-9][0-9]"
/etc/passwd
)
fail_not_empty
"
$real_users
"
"Please remove real_users"
read
-p
"hit enter"
echo
"Manual check : fail2ban"
systemctl status fail2ban
fail2ban-client status
read
-p
"hit enter"
echo
"Manual check : ufw"
ufw status verbose
read
-p
"hit enter"
echo
"Manual check : clamav"
systemctl status clamav-daemon clamav-freshclam
read
-p
"hit enter"
echo
"Manual check cron root"
crontab
-u
root
-l
read
-p
"hit enter"
echo
"Manual check cron www-data"
crontab
-u
www-data
-l
read
-p
"hit enter"
echo
"Manual check home perms"
ls
-lstrh
--color
=
auto /home
read
-p
"hit enter"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment