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

IPv6 pull request #563

Merged
merged 232 commits into from
Nov 23, 2015
Merged

IPv6 pull request #563

merged 232 commits into from
Nov 23, 2015

Conversation

aquerubin
Copy link
Contributor

This will bring in the various patches required for IPv6 support plus:

  • Updated decoder for dovecot log format change.
  • Increased timeframe maximum to 1 week.

See the individual commit descriptions and https://bitbucket.org/aquerubin/ossec-hids/wiki/Home for additional change notes.

aquerubin and others added 30 commits November 12, 2013 00:51
Removed IP version dependent INFO since the IP address is already displayed.
Added v4mapped check.
with a more general (\S+).
Updated dovecot decoder filters to handle a log format change and the
protocol field.
Conflicts:
	src/client-agent/start_agent.c
	src/os_maild/sendmail.c
Conflicts:
	src/os_auth/main-client.c
aquerubin added 20 commits June 11, 2015 08:25
Conflicts:
	src/InstallAgent.sh
	src/error_messages/error_messages.h
	src/headers/defs.h
	src/syscheckd/seechanges.c
are removed as fast as the system can process them without ever going
into lock/sleep state.
This reverts commit 4034c2d which broke
maild and possibly others.
Conflicts:
	src/client-agent/start_agent.c
	src/os_auth/main-client.c
	src/os_csyslogd/csyslogd.c
	src/os_maild/sendcustomemail.c
	src/os_maild/sendmail.c
	src/os_net/os_net.c
	src/os_net/os_net.h
	src/tests/test_os_net.c
@Namsep
Copy link

Namsep commented Nov 22, 2015

It was working fine, but now when installing a new server it fails. Can it be fixed and merged?

@aquerubin
Copy link
Contributor Author

aquerubin commented Nov 22, 2015 via email

@Namsep
Copy link

Namsep commented Nov 23, 2015

It was failing on a new agent, not accepting the key from the server. Removed all of it and started freshly resolved the issue. Probably not even related to this pull request.

Would like to see this IPv6 support going mainstream, it's been working on my IPv6 only and dualstack environments from April this year without issues.

ddpbsd added a commit that referenced this pull request Nov 23, 2015
@ddpbsd ddpbsd merged commit 0943279 into ossec:master Nov 23, 2015
@ddpbsd
Copy link
Member

ddpbsd commented Nov 23, 2015

Of course I should have tested this better before merging. I'm seeing a lot of these now (OpenBSD post-5.8 amd64):

2015/11/23 13:24:34 ossec-remoted(1218): ERROR: Unable to send message to '008'.

They seem to be: errno 22: Invalid argument

The issue is coming from logr.peersize being a sizeof sockaddr_storage in the sendto in src/remoted/sendmsg.c. Changing the last argument to the sizeof sockaddr_in seems to make my setup usable again, but I'm still testing.

@aquerubin aquerubin deleted the ipv6 branch November 23, 2015 20:25
@aquerubin
Copy link
Contributor Author

On Mon, 23 Nov 2015, Dan Parriott wrote:

Of course I should have tested this better before merging. I'm seeing a
lot of these now (OpenBSD post-5.8 amd64):

2015/11/23 13:24:34 ossec-remoted(1218): ERROR: Unable to send message to '008'.

They seem to be: errno 22: Invalid argument

The issue is coming from logr.peersize being a sizeof sockaddr_storage
in the sendto in src/remoted/sendmsg.c. Changing the last argument to
the sizeof sockaddr_in seems to make my setup usable again, but I'm
still testing.

Can you check if the below patch fixes the issue? If it does there may be
other parts that need fixing for OpenBSD.

diff --git a/src/remoted/sendmsg.c b/src/remoted/sendmsg.c
index b81b39a..df8279c 100644
--- a/src/remoted/sendmsg.c
+++ b/src/remoted/sendmsg.c
@@ -86,8 +86,9 @@ void send_msg_init()
*/
int send_msg(unsigned int agentid, const char *msg)
{

  • size_t msg_size;
  • size_t msg_size, sa_size;
    char crypt_msg[OS_MAXSTR + 1];
  • struct sockaddr * dest_sa;
/\* If we don't have the agent id, ignore it */
if (keys.keyentries[agentid]->rcvd < (time(0) - (2 \* NOTIFY_TIME))) 

{
@@ -107,9 +108,10 @@ int send_msg(unsigned int agentid, const char *msg)
}

/\* Send initial message */
  • if (sendto(logr.sock, crypt_msg, msg_size, 0,
  •           (struct sockaddr *)&keys.keyentries[agentid]->peer_info,
    
  •           logr.peer_size) < 0) {
    
  • dest_sa = (struct sockaddr *)&keys.keyentries[agentid]->peer_info;
  • sa_size = (dest_sa->sa_family == AF_INET) ?
  •          sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6);
    
  • if (sendto(logr.sock, crypt_msg, msg_size, 0, dest_sa, sa_size) < 0)
    {
    merror(SEND_ERROR, ARGV0, keys.keyentries[agentid]->id);
    }

Antonio Querubin
e-mail: [email protected]
xmpp: [email protected]

@ddpbsd
Copy link
Member

ddpbsd commented Nov 24, 2015

With the patch I am not longer seeing the errors.

@aquerubin
Copy link
Contributor Author

aquerubin commented Nov 24, 2015 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants