Tstconfig Code
Tool for automatic security and configuration testing
Status: Alpha
Brought to you by:
predonzani
File | Date | Author | Commit |
---|---|---|---|
src | 2014-09-09 |
![]() |
[f2c468] Close #10 First column for `positions` |
.gitignore | 2014-08-29 |
![]() |
[fe0a83] Close #1 |
LICENSE | 2014-08-29 |
![]() |
[59afc1] Initial import |
README.md | 2014-09-08 |
![]() |
[1b6eca] Updated README |
pom.xml | 2014-09-03 |
![]() |
[6453a2] Project version: 0.2-SNAPSHOT |
Tstconfig is a system administration tool that tests (a large number of)
configuration files automatically. Tstconfig looks at the configurations, checks
that certain properties have the value that you expect, and reports
any discrepancies.
The main use for Tstconfig is to test that a Linux system is configured in
a secure way in areas such as the firewall (ufw), fail2ban, sshd, apache,
mysql, php, the system's users, etc...
Tstconfig runs from the command line with the following syntax:
tstconfig [definition_file]...
In examples/sshd.tstconfig
:
################################################################################
# Test sshd configuration
################################################################################
# The location of the configuration file
file /etc/ssh/sshd_config
# The syntax for parsing
syntax ssh
# Check that root cannot login via ssh
property PermitRootLogin
assert_eq no
# Check that only certain users can login via ssh
property AllowUsers
assert_eq your_user_name
Tstconfig's output is a report of the tests that passed or failed, with details
on the tests that failed:
$ tstconfig examples/sshd.tstconfig
Tstconfig 0.1
Reading definition file: examples/sshd.tstconfig
ASSERTION FAILED
File: /etc/ssh/sshd_config
Property: PermitRootLogin
Value: yes
Assertion: assert_eq no
ASSERTION FAILED
File: /etc/ssh/sshd_config
Property: AllowUsers
Value: <undefined>
Assertion: assert_eq your_user_name
SUMMARY REPORT: FAIL
Assertions tested: 2
Assertions passed: 0
Assertions failed: 2
Errors: 0