Work with Artifactory and Chef without Anonymous Access

JFrog Artifactory Documentation

ft:sourceType
Paligo

By default, Artifactory allows Anonymous Access for Chef repositories. This is defined under Security | General Configuration. For details please refer to Allow Anonymous Access.Introduction to the General Security Settings

If you want to be able to trace how users interact with your repositories you need to uncheck the Allow Anonymous Access setting. This means that users will be required to enter their username and password.Introduction to the General Security Settings

The Knife command line tool does not support basic authentication (it only supports authentication with RSA keys).

To enable basic authentication, you will need to install the knife-art.gem plugin.

Install knife-art plugin

chef gem install knife-art

If properly installed you should see the following specific Artifactory commands:

Knife Artifactory plugin commands

** ARTIFACTORY COMMANDS **
knife artifactory download COOKBOOK [VERSION] (options)
knife artifactory install COOKBOOK [VERSION] (options)
knife artifactory list (options)
knife artifactory search QUERY (options)
knife artifactory share COOKBOOK [CATEGORY] (options)
knife artifactory show COOKBOOK [VERSION] (options)
knife artifactory unshare COOKBOOK VERSION

These commands are a wrapper around the standard Knife supermarket commands, that enable basic authentication. To add these credentials, pre-pend them to the URL of the Chef supermarket configured in your knife.rb file:

Setting the default Chef supermarket for Knife with credentials

knife[:supermarket_site] = 'http://admin:password@localhost:8081/artifactory/api/chef/chef-virtual'

Use an encrypted password

Use an encrypted password instead of clear-text; see Centrally Secure Passwords.Centrally Secure Passwords