-
Notifications
You must be signed in to change notification settings - Fork 23
Verify controls in running configuration #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LGTM! We do the same for the mysql-baseline, too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @FLiPp3r90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR. I really like the approach in checking the running config.
But now comes a big "but" from me:
I don't want to loose the checks of the static configuration. I think it would be best, if we keep the old config file checks an add the new running config checks. This way we can be sure, that the persistent configuration matches the running config.
oppinions? @rndmh3ro @chris-rock
We'd essentially duplicate the code if we keep both. If there's a way to not duplicate this, it'd be great. To counter your objections @schurzi: there are probably two ways to use the hardening and checks.
So while I agree that checking both config-files and the running state would be best, if we cannot do this without duplicating code, I'd only check running state. |
yes, I'm also concerned about all this duplication. I thought maybe we can introduce a helper function, that generated two One alternative, that may be acceptable is: [
{name: "logging_collector", value: "on"},
{name: "log_connections", value: "on"},
{name: "log_disconnections", value: "on"},
{name: "log_duration", value: "on"},
].each do |config|
describe postgres_conf(POSTGRES_CONF_PATH) do
its(config[:name]) { should eq config[:value] }
end
describe postgres_session(USER, PASSWORD).query('SHOW' + config[:name] +';') do
its('output') { should eq config[:value] }
end
end This would avoid many duplicated lines, and the intent can be seen with a little bit more effort. We can also structure the config hash a bit better and put it in an extra variable. |
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
Instead of checking the server configuration file we check the lifetime parameters now. So we can be sure that the params are active.