dawidd6 / action-ansible-playbook

:gear: A GitHub Action for running Ansible playbooks
MIT License
298 stars 66 forks source link

private key permission problem #75

Closed gidsi closed 1 year ago

gidsi commented 1 year ago

Something seems to be wrong with fs.writeFileSync, im getting this error:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Permissions 0644 for '/home/runner/work/provisioning/provisioning/deployment/.ansible_key' are too open.
    It is required that your private key files are NOT accessible by others.
    This private key will be ignored.
    Load key "/home/runner/work/provisioning/provisioning/deployment/.ansible_key": bad permissions

Checking the key file after the action i get the following output:

-rw-r--r-- 1 runner docker 411 Apr 30 19:57 /home/runner/work/provisioning/provisioning/deployment/.ansible_key

I've forked the action and added an exec chmod 600 after creating the file and it worked. Not sure how to solve it properly yet.

gidsi commented 1 year ago

nevermind, autocommit added the files by accident.