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

Cannot clone GIT repo over HTTPS (self-signed server cert issue) #490

Closed
holgerstolzenberg opened this issue Oct 24, 2017 · 10 comments
Closed

Comments

@holgerstolzenberg
Copy link

ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • API
  • UI
SUMMARY

I am trying to clone a repository from our internal Bitbucket server. The server runs with a self signed certificate. The clone operation breaks due to Peer's Certificate issuer is not recognized.

As a workaround, I tried to disabled SSL verification via the .gitconfig for the root user on the awx-task container, but with no luck. The process forked by AWX seems to ignore that. Second problem would be that this is just a transient solution.

The following Stackoverflow post describes another issue related to this:
https://serverfault.com/questions/877530/git-called-by-awx-ignores-manually-installed-root-ca

This is essentially a showstopper for us, as we cannot clone Ansible provisioning code without pain.

ENVIRONMENT
  • AWX version: 1.0.1.81
  • AWX install method: docker on CentOS 7
  • Ansible version: 2.4.0.0
  • Web Browser: Chrome 62.0.3202.62
STEPS TO REPRODUCE
  • Create new credential entity for your repo via UI
  • Create new Project via the UI
    • Use afore created credentials
    • Use HTTPS protocol, use Git repo secured by self signed certificate
EXPECTED RESULTS
  • Add a checkbox to the Project creation page that disables SSL verification for the given project
  • The forked git clone task command needs to leverage that setting
  • In result, the repo with the self-signed cert can be cloned
ACTUAL RESULTS
  • Repo cannot be cloned due to certificate trust error
ADDITIONAL INFORMATION

awx-git-clone-error

@wenottingham
Copy link
Contributor

closing as duplicate of #416

matburt pushed a commit to matburt/awx that referenced this issue Nov 16, 2017
[3.2.2] Delete all hosts or groups from inventory source
@kuklis
Copy link

kuklis commented Dec 26, 2017

To turn off certificate verification completely add AWX_TASK_ENV['GIT_SSL_NO_VERIFY'] = 'True' to /etc/tower/settings.py within the awx_task container and restart it.
A nicer solution is to copy the self-signed certificate (not the key) to /etc/pki/ca-trust/source/anchors/ on awx_task container and run update-ca-trust extract within. Make sure to configure AWX with the correct hostname of the git server, matching the certificate subject.

@lukasmrtvy
Copy link

lukasmrtvy commented Feb 20, 2018

This is not working.. Any ideas?

PATCH /api/v1/settings/jobs/

{
    "AWX_TASK_ENV": {
        "GIT_SSL_NO_VERIFY": "True"
    }
}

EDIT: AWX_TASK_ENV has "defined_in_file": true, is possible to override it somehow?

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Feb 20, 2018

@muhahacz after running a job, can you visit:

GET /api/v2/project_updates/N/

...and confirm that GIT_SSL_NO_VERIFY is properly set under the job_env key?

@lukasmrtvy
Copy link

lukasmrtvy commented Feb 21, 2018

@ryanpetrello
GIT_SSL_NO_VERIFY is not set ..

In fact I guess that I cannot set any AWX_TASK_ENV variable, if this option has "defined_in_file": true set.

