Skip to content
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

Fixes #16915: Firewall technique #1596

Merged

Conversation

amousset
Copy link
Member

@amousset amousset requested a review from ncharles May 18, 2020 15:22
@amousset
Copy link
Member Author

PR updated with a new commit

Copy link
Member

@ncharles ncharles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is massive.
I made several remarks, some because I'm not sure of the use case, and other because I fear it may default to a firewall blocking everything

Some comments would be very welcomed also

"conf_pre" string => "flush ruleset${const.n}";
}

bundle agent rudder_condition_from_string_compare(condition_prefix, string1, string2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need the &RudderUniqueID& don't you?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also use it in mono-instance techniques?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's monoinstance, its not necessary, so you can remove it from everywhere in the technique

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you move this in a common part of code ? idealy ncf?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two bundle should be generic methods but I had enough of CFEngine

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use a different naming there, more specific, like with the technique name, else we'll risk duplicate bundle names

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added rudder_ before the name of what the generic method would be, what do you suggest to add?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name of the technique, so that we have a "perfect" scoping
we have many bundles starting with rudder_ everywhere, so we might accidentaly create another with this name

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

"${condition_prefix}_false" not => "${condition_prefix}_true", scope => "namespace";
}

bundle agent rudder_variable_string_canonify(prefix, name, string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you move this in a common part of code ? idealy ncf?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opened https://issues.rudder.io/issues/17513 and https://issues.rudder.io/issues/17512, the technique will be able to use them once added without compatibility problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so you should use a different naming there, more specific, like with the technique name, else we'll risk duplicate bundle names

}

# Uses the systemd service, compatible with recent debian, rhel and derivatives
bundle common rudder_nftables {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could go in another file that would be a resource, so unique

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also have a more specific name, as long as it's in the technique?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rudder_firewall_nftables ?

@amousset
Copy link
Member Author

PR updated with a new commit

@@ -0,0 +1,2 @@
-- Alexis Mousset <alexis.mousset@rudder.io> Mon, 26 Sep 2020 17:19:00 +0100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't realized it was so old

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I just changed the year because I was not sure of the correct date format... I can this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now this is in the future. I'm amazed that we can access code from september.

@amousset
Copy link
Member Author

PR updated with a new commit

Copy link
Member

@ncharles ncharles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minors changes requested
great work

@amousset
Copy link
Member Author

PR updated with a new commit

Copy link
Member

@ncharles ncharles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just 3 minors bundle naming changes. This is awesome work

"conf_pre" string => "flush ruleset${const.n}";
}

bundle agent rudder_condition_from_string_compare(condition_prefix, string1, string2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use a different naming there, more specific, like with the technique name, else we'll risk duplicate bundle names

}

# Uses the systemd service, compatible with recent debian, rhel and derivatives
bundle common rudder_nftables {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also have a more specific name, as long as it's in the technique?

@amousset
Copy link
Member Author

PR updated with a new commit

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder-techniques/pull/1596
-- Your faithful QA
Kant merge: "Science is organized knowledge. Wisdom is organized life."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/26816/console)

@amousset
Copy link
Member Author

OK, squash merging this PR

@amousset amousset force-pushed the bug_16915/firewall_technique branch from e1c3f51 to cb6fc6b Compare June 26, 2020 13:47
@amousset amousset merged commit cb6fc6b into Normation:branches/rudder/6.1 Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants