Drone

Netrc too permissive

ISSUE SUMMARY

Hi team, I have a private repo that contain ansible playbooks.
When it runs, I get an error below saying the drone generated netrc access is too permissive. Should I do something like chmod 600 ~/.netrc somewhere? if so, where?

\"/usr/lib/python2.7/netrc.py\", line 35, in __init__\n    self._parse(file, fp, default_netrc)\n  File \"/usr/lib/python2.7/netrc.py\", line 113, in _parse\n    \" the owner\", file, lexer.lineno)\nnetrc.NetrcParseError: ~/.netrc access too permissive: access permissions must restrict access to only the owner (/root/.netrc, line 1)\n", 

Not sure if related, but a previous pipeline stage runs terraform which pulls down code from another private repo for building out infrastructure. This runs fine using an ssh key imported via drone secrets

terraform {
  source = "git@github.com:privaterepo2/terraform-modules//module_name?ref=v0.1"
}

using these commands

  # Write github deploy key to disk
  - mkdir /root/.ssh
  - echo -n "$GIT_KEY" > /root/.ssh/id_rsa
  - chmod 600 /root/.ssh/id_rsa
DRONE VERSION

1.6.2

Seems ansible (/usr/lib/python2.7/netrc.py) no longer complains after doing chmod 600 :thinking:. Is this something that should get fixed?

+ ls -lah /root
total 20K    
drwx------    1 root     root        4.0K Jan  5 12:15 .
drwxr-xr-x    1 root     root        4.0K Jan  5 12:15 ..
drwx------    1 root     root        4.0K Dec 17 02:42 .cache
-rw-r--r--    1 root     root          89 Jan  5 12:15 .netrc
-rw-r--r--    1 root     root         165 Dec 17 08:03 .wget-hsts
+ chmod 600 /root/.netrc
+ ls -lah /root
total 20K    
drwx------    1 root     root        4.0K Jan  5 12:15 .
drwxr-xr-x    1 root     root        4.0K Jan  5 12:15 ..
drwx------    1 root     root        4.0K Dec 17 02:42 .cache
-rw-------    1 root     root          89 Jan  5 12:15 .netrc
-rw-r--r--    1 root     root         165 Dec 17 08:03 .wget-hsts