All Projects → gocd → gocd-filebased-authentication-plugin

gocd / gocd-filebased-authentication-plugin

Licence: Apache-2.0 license
This plugin is a password file based authentication plugin for GoCD

Programming Languages

java
68154 projects - #9 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to gocd-filebased-authentication-plugin

bookshelf-secure-password
A Bookshelf.js plugin for handling secure passwords
Stars: ✭ 24 (+33.33%)
Mutual labels:  bcrypt
shrtn-it
A url shortener developed as a course completion project
Stars: ✭ 16 (-11.11%)
Mutual labels:  bcrypt
phc-crypto
Hashing algorithms simplified (supports Argon2, Bcrypt, Scrypt, and PBKDF2)
Stars: ✭ 22 (+22.22%)
Mutual labels:  bcrypt
CppSecurity
C++ Security Library
Stars: ✭ 24 (+33.33%)
Mutual labels:  bcrypt
docker-swarm-elastic-agent-plugin
Docker swarm based elastic agents for GoCD
Stars: ✭ 17 (-5.56%)
Mutual labels:  gocd
mongoose-pii
A Mongoose plugin that lets you transparently cipher stored PII and use securely-hashed passwords
Stars: ✭ 43 (+138.89%)
Mutual labels:  bcrypt
bcrypt
BCrypt is a password hashing function
Stars: ✭ 138 (+666.67%)
Mutual labels:  bcrypt
spring-mvc-ex
SpringMVC 게시판 구현 : 연습예제
Stars: ✭ 17 (-5.56%)
Mutual labels:  bcrypt
BarterOnly
An ecommerce platform to buy or exchange items at your convenience
Stars: ✭ 16 (-11.11%)
Mutual labels:  bcrypt
gocd-trial
See GoCD in action quickly, using docker-compose.
Stars: ✭ 25 (+38.89%)
Mutual labels:  gocd
mlflow-gocd
GoCD plugins to work with MLFlow as model repository in a CD flow
Stars: ✭ 26 (+44.44%)
Mutual labels:  gocd
backend-server
📠 The backend of the Fairfield Programming Association website.
Stars: ✭ 26 (+44.44%)
Mutual labels:  bcrypt
apollobank
A full stack GraphQL banking application using React, Node & TypeScript.
Stars: ✭ 203 (+1027.78%)
Mutual labels:  bcrypt
BruteForce
A simple brute forcer written in GO for SHA1, SHA256, SHA512, MD5 and bcrypt
Stars: ✭ 49 (+172.22%)
Mutual labels:  bcrypt
www.go.cd
Github pages repo
Stars: ✭ 39 (+116.67%)
Mutual labels:  gocd
CryptoKnight
CryptoKnight is a general purpose cryptography desktop app
Stars: ✭ 18 (+0%)
Mutual labels:  bcrypt
docker-registry-artifact-plugin
The docker registry artifact plugin provides a way to push and pull docker images on GoCD
Stars: ✭ 21 (+16.67%)
Mutual labels:  gocd
node.bcrypt.js
bcrypt for NodeJs
Stars: ✭ 6,492 (+35966.67%)
Mutual labels:  bcrypt
kubernetes-elastic-agents
Kubernetes Elastic agent plugin for GoCD
Stars: ✭ 35 (+94.44%)
Mutual labels:  gocd
up
UP - Ultimate Provisioner CLI
Stars: ✭ 43 (+138.89%)
Mutual labels:  gocd

GoCD File Based Authentication Plugin

This is a file based authentication plugin which implements the GoCD Authorization Plugin endpoint. This plugin allows authentication/search of users defined in password files.

Building the code base

To build the jar, run ./gradlew clean test assemble

Installation

  • From GoCD 17.5.0 onwards the plugin comes bundled along with server, hence a separate installation is not required.

Usage instructions

The plugin uses the popular file format used by the htpasswd program:

username:hashed-password

The plugin currently supports passwords hashed using bcrypt, PBKDF2 and SHA1. See #13 for details.

Note: It is highly recommended that users use passwords hashed using bcrypt and not SHA1.

You can put as many username/hashed password pairs as you like -- use a new line for each one

Generating password using cli-app

