-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add staging-with-rebase-focal to CI and fix testinfra tests (#5638)
* Fixes #5636 uses right path of dhclient in Focal `sbin/dhclient` string is the correct path in Xenial and on Focal. In Xenial the file is at `/sbin/dhclient`. In Focal the file is at `/usr/sbin/dhclient` * Adds CI job staging-test-with-rebase-focal This will run the Focal staging job in the CI. * Updates test strings to verify gpg2 output * Adds systemd service file ossec and DNS fix Disables systemd-resolved and hardcoded DNS for Focal In Focal by default we have systemd-resolved trying to do DNS resolution. This does not pick up our DNS configuration via resolvconf. So, we can have hardcoded /etc/resolv.conf via template file. Enables and restarts OSSEC service properly via systemd module Now instead of a command, we are enabling and restarting the service using the Ansible systemd module. We also remove the old /etc/init.d/ossec file as only we want only our service to exists. * Update listing port test Now uses testinfra primitives instead of lsof workaround * Adds ossec.service file while building the ossec-server package We remove the /etc/init.d/ossec file and using the systemd service file in the ossec-server package. * Uses ossec.service only for Focal build * Adds new testinfra test for ossec We verify that Xenial uses sysv script, and Focal is using the ossec.service file to start the service in the mon server. * Consolidates resolvconf config for dual distros Under Focal, we were writing the nameserver info to two (2) files, but only testing one of them. Using a vars-based approach now, and the test logic now looks in the correct spot for Focal. * Adds systemd service check for ossec-agent Same as we've done for ossec-server, let's make sure that ossec-agent is also managed via systemd when running under Focal. * Use service file ossec pacakges * Adds ossec.service file for the agent OSSEC server and agent requires two different service files. Details at https://kushaldas.in/posts/story-of-debugging-exit-0.html Co-authored-by: mickael e <mickael@freedom.press> Co-authored-by: Conor Schaefer <conor@freedom.press>
- Loading branch information
1 parent
3d20425
commit 42c8eba
Showing
21 changed files
with
175 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
install_files/ansible-base/roles/build-ossec-deb-pkg/files/ossec-agent.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=OSSEC service for agent | ||
|
||
[Service] | ||
Type=forking | ||
ExecStart=/var/ossec/bin/ossec-control start | ||
ExecStop=/var/ossec/bin/ossec-control stop | ||
RemainAfterExit=True | ||
SuccessExitStatus=1 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
10 changes: 10 additions & 0 deletions
10
install_files/ansible-base/roles/build-ossec-deb-pkg/files/ossec.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=OSSEC service | ||
|
||
[Service] | ||
Type=forking | ||
ExecStart=/var/ossec/bin/ossec-control start | ||
ExecStop=/var/ossec/bin/ossec-control stop | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
# Single handler to operate on *both* OSSEC hosts, server & client. | ||
- name: restart ossec | ||
service: | ||
systemd: | ||
name: ossec | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters