telekom-security / tpotce

🍯 T-Pot - The All In One Multi Honeypot Platform 🐝
GNU General Public License v3.0
6.85k stars 1.08k forks source link

File '/usr/share/netdata/web/' does not exist, or is not accessible. #69

Closed decker78 closed 7 years ago

decker78 commented 7 years ago

File '/usr/share/netdata/web/' does not exist, or is not accessible. It's not there. Checked if I can adjust netdata.conf but both files are empty.

t3chn0m4g3 commented 7 years ago

@decker78 T-Pot 16.03 does not offer Netdata, you are probably using 16.10. I cannot reproduce the problem with the latest netdata image:

sudo docker images
dtagdevsec/netdata         latest1610          5e3b1e3d0f1a        37 hours ago        282.1 MB

Where do you get this error? Please bar in mind that this probably points to the docker container and not to the host filesystem.

File '/usr/share/netdata/web/' does not exist, or is not accessible. It's not there. Checked if I can adjust netdata.conf but both files are empty.

decker78 commented 7 years ago

I get the error when clicking on netdata in the portal. It looks like the netdata share points to inside the docker container instead of the /usr/share/netdata

t3chn0m4g3 commented 7 years ago

@decker78 Cannot reproduce :slightly_frowning_face: Please post a screenshot.

decker78 commented 7 years ago

I find the share/netdata in /var/lib/docker/aufs/diff/058557317e099706ac13670716c41ad91bbf62b2ae534c8eda18c9e39f2bcef2/usr/share/netdata

file.jpg

Indeed 16.10

dtagdevsec/netdata latest1610 cc2ca18ad5ba 2 days ago 282.1 MB dtagdevsec/ui-for-docker latest1610 a992b6509ee7 4 days ago 10.69 MB dtagdevsec/cowrie latest1610 022dbbae8959 2 weeks ago 393.7 MB dtagdevsec/conpot latest1610 6c1cc2d050d6 4 weeks ago 428.9 MB dtagdevsec/elasticpot latest1610 d01b2b7477e1 4 weeks ago 172.4 MB dtagdevsec/suricata latest1610 61edd1f791ba 4 weeks ago 244.8 MB dtagdevsec/glastopf latest1610 6b85962b8eb0 4 weeks ago 557.7 MB dtagdevsec/elk latest1610 4f0515a7bb1c 4 weeks ago 972.3 MB dtagdevsec/honeytrap latest1610 1b20ff6af947 4 weeks ago 352.1 MB dtagdevsec/dionaea latest1610 37df07fe286a 4 weeks ago 270 MB dtagdevsec/emobility latest1610 c64ffea1bafa 7 weeks ago 1.221 GB

t3chn0m4g3 commented 7 years ago

@decker78 Strange. Even if I stop the container I cannot reproduce the error. Please run ... and post the outputs:

sudo docker inspect netdata
sudo dps.sh
sudo cat /etc/systemd/system/netdata.service
sudo status.sh
sudo docker images
sudo docker ps -a
decker78 commented 7 years ago
[
    {
        "Id": "b5d602ca4731a7699fba95ad5e97877d368f0b6d7ee6ee4b3bc35e8cf228497e",
        "Created": "2016-11-30T05:09:50.717972306Z",
        "Path": "/usr/sbin/netdata",
        "Args": [
            "-D",
            "-s",
            "/host",
            "-i",
            "127.0.0.1",
            "-p",
            "64301"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 1856,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2016-11-30T05:09:53.302735704Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:cc2ca18ad5ba8f2de015db098a2e677cabe46924fcd949a26c66499e505d9ed6",
        "ResolvConfPath": "/var/lib/docker/containers/b5d602ca4731a7699fba95ad5e97877d368f0b6d7ee6ee4b3bc35e8cf228497e/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/b5d602ca4731a7699fba95ad5e97877d368f0b6d7ee6ee4b3bc35e8cf228497e/hostname",
        "HostsPath": "/var/lib/docker/containers/b5d602ca4731a7699fba95ad5e97877d368f0b6d7ee6ee4b3bc35e8cf228497e/hosts",
        "LogPath": "/var/lib/docker/containers/b5d602ca4731a7699fba95ad5e97877d368f0b6d7ee6ee4b3bc35e8cf228497e/b5d602ca4731a7699fba95ad5e97877d368f0b6d7ee6ee4b3bc35e8cf228497e-json.log",
        "Name": "/netdata",
        "RestartCount": 0,
        "Driver": "aufs",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/proc:/host/proc:ro",
                "/sys:/host/sys:ro",
                "/var/run/docker.sock:/var/run/docker.sock"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "host",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": [
                "SYS_PTRACE"
            ],
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": -1,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Name": "aufs",
            "Data": null
        },
        "Mounts": [
            {
                "Source": "/proc",
                "Destination": "/host/proc",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Source": "/sys",
                "Destination": "/host/sys",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Source": "/var/run/docker.sock",
                "Destination": "/var/run/docker.sock",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "holidayequinox",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "DEBIAN_FRONTEND=noninteractive"
            ],
            "Cmd": [
                "/usr/sbin/netdata",
                "-D",
                "-s",
                "/host",
                "-i",
                "127.0.0.1",
                "-p",
                "64301"
            ],
            "Image": "dtagdevsec/netdata:latest1610",
            "Volumes": null,
            "WorkingDir": "/",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {}
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "75e3d88c556b5185441ca74c567d986fcb7620fa51f3253ca1cb4cd7f18c7cc1",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/default",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "host": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "c990c45d70abedc197e6b7f5d9196443f5c74aeef48d552dd31b1915076d8352",
                    "EndpointID": "35c43f655f0eb99f3919389a2418e14767d746e6692fed6698abf9e0f9fc1f65",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": ""
                }
            }
        }
    }
]

