security_monkey icon indicating copy to clipboard operation
security_monkey copied to clipboard

Security Monkey installation using docker-compose fails

Open SyCode7 opened this issue 6 years ago • 3 comments

Please make sure that you have checked the boxes:

Description of issue:

Installing security monkey via docker succeeds however I cannot not login into the web ui. I have tried both methods described in the docker installation instruction. When trying method 2, i.e. to manually execute commands in the docker container shell, the following errors occurs:

bash: ^: command not found root@7a1ed8f90a0c:/usr/local/src/security_monkey# [SQL: 'SELECT account_type.id AS account_type_id, account_type.name AS account_type_name \nFROM account_type \nWHERE account_type.name = %(name_1)s \n LIMIT %(param_1)s'] [parameters: {'name_1': 'AWS', 'param_1': 1}] (Background on this error at: http://sqlalche.me/e/f405) bash: syntax error near unexpected token (' `

It seems to be an issue with the postgress database commands , not sure though. The command i tried was monkey add_account_aws --id $account --name $name -r SecurityMonkey.

When I try the command monkey create_user [email protected] Admin , another error occurs: File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 507, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation "user" does not exist LINE 3: FROM "user" ^ [SQL: 'SELECT count(*) AS count_1 \nFROM (SELECT "user".id AS user_id, "user".email AS user_email, "user".password AS user_password, "user".active AS user_active, "user".confirmed_at AS user_confirmed_at, "user".daily_audit_email AS user_daily_audit_email, "user".change_reports AS user_change_reports, "user".last_login_at AS user_last_login_at, "user".current_login_at AS user_current_login_at, "user".login_count AS user_login_count, "user".last_login_ip AS user_last_login_ip, "user".current_login_ip AS user_current_login_ip, "user".role AS user_role \nFROM "user" \nWHERE "user".email = %(email_1)s) AS anon_1'] [parameters: {'email_1': u'[email protected]'}] (Background on this error at: http://sqlalche.me/e/f405)

SyCode7 avatar Feb 07 '19 01:02 SyCode7

UPDATE : I managed to scale through this initial hurdle. After successfully login, I am redirected to the dashboard as an anonymous user and there is always an error displayed Error loading resource from API. Error:<API Server is not reachable>. However the secmonkey-api container seems to be running fine. I am not sure of what next to do and will really appreciate any guidance !

SyCode7 avatar Feb 10 '19 08:02 SyCode7

Does a docker ps return the 6 Security Monkey containers running?

mstair avatar Feb 11 '19 18:02 mstair

@mstair I can see the six docker containers running: a@b:~/git/security_monkey$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d206a68c3e24 secmonkey:latest "/usr/local/src/secu…" 2 days ago Up 2 days 5000/tcp secmonkey-worker bf867d97d284 secmonkey-nginx:latest "/usr/local/src/secu…" 2 days ago Up 2 days 0.0.0.0:8000->80/tcp, 0.0.0.0:8443->443/tcp secmonkey-nginx 8127f427bbe8 secmonkey:latest "/usr/local/src/secu…" 2 days ago Up 2 days 5000/tcp secmonkey-api 04d169268d50 secmonkey:latest "/usr/local/src/secu…" 2 days ago Up 2 days 5000/tcp secmonkey-scheduler 91b6a19711f1 redis:4 "docker-entrypoint.s…" 2 days ago Up 2 days 6379/tcp secmonkey-redis 838fe98849d4 postgres:10.1 "docker-entrypoint.s…" 2 days ago Up 2 days 5432/tcp secmonkey-db

SyCode7 avatar Feb 12 '19 17:02 SyCode7