conjur-cli 6.0.0 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 02f6f7538e4d921cd4c0477b591d15fee6474e29
4
- data.tar.gz: ea96467d2cbc4dc9e18e9c81099dafe925677ab8
2
+ SHA256:
3
+ metadata.gz: c8e1fcb9f16178d7df4bb379b2040f8823399db19540754d87d61b81c8190e24
4
+ data.tar.gz: 3a36b197de69c0c3e0882eec341e407e0062df0e381e89e5579437344df0e3f6
5
5
  SHA512:
6
- metadata.gz: 4c84536e8f8870ae3db41d89d2c22b28593f04ccac215ad22ddf74b72c8fb7282466bd4b0c06df0e681b2244551004e5ddfd54177a56b2e59e6a1ae841e09eb4
7
- data.tar.gz: '0187873558cf62b6c55056f25214ac58fc230cd716f5fc2fb95bd64fcc41d52e464dacf0ca8937198d0f8cf5579b67c76c782e4c8f58fbeddc35c5610793d478'
6
+ metadata.gz: 23a42edf43a99b23b34389ec85333c6198b28790c31d24a8ef9edd83b627af3c3e0a83d5351797e89e4b3b1a0e2d4f5b678491b865533c33a7377c59f17f585f
7
+ data.tar.gz: 60c0c4ca64efae0bac433aaabe8f19a55245557d847e0d0172bd240acea07e2bb8ae7a5be8f7633fe37fad06bb2c26163ce6cb0f6c5d3992e1f5ca06e1013e1e
@@ -5,7 +5,7 @@ Style/MethodDefParentheses:
5
5
  EnforcedStyle: require_no_parentheses
6
6
 
7
7
  Style/StringLiterals:
8
- EnforcedStyle: double_quotes
8
+ Enabled: false # more trouble than it's worth
9
9
 
10
10
  Lint/EndAlignment:
11
11
  EnforcedStyleAlignWith: start_of_line
@@ -1,7 +1,19 @@
1
+ # 6.0.1
2
+
3
+ * Pushes to `cyberark/conjur-cli:5` on DockerHub when tests pass
4
+ * Use SNI when fetching certificate with `conjur init`.
5
+ * Correctly specify dependency versions in gemspec.
6
+ * Allow ActiveSupport v5 as a dependency.
7
+
1
8
  # 6.0.0
2
9
 
3
10
  * Provides compatibility with [cyberark/conjur](https://github.com/cyberark/conjur), Conjur 5 CE.
4
11
  * License changed to Apache 2.0.
12
+ * **Codebase forked: for changes to the 5.x (API [v4][v4-branch]) series, see
13
+ [CHANGELOG in `v4` branch][v4-changelog]**
14
+
15
+ [v4-branch]: https://github.com/cyberark/conjur-cli/tree/v4
16
+ [v4-changelog]: https://github.com/cyberark/conjur-cli/blob/v4/CHANGELOG.md
5
17
 
6
18
  # 5.3.0
7
19
 
data/Gemfile CHANGED
@@ -5,7 +5,3 @@ source 'https://rubygems.org'
5
5
 
6
6
  # Specify your gem's dependencies in conjur.gemspec
7
7
  gemspec
8
-
9
- gem 'activesupport', '~> 4.2'
10
-
11
- gem 'conjur-api', '~> 5'
@@ -37,32 +37,47 @@ pipeline {
37
37
  }
38
38
  }
39
39
 
40
- // Only publish to RubyGems if branch is 'master'
41
- // AND someone confirms this stage within 5 minutes
42
- stage('Publish to RubyGems?') {
40
+ stage('Build standalone image & push to DockerHub') {
41
+ when {
42
+ branch 'master'
43
+ }
44
+ steps {
45
+ sh './build-standalone'
46
+ sh './push-image'
47
+ }
48
+ }
49
+
50
+ // Only publish to RubyGems if the HEAD is
51
+ // tagged with the same version as in version.rb
52
+ stage('Publish to RubyGems') {
43
53
  agent { label 'releaser-v2' }
44
54
 
45
55
  when {
46
- allOf {
47
- branch 'master'
48
- expression {
49
- boolean publish = false
56
+ expression { currentBuild.resultIsBetterOrEqualTo('SUCCESS') }
57
+ expression {
58
+ def exitCode = sh returnStatus: true, script: ''' set +x
59
+ echo "Determining if publishing is requested..."
60
+
61
+ VERSION=`cat lib/conjur/version.rb | grep \'VERSION\\s*=\' | sed -e "s/.*\'\\(.*\\)\'.*/\\1/"`
62
+ echo Declared version: $VERSION
63
+
64
+ # Jenkins git plugin is broken and always fetches with `--no-tags`
65
+ # (or `--tags`, neither of which is what you want), so tags end up
66
+ # not being fetched. Try to fix that.
67
+ # (Unfortunately this fetches all remote heads, so we may have to find
68
+ # another solution for bigger repos.)
69
+ git fetch -q
50
70
 
51
- if(env.PUBLISH_GEM == "true") {
52
- return true
53
- }
71
+ # note when tag not found git rev-parse will just print its name
72
+ TAG=`git rev-parse tags/v$VERSION 2>/dev/null || :`
73
+ echo Tag v$VERSION: $TAG
54
74
 
55
- try {
56
- timeout(time: 5, unit: 'MINUTES') {
57
- input(message: 'Publish to RubyGems?')
58
- publish = true
59
- }
60
- } catch (final ignore) {
61
- publish = false
62
- }
75
+ HEAD=`git rev-parse HEAD`
76
+ echo HEAD: $HEAD
63
77
 
64
- return publish
65
- }
78
+ test "$HEAD" = "$TAG"
79
+ '''
80
+ return exitCode == 0
66
81
  }
67
82
  }
68
83
  steps {
@@ -80,14 +95,7 @@ pipeline {
80
95
 
81
96
  post {
82
97
  always {
83
- sh 'docker run -i --rm -v $PWD:/src -w /src alpine/git clean -fxd'
84
- deleteDir()
85
- }
86
- failure {
87
- slackSend(color: 'danger', message: "${env.JOB_NAME} #${env.BUILD_NUMBER} FAILURE (<${env.BUILD_URL}|Open>)")
88
- }
89
- unstable {
90
- slackSend(color: 'warning', message: "${env.JOB_NAME} #${env.BUILD_NUMBER} UNSTABLE (<${env.BUILD_URL}|Open>)")
98
+ cleanupAndNotify(currentBuild.currentResult)
91
99
  }
92
100
  }
93
101
  }
data/README.md CHANGED
@@ -1,30 +1,63 @@
1
- # Conjur
1
+ # conjur-cli
2
2
 
3
- *NOTE*: This is work-in-progress, for a future (as yet unreleased) version of Conjur.
4
- _It will not work with Conjur 4._
3
+ Command-line interface for Conjur.
5
4
 
6
- Command-line interface to Conjur 5.
5
+ *NOTE*: Conjur v4 users should use the `v5.x.x` release path. Conjur CLI `v6.0.0` only supports Conjur v5 and newer.
7
6
 
8
- A complete reference guide is available at [developer.conjur.net](http://developer.conjur.net/reference).
7
+ A complete reference guide is available at [conjur.org](https://www.conjur.org).
9
8
 
10
9
  ## Quick start
11
10
 
12
11
  ```sh-session
13
- $ docker run -it -v $PWD:/work conjurinc/cli5
14
- root@2b5f618dfdcb:/# conjur -v
15
- conjur version 6.0.0.pre.beta.2
16
- ```
12
+ $ gem install conjur-cli
17
13
 
18
- ## Docker images
14
+ $ conjur -v
15
+ conjur version 6.0.0
16
+ ```
19
17
 
18
+ ## Using Docker
20
19
  [![Docker Build Status](https://img.shields.io/docker/build/conjurinc/cli5.svg)](https://hub.docker.com/r/conjurinc/cli5/)
20
+ This software is included in the standalone cyberark/conjur-cli:5 Docker image. Docker containers are designed to be ephemeral, which means they don't store state after the container exits.
21
21
 
22
- Images for development/experimental use are automatically built [on docker hub](https://hub.docker.com/r/conjurinc/cli5/).
23
- These are based off [Dockerfile.standalone](Dockerfile.standalone) and can be rebuilt with:
22
+ You can start an ephemeral session with the Conjur CLI software like so:
23
+ ```sh-session
24
+ $ docker run --rm -it cyberark/conjur-cli:5
25
+ root@b27a95721e7d:~#
26
+ ```
24
27
 
25
- docker build . -f Dockerfile.standalone -t conjurinc/cli5
28
+ Any initialization you do or files you create in that session will be discarded (permanently lost) when you exit the shell. Changes that you make to the Conjur server will remain.
26
29
 
27
- Note these images are not subject to any QA at the moment and so should never be used in production, especially without specific image id pin.
30
+ You can also use a folder on your filesystem to persist the data that the Conjur CLI uses to connect. For example:
31
+ ```sh-session
32
+ $ mkdir mydata
33
+ $ chmod 700 mydata
34
+ $ docker run --rm -it -v $(PWD)/mydata:/root cyberark/conjur-cli:5 init -u https://eval.conjur.org
35
+
36
+ SHA1 Fingerprint=E6:F7:AC:E3:3A:54:83:4F:D0:06:9B:49:45:C3:85:58:ED:34:4C:4C
37
+
38
+ Please verify this certificate on the appliance using command:
39
+ openssl x509 -fingerprint -noout -in ~conjur/etc/ssl/conjur.pem
40
+
41
+ Trust this certificate (yes/no): yes
42
+ Enter your organization account name: your.email@yourorg.net
43
+ Wrote certificate to /root/conjur-your.email@yourorg.net.pem
44
+ Wrote configuration to /root/.conjurrc
45
+ $ ls -lA mydata
46
+ total 16
47
+ drwxr-xr-x 2 you staff 68 Mar 29 14:16 .cache
48
+ -rw-r--r-- 1 you staff 136 Mar 29 14:16 .conjurrc
49
+ -rw-r--r-- 1 you staff 3444 Mar 29 14:16 conjur-your.email@yourorg.net.pem
50
+ $ docker run --rm -it -v $(PWD)/mydata:/root cyberark/conjur-cli:5 authn login -u admin
51
+ Please enter admin's password (it will not be echoed):
52
+ Logged in
53
+ $ ls -lA mydata
54
+ total 24
55
+ drwxr-xr-x 2 you staff 68 Mar 29 14:16 .cache
56
+ -rw-r--r-- 1 you staff 136 Mar 29 14:16 .conjurrc
57
+ -rw------- 1 you staff 119 Mar 29 14:19 .netrc
58
+ -rw-r--r-- 1 you staff 3444 Mar 29 14:16 conjur-your.email@yourorg.net.pem
59
+ ```
60
+ *Security notice:* the file `.netrc`, created or updated by `conjur authn login`, contains a user identity credential that can be used to access the Conjur API. You should remove it after use or otherwise secure it like you would another netrc file.
28
61
 
29
62
  ## Development
30
63
 
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 6.0.1
@@ -0,0 +1,6 @@
1
+ #!/bin/bash -e
2
+
3
+ # build the cli standalone container image
4
+ docker build . \
5
+ -f Dockerfile.standalone \
6
+ -t cyberark/conjur-cli
@@ -18,8 +18,8 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
  gem.version = Conjur::VERSION
20
20
 
21
- gem.add_dependency 'activesupport'
22
- gem.add_dependency 'conjur-api', '~> 5.0.0.beta'
21
+ gem.add_dependency 'activesupport', '>= 4.2', '< 6'
22
+ gem.add_dependency 'conjur-api', '~> 5.0'
23
23
  gem.add_dependency 'gli', '>=2.8.0'
24
24
  gem.add_dependency 'highline', '~> 1.7'
25
25
  gem.add_dependency 'netrc', '~> 0.10'
@@ -2,7 +2,8 @@ Feature: Authenticate a role
2
2
 
3
3
  Scenario: Get a JSON token
4
4
  When I successfully run `conjur authn authenticate`
5
- Then the JSON should have "data"
5
+ Then the JSON should have "protected"
6
+ And the JSON should have "payload"
6
7
  And the JSON should have "signature"
7
8
 
8
9
  Scenario: Get an auth token as HTTP Authorize header
@@ -16,7 +17,7 @@ Feature: Authenticate a role
16
17
  """
17
18
  And I login as "alice"
18
19
  When I successfully run `conjur authn authenticate`
19
- Then the JSON at "data" should be "alice"
20
+ Then the JSON should be a hash
20
21
 
21
22
  @announce-command
22
23
  @announce-output
@@ -126,6 +126,7 @@ class Conjur::Command::Init < Conjur::Command
126
126
 
127
127
  sock = TCPSocket.new host, port.to_i
128
128
  ssock = SSLSocket.new sock
129
+ ssock.hostname = host
129
130
  ssock.connect
130
131
  chain = ssock.peer_cert_chain
131
132
  cert = chain.first
@@ -19,6 +19,6 @@
19
19
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  #
21
21
  module Conjur
22
- VERSION = '6.0.0'
22
+ VERSION = '6.0.1'
23
23
  ::Version=VERSION
24
24
  end
@@ -0,0 +1,28 @@
1
+ #!/bin/bash -eu
2
+
3
+ # Push the 'cli:5' image to Dockerhub when on the 'master' branch
4
+
5
+ cd "$(git rev-parse --show-toplevel)"
6
+
7
+ IMAGE='cyberark/conjur-cli'
8
+
9
+ function tag_and_push() {
10
+ local image="$1"
11
+ local tag="$2"
12
+ local description="$3"
13
+
14
+ echo "TAG = $tag, $description"
15
+
16
+ docker tag "$image" "$image:$tag"
17
+ docker push "$image:$tag"
18
+ }
19
+
20
+ version_tag="5-$(cat VERSION)"
21
+
22
+ tag_and_push $IMAGE '5' 'latest image'
23
+ tag_and_push $IMAGE '5-latest' 'same as "5"'
24
+ tag_and_push $IMAGE $version_tag 'version-specific image'
25
+
26
+ # push to legacy `conjurinc/cli5` tag
27
+ docker tag "$IMAGE" conjurinc/cli5:latest
28
+ docker push conjurinc/cli5:latest
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafal Rzepecki
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-13 00:00:00.000000000 Z
12
+ date: 2018-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -17,28 +17,34 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: '4.2'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '6'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
28
  - - ">="
26
29
  - !ruby/object:Gem::Version
27
- version: '0'
30
+ version: '4.2'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '6'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: conjur-api
30
36
  requirement: !ruby/object:Gem::Requirement
31
37
  requirements:
32
38
  - - "~>"
33
39
  - !ruby/object:Gem::Version
34
- version: 5.0.0.beta
40
+ version: '5.0'
35
41
  type: :runtime
36
42
  prerelease: false
37
43
  version_requirements: !ruby/object:Gem::Requirement
38
44
  requirements:
39
45
  - - "~>"
40
46
  - !ruby/object:Gem::Version
41
- version: 5.0.0.beta
47
+ version: '5.0'
42
48
  - !ruby/object:Gem::Dependency
43
49
  name: gli
44
50
  requirement: !ruby/object:Gem::Requirement
@@ -302,9 +308,11 @@ files:
302
308
  - PUBLISH.md
303
309
  - README.md
304
310
  - Rakefile
311
+ - VERSION
305
312
  - bin/_conjur
306
313
  - bin/conjur
307
314
  - build-deb.sh
315
+ - build-standalone
308
316
  - ci/cli-test.sh
309
317
  - ci/install.sh
310
318
  - ci/package.sh
@@ -385,6 +393,7 @@ files:
385
393
  - lib/patches/gli.rb
386
394
  - profile.rb
387
395
  - publish.sh
396
+ - push-image
388
397
  - spec/authn_spec.rb
389
398
  - spec/command/authn_spec.rb
390
399
  - spec/command/hosts_spec.rb
@@ -420,7 +429,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
420
429
  version: '0'
421
430
  requirements: []
422
431
  rubyforge_project:
423
- rubygems_version: 2.6.14
432
+ rubygems_version: 2.7.6
424
433
  signing_key:
425
434
  specification_version: 4
426
435
  summary: Conjur command line interface