You can use the gocd-passwd to generate hashed password file entry.

Use the following command to generate bcrypt hashed password file entry,

$ java -jar gocdpasswd.jar -B -u username -p password

Where, -B forces password hashing with bcrypt, However you can also use -P for PBKDF2SHA1 and -S for PBKDF2SHA256

Generating passwords using htpasswd

You can use the htpasswd program from Apache to manage your password file.

So for example, you can use the following command to create a password file called passwd and put the password for the user "user" in it:

htpasswd -c -B passwd user

Where, -B forces password hashing with bcrypt, currently considered to be very secure. You can also use -s for SHA or -d for crypt() but these are deemed insecure

htpasswd on Windows

The htpasswd executable may be downloaded as part of the apache distribution from Apache Haus or Apache Lounge. Note that these executables may not work on Windows XP or Server 2003

htpasswd on Mac OSX

htpasswd is already installed by default on Mac OSX.

htpasswd on Linux

Debian based distributions (e.g. Ubuntu) htpasswd can be installed from the apache2-utils

$ apt-get install apache2-utils

Generating passwords using python

Another option is to use the following command (assumes python is installed on your system)

$ python -c "import sha; from base64 import b64encode; print b64encode(sha.new('my-password').digest())"

Configuration

The plugin needs to be configured to use the password file. The configuration can be added by adding a Authorization Configuration by visiting the Authorization Configuration page under Admin > Security.

Alternatively, the configuration can be added directly to the config.xml using the <authConfig> configuration.

  • Example Configuration

    <authConfigs>
      <authConfig id="auth-config-id" pluginId="cd.go.authentication.passwordfile">
        <property>
          <key>PasswordFilePath</key>
          <value>path-to-password-file</value>
        </property>
      </authConfig>
    </authConfigs>
  • The plugin can also be configured to use multiple password files if required:

    <authConfigs>
      <authConfig id="auth-config-id-1" pluginId="cd.go.authentication.passwordfile">
        <property>
          <key>PasswordFilePath</key>
          <value>path-to-password-file-1</value>
        </property>
      </authConfig>
      <authConfig id="auth-config-id-2" pluginId="cd.go.authentication.passwordfile">
        <property>
          <key>PasswordFilePath</key>
          <value>path-to-password-file-2</value>
        </property>
      </authConfig>
    </authConfigs>

Troubleshooting

Verify Connection

For a given Authorization Configuration verify if the given password file can be accessed by the plugin. The Authorization Configuration page under Admin > Security gives an option to verify connection.

Enable Debug Logs

If you are on GoCD version 19.6 and above:

Edit the file wrapper-properties.conf on your GoCD server and add the following options. The location of the wrapper-properties.conf can be found in the installation documentation of the GoCD server.

# We recommend that you begin with the index `100` and increment the index for each system property
wrapper.java.additional.100=-Dplugin.cd.go.authentication.passwordfile.log.level=debug

If you're running with GoCD server 19.6 and above on docker using one of the supported GoCD server images, set the environment variable GOCD_SERVER_JVM_OPTS:

docker run -e "GOCD_SERVER_JVM_OPTS=-Dplugin.cd.go.authentication.passwordfile.log.level=debug" ...

If you are on GoCD version 19.5 and lower:

  • On Linux:

    Enabling debug level logging can help you troubleshoot an issue with this plugin. To enable debug level logs, edit the file /etc/default/go-server (for Linux) to add:

    export GO_SERVER_SYSTEM_PROPERTIES="$GO_SERVER_SYSTEM_PROPERTIES -Dplugin.cd.go.authentication.passwordfile.log.level=debug"

    If you're running the server via ./server.sh script:

    $ GO_SERVER_SYSTEM_PROPERTIES="-Dplugin.cd.go.authentication.passwordfile.log.level=debug" ./server.sh
  • On windows:

    Edit the file config/wrapper-properties.conf inside the GoCD Server installation directory (typically C:\Program Files\Go Server):

    # config/wrapper-properties.conf
    # since the last "wrapper.java.additional" index is 15, we use the next available index.
    wrapper.java.additional.16=-Dplugin.cd.go.authentication.passwordfile.log.level=debug
    

License

Copyright 2017 ThoughtWorks, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].