I can not event set it in web gui ( http://awx/#/configuration/jobs )
Extra environment variables: (This setting has been manually in a setting file and is now disabled)

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Feb 21, 2018

@muhahacz you've defined AWX_TASK_ENV in a .py setting file somewhere on the file system, which makes it read-only (and not editable from the API).

@zakstar
Copy link

zakstar commented Sep 28, 2018

This is not working.. Any ideas?

PATCH /api/v1/settings/jobs/

{
    "AWX_TASK_ENV": {
        "GIT_SSL_NO_VERIFY": "True"
    }
}

EDIT: AWX_TASK_ENV has "defined_in_file": true, is possible to override it somehow?

@lukasmrtvy The following response above you from @kuklis helped me in the workaround.

To turn off certificate verification completely add AWX_TASK_ENV['GIT_SSL_NO_VERIFY'] = 'True' to /etc/tower/settings.py within the awx_task container and restart it.

@ylebi
Copy link

ylebi commented Nov 4, 2020

@ryanpetrello
GIT_SSL_NO_VERIFY is not set ..

In fact I guess that I cannot set any AWX_TASK_ENV variable, if this option has "defined_in_file": true set.

I can not event set it in web gui ( http://awx/#/configuration/jobs )
Extra environment variables: (This setting has been manually in a setting file and is now disabled)

I know it's been a while for that issue, but hope it will assist others.

You can add this extra variable in the Jobs Settings via the AWX web interface (http://awx/#/settings/jobs) under "EXTRA ENVIRONMENT VARIABLES"
Additional information in the documentation: https://docs.ansible.com/ansible-tower/latest/html/administration/configure_tower_in_tower.html#jobs

{
"GIT_SSL_NO_VERIFY": "True"
}

@4F2E4A2E
Copy link

Thanks to this post, I was able to pass the config in the following way:

  • Install the awx cli
python3 -m pip install awxkit
awx -k settings modify AWX_TASK_ENV '{ "HOME": "/var/lib/awx", "GIT_SSL_NO_VERIFY": "True" }' --conf.token <xyz>

@martpp
Copy link

martpp commented Mar 25, 2022

To turn off certificate verification completely add AWX_TASK_ENV['GIT_SSL_NO_VERIFY'] = 'True' to /etc/tower/settings.py within the awx_task container and restart it. A nicer solution is to copy the self-signed certificate (not the key) to /etc/pki/ca-trust/source/anchors/ on awx_task container and run update-ca-trust extract within. Make sure to configure AWX with the correct hostname of the git server, matching the certificate subject.

Addition: In the new AWX-Version (20.0.1) the awx_task container is now called tools_awx_1 and the settings file is under /etc/tower/conf.d/local_settings.py.

fosterseth added a commit to fosterseth/awx that referenced this issue Jun 25, 2024
Utilizes the `validate_role_assignment` callback
from dab (see dab PR ansible#490) to prevent granting credential
access to a user of another organization.

This logic will work for role_user_assignments
and role_team_assignments endpoints.

Signed-off-by: Seth Foster <[email protected]>
AlanCoding pushed a commit to fosterseth/awx that referenced this issue Jun 27, 2024
Utilizes the `validate_role_assignment` callback
from dab (see dab PR ansible#490) to prevent granting credential
access to a user of another organization.

This logic will work for role_user_assignments
and role_team_assignments endpoints.

Signed-off-by: Seth Foster <[email protected]>
AlanCoding pushed a commit to fosterseth/awx that referenced this issue Jun 28, 2024
Utilizes the `validate_role_assignment` callback
from dab (see dab PR ansible#490) to prevent granting credential
access to a user of another organization.

This logic will work for role_user_assignments
and role_team_assignments endpoints.

Signed-off-by: Seth Foster <[email protected]>
fosterseth added a commit to fosterseth/awx that referenced this issue Jul 1, 2024
Utilizes the `validate_role_assignment` callback
from dab (see dab PR ansible#490) to prevent granting credential
access to a user of another organization.

This logic will work for role_user_assignments
and role_team_assignments endpoints.

Signed-off-by: Seth Foster <[email protected]>
fosterseth added a commit that referenced this issue Jul 2, 2024
Utilizes the `validate_role_assignment` callback
from dab (see dab PR #490) to prevent granting credential
access to a user of another organization.

This logic will work for role_user_assignments
and role_team_assignments endpoints.

Signed-off-by: Seth Foster <[email protected]>
djyasin pushed a commit to djyasin/awx that referenced this issue Sep 16, 2024
Utilizes the `validate_role_assignment` callback
from dab (see dab PR ansible#490) to prevent granting credential
access to a user of another organization.

This logic will work for role_user_assignments
and role_team_assignments endpoints.

Signed-off-by: Seth Foster <[email protected]>
djyasin pushed a commit to djyasin/awx that referenced this issue Nov 11, 2024
Utilizes the `validate_role_assignment` callback
from dab (see dab PR ansible#490) to prevent granting credential
access to a user of another organization.

This logic will work for role_user_assignments
and role_team_assignments endpoints.

Signed-off-by: Seth Foster <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants