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

Failure to parse tcp6 URI #1521

Closed
billmeyer opened this issue Feb 28, 2017 · 1 comment
Closed

Failure to parse tcp6 URI #1521

billmeyer opened this issue Feb 28, 2017 · 1 comment
Labels
Type: Bug Feature not working as expected

Comments

@billmeyer
Copy link

Description

When running Tomcat 8.5 on Centos 7, it creates a tcp6 socket on port 8005 that Inspec fails to parse properly.

InSpec and Platform Version

Inspec 1.7.1
Centos 7.3

Replication Case

  1. Run Tomcat 8.5 on Centos 7.3.
  2. Run netstat to see tcp ports:
[vagrant@default-centos-73 ~]$ netstat -ln | grep tcp
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN
tcp6       0      0 :::111                  :::*                    LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
tcp6       0      0 :::8080                 :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 ::1:25                  :::*                    LISTEN
tcp6       0      0 :::443                  :::*                    LISTEN
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN
tcp6       0      0 :::8009                 :::*                    LISTEN
  1. Run inspec on the Centos7 target:
inspec exec https://github.com/dev-sec/ssl-benchmark -t ssh://vagrant@192.168.33.33 --sudo --user=vagrant --password=vagrant

Inspec will report this error:

Could not parse 127.0.0.1:8005, bad URI(is not URI?): addr://[127.0.0.1]:8005

From https://github.com/dev-sec/ssl-baseline/blob/master/controls/ssl_test.rb, tcpports =

tcpports = [#<struct port=111, address="0.0.0.0", protocol="tcp", process="systemd", pid=1, :listening?=nil>, #<struct port=22, address="0.0.0.0", protocol="tcp", process="sshd", pid=972, :listening?=nil>, #<struct port=25, address="127.0.0.1", protocol="tcp", process="master", pid=1392, :listening?=nil>, #<struct port=27017, address="127.0.0.1", protocol="tcp", process="mongod", pid=4901, :listening?=nil>, #<struct port=80, address="::", protocol="tcp6", process="httpd", pid=5513, :listening?=nil>, #<struct port=8080, address="::", protocol="tcp6", process="java", pid=4996, :listening?=nil>, #<struct port=443, address="::", protocol="tcp6", process="httpd", pid=5513, :listening?=nil>, #<struct port=nil, address=nil, protocol="tcp6", process="java", pid=4996, :listening?=nil>, #<struct port=8009, address="::", protocol="tcp6", process="java", pid=4996, :listening?=nil>]

Possible Solutions

Stacktrace

No stack trace produced, just an error message.

@chris-rock chris-rock added the Type: Bug Feature not working as expected label Mar 1, 2017
@adamleff adamleff self-assigned this Mar 2, 2017
@adamleff
Copy link
Contributor

adamleff commented Mar 2, 2017

@billmeyer thanks for submitting this issue! It's super-annoying where netstat will tell us it's a v6 port but provide a v4 IP address. We've seen this problem with Elasticsearch in the past too.

I'll work on a bug-fix for this and should have something in the next few days once I get through some other work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants