conjur-cli 6.2.2 → 6.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +10 -0
- data/.github/ISSUE_TEMPLATE/bug.md +16 -1
- data/.github/PULL_REQUEST_TEMPLATE.md +21 -0
- data/CHANGELOG.md +8 -1
- data/Jenkinsfile +13 -12
- data/NOTICES.txt +421 -0
- data/README.md +298 -1
- data/SECURITY.md +42 -0
- data/VERSION +1 -1
- data/build-standalone +12 -11
- data/conjur-cli.gemspec +4 -4
- data/lib/conjur/command/hosts.rb +1 -1
- data/lib/conjur/command/rspec/mock_services.rb +7 -1
- data/lib/conjur/command/users.rb +5 -1
- data/lib/conjur/version.rb +1 -1
- data/push-image +14 -6
- data/spec/command/hosts_spec.rb +23 -3
- data/spec/command/init_spec.rb +37 -40
- data/spec/command/users_spec.rb +13 -0
- metadata +11 -9
data/lib/conjur/command/users.rb
CHANGED
@@ -47,7 +47,11 @@ class Conjur::Command::Users < Conjur::Command
|
|
47
47
|
if api.username == options[:user]
|
48
48
|
exit_now! 'To rotate the API key of the currently logged-in user, use this command without any flags or options'
|
49
49
|
end
|
50
|
-
|
50
|
+
user_resource_id = [Conjur.configuration.account, "user", options[:user]].join(":")
|
51
|
+
unless api.resource(user_resource_id).exists?
|
52
|
+
exit_now! "User '#{options[:user]}' not found"
|
53
|
+
end
|
54
|
+
puts api.resource(user_resource_id).rotate_api_key
|
51
55
|
else
|
52
56
|
username, password = Conjur::Authn.read_credentials
|
53
57
|
new_api_key = Conjur::API.rotate_api_key username, password
|
data/lib/conjur/version.rb
CHANGED
data/push-image
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
set -e
|
4
4
|
|
5
5
|
readonly REGISTRY="cyberark"
|
6
|
+
readonly INTERNAL_REGISTRY="registry2.itci.conjur.net"
|
6
7
|
readonly VERSION="$(cat VERSION)"
|
7
8
|
readonly VERSION_TAG="5-${VERSION}"
|
8
9
|
readonly image_name="conjur-cli"
|
@@ -22,17 +23,24 @@ git_description=$(git describe)
|
|
22
23
|
# only when tag matches the VERSION, push VERSION and latest releases
|
23
24
|
# and x and x.y releases
|
24
25
|
#Ex: v5-6.2.1
|
25
|
-
if [ "$git_description" = "v${
|
26
|
-
echo "Revision $git_description matches version $VERSION exactly. Pushing to Dockerhub..."
|
26
|
+
if [ "${git_description}" = "v${VERSION}" ]; then
|
27
|
+
echo "Revision ${git_description} matches version ${VERSION} exactly. Pushing to Dockerhub..."
|
27
28
|
|
28
29
|
for tag in "${TAGS[@]}"; do
|
29
|
-
echo "Tagging and pushing $REGISTRY/$image_name:$tag"
|
30
|
+
echo "Tagging and pushing ${REGISTRY}/${image_name}:${tag}"
|
31
|
+
|
32
|
+
# push to dockerhub
|
33
|
+
docker tag "${full_image_name}" "${REGISTRY}/${image_name}:${tag}"
|
34
|
+
docker push "${REGISTRY}/${image_name}:${tag}"
|
35
|
+
|
36
|
+
# push to internal registry
|
37
|
+
# necessary because some cyberark teams/networks can't pull from dockerhub
|
38
|
+
docker tag "${full_image_name}" "${INTERNAL_REGISTRY}/${image_name}:${tag}"
|
39
|
+
docker push "${INTERNAL_REGISTRY}/${image_name}:${tag}"
|
30
40
|
|
31
|
-
docker tag $full_image_name "$REGISTRY/$image_name:$tag"
|
32
|
-
docker push "$REGISTRY/$image_name:$tag"
|
33
41
|
done
|
34
42
|
|
35
43
|
# push to legacy `conjurinc/cli5` tag
|
36
|
-
docker tag $full_image_name conjurinc/cli5:latest
|
44
|
+
docker tag "${full_image_name}" conjurinc/cli5:latest
|
37
45
|
docker push conjurinc/cli5:latest
|
38
46
|
fi
|
data/spec/command/hosts_spec.rb
CHANGED
@@ -9,13 +9,19 @@ describe Conjur::Command::Hosts, logged_in: true do
|
|
9
9
|
expect(RestClient::Request).to receive(:execute).with({
|
10
10
|
method: :head,
|
11
11
|
url: "https://core.example.com/api/resources/#{account}/host/redis001",
|
12
|
-
headers: {
|
12
|
+
headers: {
|
13
|
+
authorization: "fakeauth",
|
14
|
+
},
|
15
|
+
username: "dknuth",
|
13
16
|
}).and_return true
|
14
17
|
expect(RestClient::Request).to receive(:execute).with({
|
15
18
|
method: :put,
|
16
19
|
url: "https://core.example.com/api/authn/#{account}/api_key?role=#{account}:host:redis001",
|
17
|
-
headers: {
|
18
|
-
|
20
|
+
headers: {
|
21
|
+
authorization: "fakeauth",
|
22
|
+
},
|
23
|
+
payload: '',
|
24
|
+
username: "dknuth",
|
19
25
|
}).and_return double(:response, body: 'new api key')
|
20
26
|
end
|
21
27
|
|
@@ -23,5 +29,19 @@ describe Conjur::Command::Hosts, logged_in: true do
|
|
23
29
|
invoke
|
24
30
|
end
|
25
31
|
end
|
32
|
+
|
33
|
+
describe_command 'host rotate_api_key --host non-existing' do
|
34
|
+
before do
|
35
|
+
expect(RestClient::Request).to receive(:execute).with({
|
36
|
+
method: :head,
|
37
|
+
url: "https://core.example.com/api/resources/#{account}/host/non-existing",
|
38
|
+
headers: {authorization: "fakeauth"},
|
39
|
+
username: username,
|
40
|
+
}).and_raise RestClient::ResourceNotFound
|
41
|
+
end
|
42
|
+
it 'rotate_api_key with non-existing --host option' do
|
43
|
+
expect { invoke }.to raise_error(GLI::CustomExit, /Host 'non-existing' not found/i)
|
44
|
+
end
|
45
|
+
end
|
26
46
|
end
|
27
47
|
end
|
data/spec/command/init_spec.rb
CHANGED
@@ -1,49 +1,46 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'highline'
|
3
3
|
|
4
|
-
GITHUB_FP = "SHA1 Fingerprint=
|
4
|
+
GITHUB_FP = "SHA1 Fingerprint=5F:3F:7A:C2:56:9F:50:A4:66:76:47:C6:A1:8C:A0:07:AA:ED:BB:8E"
|
5
5
|
GITHUB_CERT = <<EOF
|
6
6
|
-----BEGIN CERTIFICATE-----
|
7
|
-
|
7
|
+
MIIG1TCCBb2gAwIBAgIQBVfICygmg6F7ChFEkylreTANBgkqhkiG9w0BAQsFADBw
|
8
8
|
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUN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ltprwAABAMARjBEAiAuWGCWxN/M0Ms3KOsqFjDMHT8Aq0SlHfQ68KDg
|
32
|
+
rVU6AAIgDA+2EB0D5W5r0i4Nhljx6ABlIByzrEdfcxiOD/o6//EAdQAiRUUHWVUk
|
33
|
+
VpY/oS/x922G4CMmY63AS39dxoNcbuIPAgAAAXHmW2nTAAAEAwBGMEQCIBp+XQKa
|
34
|
+
UDiPHwjBxdv5qvgyALKaysKqMF60gqem8iPRAiAk9Dp5+VBUXfSHqyW+tVShUigh
|
35
|
+
ndopccf8Gs21KJ4jXgB2AFGjsPX9AXmcVm24N3iPDKR6zBsny/eeiEKaDf7UiwXl
|
36
|
+
AAABceZbahsAAAQDAEcwRQIgd/5HcxT4wfNV8zavwxjYkw2TYBAuRCcqp1SjWKFn
|
37
|
+
4EoCIQDHSTHxnbpxWFbP6v5Y6nGFZCDjaHgd9HrzUv2J/DaacDANBgkqhkiG9w0B
|
38
|
+
AQsFAAOCAQEAhjKPnBW4r+jR3gg6RA5xICTW/A5YMcyqtK0c1QzFr8S7/l+skGpC
|
39
|
+
yCHrJfFrLDeyKqgabvLRT6YvvM862MGfMMDsk+sKWtzLbDIcYG7sbviGpU+gtG1q
|
40
|
+
B0ohWNApfWWKyNpquqvwdSEzAEBvhcUT5idzbK7q45bQU9vBIWgQz+PYULAU7KmY
|
41
|
+
z7jOYV09o22TNMQT+hFmo92+EBlwSeIETYEsHy5ZxixTRTvu9hP00CyEbiht5OTK
|
42
|
+
5EiJG6vsIh/uEtRsdenMCxV06W2f20Af4iSFo0uk6c1ryHefh08FcwA4pSNUaPyi
|
43
|
+
Pb8YGQ6o/blejFzo/OSiUnDueafSJ0p6SQ==
|
47
44
|
EOF
|
48
45
|
|
49
46
|
describe Conjur::Command::Init do
|
data/spec/command/users_spec.rb
CHANGED
@@ -52,5 +52,18 @@ describe Conjur::Command::Users, logged_in: true do
|
|
52
52
|
invoke
|
53
53
|
end
|
54
54
|
end
|
55
|
+
describe_command 'user rotate_api_key --user non-existing' do
|
56
|
+
before do
|
57
|
+
expect(RestClient::Request).to receive(:execute).with({
|
58
|
+
method: :head,
|
59
|
+
url: "https://core.example.com/api/resources/#{account}/user/non-existing",
|
60
|
+
headers: {authorization: "fakeauth"},
|
61
|
+
username: username,
|
62
|
+
}).and_raise RestClient::ResourceNotFound
|
63
|
+
end
|
64
|
+
it 'rotate_api_key with non-existing --user option' do
|
65
|
+
expect { invoke }.to raise_error(GLI::CustomExit, /User 'non-existing' not found/i)
|
66
|
+
end
|
67
|
+
end
|
55
68
|
end
|
56
69
|
end
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conjur-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Kevin Gilpin
|
7
|
+
- Conjur Maintainers
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2020-
|
11
|
+
date: 2020-12-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activesupport
|
@@ -277,8 +276,7 @@ dependencies:
|
|
277
276
|
version: '0.18'
|
278
277
|
description:
|
279
278
|
email:
|
280
|
-
-
|
281
|
-
- kgilpin@conjur.net
|
279
|
+
- conj_maintainers@cyberark.com
|
282
280
|
executables:
|
283
281
|
- _conjur
|
284
282
|
- conjur
|
@@ -286,8 +284,10 @@ extensions: []
|
|
286
284
|
extra_rdoc_files: []
|
287
285
|
files:
|
288
286
|
- ".dockerignore"
|
287
|
+
- ".github/CODEOWNERS"
|
289
288
|
- ".github/ISSUE_TEMPLATE/bug.md"
|
290
289
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
290
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
291
291
|
- ".gitignore"
|
292
292
|
- ".gitleaks.toml"
|
293
293
|
- ".kateproject"
|
@@ -301,9 +301,11 @@ files:
|
|
301
301
|
- Humanfile.md
|
302
302
|
- Jenkinsfile
|
303
303
|
- LICENSE
|
304
|
+
- NOTICES.txt
|
304
305
|
- PUBLISH.md
|
305
306
|
- README.md
|
306
307
|
- Rakefile
|
308
|
+
- SECURITY.md
|
307
309
|
- VERSION
|
308
310
|
- bin/_conjur
|
309
311
|
- bin/conjur
|
@@ -410,9 +412,9 @@ files:
|
|
410
412
|
- spec/spec_helper.rb
|
411
413
|
- standalone.entrypoint
|
412
414
|
- test.sh
|
413
|
-
homepage: https://github.com/
|
415
|
+
homepage: https://github.com/cyberark/conjur-cli
|
414
416
|
licenses:
|
415
|
-
-
|
417
|
+
- Apache 2.0
|
416
418
|
metadata: {}
|
417
419
|
post_install_message:
|
418
420
|
rdoc_options: []
|
@@ -429,7 +431,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
429
431
|
- !ruby/object:Gem::Version
|
430
432
|
version: '0'
|
431
433
|
requirements: []
|
432
|
-
rubygems_version: 3.
|
434
|
+
rubygems_version: 3.1.2
|
433
435
|
signing_key:
|
434
436
|
specification_version: 4
|
435
437
|
summary: Conjur command line interface
|