ICTU / zap2docker-auth-weekly

Zap baseline scanner in Docker with authentication
Apache License 2.0
104 stars 70 forks source link

Exception when running on github actions zap-baseline.py #68

Closed BrunoCD closed 10 months ago

BrunoCD commented 10 months ago

When executing below commands, which were not failing last week

zap-baseline.py -I -j -t https://$_BASE_URL/$url \
  -l WARN \
  -c $RULES \
  -r "$GITHUB_WORKSPACE/test-results/zap/$_BASE_URL-$url-testreport.html" \
  -x "$GITHUB_WORKSPACE/test-results/zap/$_BASE_URL-$url-testreport.xml"  \
  --hook=/zap/auth_hook.py \
  -z "-addoninstall ascanrules \
    -addoninstall graphql \
    -addoninstall pscanrules \
    -addoninstall websocket \
    auth.loginurl='$keycloak_root/auth/realms/$AUTH_REALM/protocol/openid-connect/auth?client_id=$AUTH_CLIENT_ID&redirect_uri=https%3A%2F%2F$_BASE_URL%2F$url%2Foidc%2Fcallback&response_type=code&scope=openid+profile+email' \
    auth.username=$AUTH_USER \
    auth.*** \
    xss.collector='xsshunter.xss.ht' \
    auth.username_field='username' \
    auth.password_field='password' \
    auth.submit_field='kc-login' \
    auth.submitaction='Submit'" > $GITHUB_WORKSPACE/test-results/zap/$url.txt 2>&1
2023-08-23 22:07:39,699 Start webdriver
Traceback (most recent call last):
  File "/zap/zap_auth.py", line 81, in authenticate
    self.setup_webdriver()
  File "/zap/zap_auth.py", line 68, in setup_webdriver
    self.driver = webdriver.Chrome(options=options)
  File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/chrome/webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 116.0.5845.96 with binary path /usr/bin/google-chrome
dicksnel commented 10 months ago

Hi @BrunoCD I will take a look to upgrade the ChromeDriver!

dicksnel commented 10 months ago

@BrunoCD I just pushed a fix 272d10cdc68e1cd8090ce170b4ded959a7f1051c

Google changed the location where the latest Chromedriver version can be retrieved. Can you please check if this fixes your issues?

BrunoCD commented 10 months ago

will try it out @dicksnel

BrunoCD commented 10 months ago

@dicksnel yes, it works thank you! Is it possible in the future to have multiple images on docker hub, just in case this happens again? All I see is latest. Thanks again.

dicksnel commented 10 months ago

@BrunoCD good idea, I will add multiple images!