==============================================================

/usr/bin/dps.sh: 20: /usr/bin/dps.sh: Syntax error: "(" unexpected (expecting "then")

==============================================================

[Unit]
Description=netdata
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStartPre=-/usr/bin/docker stop netdata
ExecStartPre=-/usr/bin/docker rm -v netdata
ExecStart=/usr/bin/docker run --name netdata --net=host --cap-add=SYS_PTRACE --rm=true -v /proc:/host/proc:ro -v /sys:/host/sys:ro -v /var/run/docker.sock:/var/run/docker.sock dtagdevsec/netdata:latest1610
ExecStop=/usr/bin/docker stop netdata 
[Install]
WantedBy=multi-user.target

========================================================================

sudo status.sh shows all running. all green

==========================================================================

dtagdevsec/netdata         latest1610          cc2ca18ad5ba        3 days ago          282.1 MB
dtagdevsec/ui-for-docker   latest1610          a992b6509ee7        4 days ago          10.69 MB
dtagdevsec/cowrie          latest1610          022dbbae8959        2 weeks ago         393.7 MB
dtagdevsec/conpot          latest1610          6c1cc2d050d6        4 weeks ago         428.9 MB
dtagdevsec/elasticpot      latest1610          d01b2b7477e1        4 weeks ago         172.4 MB
dtagdevsec/suricata        latest1610          61edd1f791ba        4 weeks ago         244.8 MB
dtagdevsec/glastopf        latest1610          6b85962b8eb0        4 weeks ago         557.7 MB
dtagdevsec/elk             latest1610          4f0515a7bb1c        4 weeks ago         972.3 MB
dtagdevsec/honeytrap       latest1610          1b20ff6af947        4 weeks ago         352.1 MB
dtagdevsec/dionaea         latest1610          37df07fe286a        4 weeks ago         270 MB
dtagdevsec/emobility       latest1610          c64ffea1bafa        7 weeks ago         1.221 GB

=========================================================================

CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS              PORTS                                                          

                                                                               NAMES
93eb5bf2b958        dtagdevsec/honeytrap:latest1610       "/usr/bin/supervisord"   6 hours ago         Up 6 hours                                                                                                  

                                                      honeytrap
4a0174757259        dtagdevsec/suricata:latest1610        "/usr/bin/supervisord"   6 hours ago         Up 6 hours                                                                                                  

                                                      suricata
f8f02d4487df        dtagdevsec/elk:latest1610             "/usr/bin/supervisord"   6 hours ago         Up 6 hours          127.0.0.1:64296->5601/tcp, 127.0.0.1:64298->9200/tcp                                    

                                                      elk
2cd36979fefc        dtagdevsec/glastopf:latest1610        "/usr/bin/supervisord"   6 hours ago         Up 6 hours          0.0.0.0:80->80/tcp                                                                      

                                                      glastopf
e1eff4c5ece4        dtagdevsec/dionaea:latest1610         "/usr/bin/supervisord"   6 hours ago         Up 6 hours          0.0.0.0:21->21/tcp, 0.0.0.0:42->42/tcp, 0.0.0.0:135->135/tcp, 0.0.0.0:443->443/tcp, 0.0.
0.0:445->445/tcp, 0.0.0.0:1433->1433/tcp, 0.0.0.0:1723->1723/tcp, 0.0.0.0:1883->1883/tcp, 0.0.0.0:1900->1900/tcp, 0.0.0.0:3306->3306/tcp, 0.0.0.0:69->69/udp, 0.0.0.0:5060-5061->5060-5061/tcp, 0.0.0.0:11211->1121
1/tcp, 0.0.0.0:5060->5060/udp, 0.0.0.0:8081->80/tcp   dionaea
1afd82b3dc20        dtagdevsec/cowrie:latest1610          "/usr/bin/supervisord"   6 hours ago         Up 6 hours          0.0.0.0:22->2222/tcp, 0.0.0.0:23->2223/tcp                                              

                                                      cowrie
8895fb5c47c7        dtagdevsec/emobility:latest1610       "/usr/bin/supervisord"   6 hours ago         Up 6 hours          0.0.0.0:8080->8080/tcp                                                                  

                                                      emobility
9e39b756207a        dtagdevsec/conpot:latest1610          "/usr/bin/supervisord"   6 hours ago         Up 6 hours          0.0.0.0:1025->1025/tcp, 0.0.0.0:50100->50100/tcp                                        

                                                      conpot
dc46f6b04a53        dtagdevsec/elasticpot:latest1610      "/usr/bin/supervisord"   6 hours ago         Up 6 hours          0.0.0.0:9200->9200/tcp                                                                  

                                                      elasticpot
b5d602ca4731        dtagdevsec/netdata:latest1610         "/usr/sbin/netdata -D"   6 hours ago         Up 6 hours                                                                                                  

                                                      netdata
6418aad1ffd5        dtagdevsec/ui-for-docker:latest1610   "/portainer"             6 hours ago         Up 6 hours          127.0.0.1:64299->9000/tcp                                                               

                                                      ui-for-docker
t3chn0m4g3 commented 7 years ago

@decker78 LGTM

sudo su -
systemctl stop netdata
docker rm dtagdevsec/netdata:latest1610
update-images.sh

Last resort.

decker78 commented 7 years ago

The last resort worked like a charm. Nice netdat dashboard now. Still strange, did standard industrial install without touching the install.

One correction in the last resort solution. I used docker rmi dtagdevsec/netdata:latest1610 to remove the image. So not rm.

Thanks for support

t3chn0m4g3 commented 7 years ago

@decker78 welcome :bowtie: - rmi is correct, typos happen :wink: