flipkart-incubator / Astra

Automated Security Testing For REST API's
Apache License 2.0
2.49k stars 396 forks source link

Local copy of JS and CSS #68

Closed zhuzhibin123 closed 5 years ago

zhuzhibin123 commented 5 years ago

Step 6/10 : RUN pip install -r requirements.txt ---> Running in 52fe9a9b747f

Collecting requests (from -r requirements.txt (line 1)) Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5a45703350>: Failed to establish a new connection: [Errno 101] Network unreachable',)': /simple/requests/ Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5a45703650>: Failed to establish a new connection: [Errno 101] Network unreachable',)': /simple/requests/ Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5a45703810>: Failed to establish a new connection: [Errno 101] Network unreachable',)': /simple/requests/ Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5a45703950>: Failed to establish a new connection: [Errno 101] Network unreachable',)': /simple/requests/ Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5a45703a90>: Failed to establish a new connection: [Errno 101] Network unreachable',)': /simple/requests/ Could not find a version that satisfies the requirement requests (from -r requirements.txt (line 1)) (from versions: ) No matching distribution found for requests (from -r requirements.txt (line 1)) The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1

mohangcsm commented 5 years ago

As per the error message shared, Network is Unreachable. Please check if the box has connectivity to http://pypi.python.org (pip internally uses this domain for downloading modules/libraries)

zhuzhibin123 commented 5 years ago

Thank you for your reply. The country has been resolved, but a new problem has been encountered. When executing the command Python api. py, Failed to connect to MongoDB. MongoDB is running

sagarpo commented 5 years ago

@zhuzhibin123 You need to run mongo container as well.

$ docker pull mongo
$ docker run --name astra-mongo -d mong
zhuzhibin123 commented 5 years ago

The input command shows that it is already running, but the running Python api.py command indicates that the connection failed.

$ docker run --name astra-mongo -d mongo /usr/bin/docker-current: Error response from daemon: Conflict. The container name "/astra-mongo" is already in use by container 64befbf1d377995730806c3176c4631a3638cdc0c1fdbb0be2af7dcd5ba8796d. You have to remove (or rename) that container to be able to reuse that name.. See '/usr/bin/docker-current run --help'. $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 18c2a56c8bfc astra "python ./api.py '..." 28 hours ago Up 28 hours 0.0.0.0:8094->8094/tcp goofy_joliot 64befbf1d377 mongo "docker-entrypoint..." 2 days ago Up 2 days 27017/tcp astra-mongo

sagarpo commented 5 years ago

@zhuzhibin123 is it working now?

zhuzhibin123 commented 5 years ago

It has not been solved yet.

mohangcsm commented 5 years ago

@zhuzhibin123 it seems ur Mongo container is already created. Please use the below command to see if it is already created.

docker ps -a

please use below command to start it manually.

docker start 64befbf1d377

Once it is started, please follow the instructions mentioned in readme file to start Astra docker either in cli or gui mode.

zhuzhibin123 commented 5 years ago

When I executed the order, there was another problem. $python api.py /usr/lib/python2.7/site-packages/requests/init.py:80: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (3.0.4) doesn't match a supported version! RequestsDependencyWarning) Failed to connect to MongoDB.

zhuzhibin123 commented 5 years ago

When I click on Submit to display the status, is there a problem {status":"a2598d4610331c8187b73b76e411dc8"}?

zhuzhibin123 commented 5 years ago

When I submitted, there was a hint in the window. Is there any problem?{status“:”a2598d4610331c8187b73b76e411dc8“}

sagarpo commented 5 years ago

@zhuzhibin123 That means scan has started and worked fine.

zhuzhibin123 commented 5 years ago

Hi, Why didn't I see the progress? How long will it take to see the report?

sagarpo commented 5 years ago

@zhuzhibin123 It will only show "in progress" or "completed" and it takes 5 minutes max to complete single API scan.

zhuzhibin123 commented 5 years ago

Hi, When I submitted, there was a hint in the window,{status“:”a2598d4610331c8187b73b76e411dc8“},Is it normal? Or is there a problem?

sagarpo commented 5 years ago

@zhuzhibin123 Yes that's standard behavior. The scan has been started already.

zhuzhibin123 commented 5 years ago

Hi,@sagarpo After I submitted, I jumped out of that window. Then I ordered to confirm that I did not see in progress and result.

sagarpo commented 5 years ago

@zhuzhibin123 Can you share the screenshot?

zhuzhibin123 commented 5 years ago

default

zhuzhibin123 commented 5 years ago

Hi,@sagarpo Submitted, it seems that there is no state to see screenshots.

sagarpo commented 5 years ago

@zhuzhibin123 Do you have internet connection on the box where you hosted the Astra? Astra requires external JS and CSS to load from the internet.

zhuzhibin123 commented 5 years ago

Hi,@sagarpo We are private networks, can not directly connect to the Internet, the external JS and CSS download address?

sagarpo commented 5 years ago

@zhuzhibin123 it loads from bootstrapcdn.com.

zhuzhibin123 commented 5 years ago

Hi, @sagarpo Are there any instructions? Which path should we put under?

zhuzhibin123 commented 5 years ago

Hi, @sagarpo Which directory should JS documents be placed in?

sagarpo commented 5 years ago

@zhuzhibin123 I will do required changes and will push it in a couple of days.

zhuzhibin123 commented 5 years ago

@sagarpo OK, we are looking forward to it.

sagarpo commented 5 years ago

@zhuzhibin123 This is fixed. You can clone again and try the same.

zhuzhibin123 commented 5 years ago

okay