conjur-cli 5.6.6 → 6.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.dockerignore +1 -1
- data/.gitignore +2 -0
- data/.rubocop.yml +1 -1
- data/APPLIANCE_VERSION +1 -1
- data/CHANGELOG.md +3 -42
- data/Gemfile +4 -7
- data/Humanfile.md +31 -0
- data/Jenkinsfile +34 -63
- data/README.md +41 -55
- data/Rakefile +5 -1
- data/bin/conjur +0 -2
- data/build-deb.sh +1 -3
- data/ci/cli-test.sh +6 -0
- data/ci/package.sh +3 -1
- data/ci/publish.sh +2 -2
- data/ci/secrets/publish.yml +2 -2
- data/ci/wait_for_server.sh +10 -0
- data/conjur-cli.gemspec +7 -7
- data/dev/docker-compose.yml +24 -0
- data/dev/start.sh +15 -0
- data/dev/stop.sh +5 -0
- data/docker-compose.yml +30 -0
- data/features/authentication/authenticate.feature +34 -0
- data/features/authentication/login.feature +13 -0
- data/features/authentication/logout.feature +15 -0
- data/{acceptance-features → features}/authentication/whoami.feature +0 -0
- data/features/authorization/resource/annotate.feature +22 -0
- data/features/authorization/resource/check.feature +47 -0
- data/{acceptance-features → features}/authorization/resource/exists.feature +18 -6
- data/features/authorization/resource/permitted_roles.feature +35 -0
- data/features/authorization/resource/show.feature +34 -0
- data/features/authorization/role/exists.feature +28 -0
- data/features/authorization/role/members.feature +45 -0
- data/features/authorization/role/memberships.feature +43 -0
- data/features/conjurenv/check.feature +34 -0
- data/features/conjurenv/run.feature +15 -0
- data/{acceptance-features → features}/conjurenv/template.feature +8 -3
- data/{acceptance-features → features}/directory/user/update_password.feature +8 -2
- data/{acceptance-features → features}/directory/variable/value.feature +9 -5
- data/{acceptance-features → features}/directory/variable/values-add.feature +8 -3
- data/features/hostfactory/tokens.feature +22 -0
- data/features/pubkeys/show.feature +18 -0
- data/features/step_definitions/authn_steps.rb +22 -0
- data/features/step_definitions/cli_steps.rb +28 -0
- data/features/step_definitions/file_steps.rb +12 -0
- data/features/step_definitions/flow_control_steps.rb +7 -0
- data/features/step_definitions/graph_steps.rb +4 -3
- data/{acceptance-features → features}/step_definitions/http_steps.rb +0 -0
- data/features/step_definitions/overrides.rb +9 -0
- data/features/step_definitions/policy_steps.rb +11 -0
- data/{acceptance-features → features}/step_definitions/trusted_proxy_steps.rb +0 -0
- data/features/support/blank.yml +1 -0
- data/features/support/env.rb +21 -7
- data/features/support/hooks.rb +31 -116
- data/features/support/world.rb +16 -76
- data/jenkins.sh +33 -0
- data/lib/conjur/authenticator.rb +83 -0
- data/lib/conjur/authn.rb +5 -20
- data/lib/conjur/cli.rb +13 -6
- data/lib/conjur/command.rb +30 -350
- data/lib/conjur/command/authn.rb +23 -15
- data/lib/conjur/command/host_factories.rb +2 -74
- data/lib/conjur/command/hosts.rb +6 -113
- data/lib/conjur/command/init.rb +20 -35
- data/lib/conjur/command/{secrets.rb → policies.rb} +33 -22
- data/lib/conjur/command/pubkeys.rb +3 -63
- data/lib/conjur/command/resources.rb +45 -162
- data/lib/conjur/command/roles.rb +11 -181
- data/lib/conjur/command/rspec/helpers.rb +0 -1
- data/lib/conjur/command/rspec/mock_services.rb +4 -4
- data/lib/conjur/command/users.rb +2 -159
- data/lib/conjur/command/variables.rb +5 -218
- data/lib/conjur/complete.rb +2 -2
- data/lib/conjur/config.rb +1 -11
- data/lib/conjur/conjurenv.rb +12 -9
- data/lib/conjur/identifier_manipulation.rb +3 -5
- data/lib/conjur/version.rb +2 -2
- data/{publish-rubygem.sh → publish.sh} +0 -4
- data/spec/authn_spec.rb +4 -0
- data/spec/command/hosts_spec.rb +2 -69
- data/spec/command/init_spec.rb +16 -11
- data/spec/command/pubkeys_spec.rb +1 -46
- data/spec/command/resources_spec.rb +21 -170
- data/spec/command/roles_spec.rb +5 -181
- data/spec/command/users_spec.rb +3 -79
- data/spec/command_spec.rb +1 -20
- data/spec/complete_spec.rb +1 -23
- data/spec/config_spec.rb +1 -1
- data/spec/spec_helper.rb +4 -5
- data/test.sh +29 -25
- metadata +92 -212
- data/.githooks/pre_commit/run_specs.rb +0 -23
- data/Dockerfile +0 -15
- data/Dockerfile.fpm +0 -18
- data/Dockerfile.publish +0 -12
- data/Dockerfile.standalone +0 -33
- data/Dockerfile.validate-packaging +0 -9
- data/VERSION +0 -1
- data/acceptance-features/audit/audit_event_send.feature +0 -107
- data/acceptance-features/audit/fetch.feature +0 -16
- data/acceptance-features/audit/send.feature +0 -51
- data/acceptance-features/authentication/authenticate.feature +0 -10
- data/acceptance-features/authentication/login.feature +0 -12
- data/acceptance-features/authentication/logout.feature +0 -13
- data/acceptance-features/authorization/resource/annotate.feature +0 -35
- data/acceptance-features/authorization/resource/check.feature +0 -24
- data/acceptance-features/authorization/resource/create.feature +0 -21
- data/acceptance-features/authorization/resource/deny.feature +0 -12
- data/acceptance-features/authorization/resource/give.feature +0 -24
- data/acceptance-features/authorization/resource/permit.feature +0 -20
- data/acceptance-features/authorization/resource/permitted_roles.feature +0 -16
- data/acceptance-features/authorization/resource/show.feature +0 -28
- data/acceptance-features/authorization/role/create.feature +0 -13
- data/acceptance-features/authorization/role/exists.feature +0 -19
- data/acceptance-features/authorization/role/grant_to.feature +0 -21
- data/acceptance-features/authorization/role/graph.feature +0 -57
- data/acceptance-features/authorization/role/members.feature +0 -23
- data/acceptance-features/authorization/role/memberships.feature +0 -27
- data/acceptance-features/bootstrap.feature +0 -13
- data/acceptance-features/conjurenv/check.feature +0 -21
- data/acceptance-features/conjurenv/run.feature +0 -10
- data/acceptance-features/directory/group/create.feature +0 -20
- data/acceptance-features/directory/group/retire.feature +0 -54
- data/acceptance-features/directory/host/create.feature +0 -23
- data/acceptance-features/directory/host/retire.feature +0 -6
- data/acceptance-features/directory/hostfactory/create.feature +0 -28
- data/acceptance-features/directory/hostfactory/tokens.feature +0 -16
- data/acceptance-features/directory/layer/create.feature +0 -10
- data/acceptance-features/directory/layer/hosts-add.feature +0 -9
- data/acceptance-features/directory/layer/hosts-remove.feature +0 -10
- data/acceptance-features/directory/layer/retire.feature +0 -43
- data/acceptance-features/directory/user/create.feature +0 -23
- data/acceptance-features/directory/user/retire.feature +0 -6
- data/acceptance-features/directory/variable/create.feature +0 -14
- data/acceptance-features/directory/variable/retire.feature +0 -17
- data/acceptance-features/dsl/policy_owner.feature +0 -45
- data/acceptance-features/dsl/resource_owner.feature +0 -17
- data/acceptance-features/dsl/retire.feature +0 -15
- data/acceptance-features/global-privilege/elevate.feature +0 -20
- data/acceptance-features/global-privilege/reveal.privilege +0 -20
- data/acceptance-features/pubkeys/add.feature +0 -22
- data/acceptance-features/pubkeys/delete.feature +0 -9
- data/acceptance-features/pubkeys/names.feature +0 -26
- data/acceptance-features/pubkeys/show.feature +0 -27
- data/acceptance-features/step_definitions/cli_steps.rb +0 -57
- data/acceptance-features/step_definitions/graph_steps.rb +0 -22
- data/acceptance-features/step_definitions/user_steps.rb +0 -51
- data/acceptance-features/support/env.rb +0 -23
- data/acceptance-features/support/hooks.rb +0 -178
- data/acceptance-features/support/world.rb +0 -176
- data/acceptance-features/trusted_proxies.feature +0 -82
- data/bin/conjurize +0 -26
- data/bin/jsonfield +0 -70
- data/build-standalone +0 -6
- data/deprecations.sh +0 -38
- data/features/conjurize.feature +0 -134
- data/features/dsl_context.feature +0 -36
- data/features/dsl_host_create.feature +0 -11
- data/features/dsl_ownership.feature +0 -30
- data/features/dsl_permission.feature +0 -45
- data/features/dsl_resource_create.feature +0 -23
- data/features/dsl_role_create.feature +0 -11
- data/features/dsl_user_create.feature +0 -23
- data/features/jsonfield.feature +0 -49
- data/features/role_graph.feature +0 -58
- data/features/step_definitions/conjurize_steps.rb +0 -5
- data/features/step_definitions/dsl_steps.rb +0 -52
- data/features/support/conjur.conf +0 -6
- data/lib/conjur/command/assets.rb +0 -121
- data/lib/conjur/command/audit.rb +0 -155
- data/lib/conjur/command/bootstrap.rb +0 -129
- data/lib/conjur/command/dsl_command.rb +0 -75
- data/lib/conjur/command/elevate.rb +0 -76
- data/lib/conjur/command/field.rb +0 -45
- data/lib/conjur/command/groups.rb +0 -208
- data/lib/conjur/command/ids.rb +0 -34
- data/lib/conjur/command/layers.rb +0 -211
- data/lib/conjur/command/ldapsync.rb +0 -118
- data/lib/conjur/command/rspec/audit_helpers.rb +0 -68
- data/lib/conjur/command/rubydsl.rb +0 -93
- data/lib/conjur/command/script.rb +0 -48
- data/lib/conjur/command/server.rb +0 -67
- data/lib/conjur/conjurize.rb +0 -71
- data/lib/conjur/conjurize/script.rb +0 -150
- data/lib/conjur/dsl/runner.rb +0 -273
- data/publish-deb.sh +0 -6
- data/push-image +0 -29
- data/spec/command/assets_spec.rb +0 -115
- data/spec/command/audit_spec.rb +0 -376
- data/spec/command/elevate_spec.rb +0 -28
- data/spec/command/env_spec.rb +0 -168
- data/spec/command/groups_spec.rb +0 -77
- data/spec/command/host_factories_spec.rb +0 -38
- data/spec/command/layers_spec.rb +0 -35
- data/spec/command/ldapsync_spec.rb +0 -28
- data/spec/command/rubydsl_spec.rb +0 -63
- data/spec/command/variable_expiration_spec.rb +0 -164
- data/spec/command/variables_spec.rb +0 -192
- data/spec/conjurize/script_spec.rb +0 -62
- data/spec/conjurize_spec.rb +0 -70
- data/spec/dsl/runner_spec.rb +0 -93
- data/spec/env_spec.rb +0 -214
data/bin/conjurize
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2013 Conjur Inc
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
# this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
# the Software without restriction, including without limitation the rights to
|
|
8
|
-
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
# the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
# subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
require 'active_support'
|
|
24
|
-
require 'conjur/conjurize'
|
|
25
|
-
|
|
26
|
-
Conjur::Conjurize.go!
|
data/bin/jsonfield
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2013 Conjur Inc
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
# this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
# the Software without restriction, including without limitation the rights to
|
|
8
|
-
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
# the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
# subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
require 'json'
|
|
24
|
-
require 'methadone'
|
|
25
|
-
|
|
26
|
-
class JsonField
|
|
27
|
-
include Methadone::Main
|
|
28
|
-
include Methadone::CLILogging
|
|
29
|
-
|
|
30
|
-
description "parse JSON and extract a field value"
|
|
31
|
-
arg :json_path, "path to object to extract, eg. 'headers.0' or 'document.author.name'"
|
|
32
|
-
arg :json, :optional, "data to parse (reads from stdin if not given)"
|
|
33
|
-
|
|
34
|
-
main do |path, input = nil|
|
|
35
|
-
input ||= STDIN.read
|
|
36
|
-
data = JSON.parse input
|
|
37
|
-
result = data.extract_field *(path.split '.', -1)
|
|
38
|
-
puts result
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
class Hash
|
|
43
|
-
def extract_field head = nil, *tail
|
|
44
|
-
return self unless head
|
|
45
|
-
field_not_found! head unless has_key? head
|
|
46
|
-
self[head].extract_field *tail
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
class Array
|
|
51
|
-
def extract_field head = nil, *tail
|
|
52
|
-
return self unless head
|
|
53
|
-
index = Integer(head) rescue field_not_found!(head)
|
|
54
|
-
field_not_found! index if index >= size
|
|
55
|
-
self[index].extract_field *tail
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
class Object
|
|
60
|
-
def extract_field head = nil, *tail
|
|
61
|
-
field_not_found! head if head
|
|
62
|
-
self
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def field_not_found! field
|
|
66
|
-
raise Methadone::Error.new(2, "No field #{field} in #{inspect}")
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
JsonField.go!
|
data/build-standalone
DELETED
data/deprecations.sh
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
searchstring='DEPRECATED'
|
|
4
|
-
|
|
5
|
-
function bundleexec {
|
|
6
|
-
bundle exec "$@" 2> /dev/null
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
echo "Planned deprecations for Conjur CLI"
|
|
10
|
-
echo "-----"
|
|
11
|
-
|
|
12
|
-
echo "group"
|
|
13
|
-
bundleexec conjur group | grep "$searchstring"
|
|
14
|
-
echo "group members"
|
|
15
|
-
bundleexec conjur group members | grep "$searchstring"
|
|
16
|
-
|
|
17
|
-
echo "hostfactory"
|
|
18
|
-
bundleexec conjur hostfactory | grep "$searchstring"
|
|
19
|
-
|
|
20
|
-
echo "host"
|
|
21
|
-
bundleexec conjur host | grep "$searchstring"
|
|
22
|
-
|
|
23
|
-
echo "layer"
|
|
24
|
-
bundleexec conjur layer | grep "$searchstring"
|
|
25
|
-
echo "layer hosts"
|
|
26
|
-
bundleexec conjur layer hosts | grep "$searchstring"
|
|
27
|
-
|
|
28
|
-
echo "resource"
|
|
29
|
-
bundleexec conjur resource | grep "$searchstring"
|
|
30
|
-
|
|
31
|
-
echo "role"
|
|
32
|
-
bundleexec conjur role | grep "$searchstring"
|
|
33
|
-
|
|
34
|
-
echo "user"
|
|
35
|
-
bundleexec conjur user | grep "$searchstring"
|
|
36
|
-
|
|
37
|
-
echo "variable"
|
|
38
|
-
bundleexec conjur variable | grep "$searchstring"
|
data/features/conjurize.feature
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
Feature: conjurize program generates install scripts
|
|
2
|
-
|
|
3
|
-
Scenario: App just runs
|
|
4
|
-
When I get help for "conjurize"
|
|
5
|
-
Then the exit status should be 0
|
|
6
|
-
And the banner should be present
|
|
7
|
-
And the banner should document that this app takes options
|
|
8
|
-
And the following options should be documented:
|
|
9
|
-
|--version|
|
|
10
|
-
And the banner should document that this app takes no arguments
|
|
11
|
-
|
|
12
|
-
Scenario: Minimal conjurize script
|
|
13
|
-
When I conjurize ""
|
|
14
|
-
Then the stdout should contain:
|
|
15
|
-
"""
|
|
16
|
-
#!/bin/sh
|
|
17
|
-
set -e
|
|
18
|
-
|
|
19
|
-
# Implementation note: 'tee' is used as a sudo-friendly 'cat' to populate a file with the contents provided below.
|
|
20
|
-
|
|
21
|
-
tee /etc/conjur.conf > /dev/null << EOF
|
|
22
|
-
account: test
|
|
23
|
-
appliance_url: https://conjur/api
|
|
24
|
-
cert_file: /etc/conjur-test.pem
|
|
25
|
-
netrc_path: /etc/conjur.identity
|
|
26
|
-
plugins: []
|
|
27
|
-
EOF
|
|
28
|
-
|
|
29
|
-
tee /etc/conjur-test.pem > /dev/null << EOF
|
|
30
|
-
-----BEGIN CERTIFICATE-----
|
|
31
|
-
MIIDZTCCAk2gAwIBAgIJAMzfPBZBq82XMA0GCSqGSIb3DQEBBQUAMDMxMTAvBgNV
|
|
32
|
-
BAMTKGVjMi01NC04My05OS0xMzUuY29tcHV0ZS0xLmFtYXpvbmF3cy5jb20wHhcN
|
|
33
|
-
MTQxMTIxMTUxNDE0WhcNMjQxMTE4MTUxNDE0WjAzMTEwLwYDVQQDEyhlYzItNTQt
|
|
34
|
-
ODMtOTktMTM1LmNvbXB1dGUtMS5hbWF6b25hd3MuY29tMIIBIjANBgkqhkiG9w0B
|
|
35
|
-
AQEFAAOCAQ8AMIIBCgKCAQEAlkhRt1pvOkw1JTtvmfa3lHpT00g0lbBnShN5cKI3
|
|
36
|
-
cT1Na3aGdosPDfn0z+A6GNT2sUcdsc5RLkrZKG2+57B5hyUtdwRoJoTTBqypxJTc
|
|
37
|
-
vkeMpCrcaeY8Ye0zsoBNaeauXLPobtEV4I6IadJGuT2AKILTJLDYdyV4dg2/zN2z
|
|
38
|
-
XmW+9FsDs+aJKtWnpBIkvXcCqbaIgRZSxFNeZUF+xDrZdCRm+qkBXZaMFQzLU0BT
|
|
39
|
-
B239Lmpwp54zsBoTBY9JBS4Atmrwt3YE3JqcIH77GpkgXSx203bYVp0jF3vPxHLU
|
|
40
|
-
bSqhV9Zw7m6V8uF+jvOdrDiZ33OJN9yx6nS+c7NfOyRgGQIDAQABo3wwejB4BgNV
|
|
41
|
-
HREEcTBvgglsb2NhbGhvc3SCBmNvbmp1coIVY29uanVyLWRldi5jb25qdXIubmV0
|
|
42
|
-
ghljb25qdXItZGV2Lml0ZC5jb25qdXIubmV0gihlYzItNTQtODMtOTktMTM1LmNv
|
|
43
|
-
bXB1dGUtMS5hbWF6b25hd3MuY29tMA0GCSqGSIb3DQEBBQUAA4IBAQB+alzAA3ek
|
|
44
|
-
o8QrnoDuWOxTqD0XIwzqux6BM/nM4dZX6drr+D0y8QtMKLZNODazvFCJWNHAWWmD
|
|
45
|
-
FkRudwl3G1Qs56AB+LnQ2jhL5Qf78Rl2vYvdmo8iowEpOBajvzEMLsEaRNmwmSGc
|
|
46
|
-
yvml0YdVSiMdTdIk58qG84pkmteSX9VYE1IF7xfWb3ji8292fm5q6cgqFLNYx2MI
|
|
47
|
-
5UyfyroGMJ2ikzTGS64TpCmi/n1sjl2iM+/QmkHVc3KUIdwAY2NttyZ2pZo2J4i6
|
|
48
|
-
MVs0y+HobWbOKKhyfxpMT59dJxGu21QPbWfQLkHCCOlo2P4z9oku23sbvQQ7CbvS
|
|
49
|
-
VoykXurdaZo9
|
|
50
|
-
-----END CERTIFICATE-----
|
|
51
|
-
EOF
|
|
52
|
-
|
|
53
|
-
touch /etc/conjur.identity
|
|
54
|
-
chmod 600 /etc/conjur.identity
|
|
55
|
-
tee /etc/conjur.identity > /dev/null << EOF
|
|
56
|
-
machine https://conjur/api/authn
|
|
57
|
-
login host/ec2/i-eaa5f700
|
|
58
|
-
password 3a4rb19rpjejr89h6r29kd2fb3808cpy
|
|
59
|
-
EOF
|
|
60
|
-
"""
|
|
61
|
-
|
|
62
|
-
Scenario: conjurize with SSH installation
|
|
63
|
-
When I conjurize "--ssh"
|
|
64
|
-
Then the stdout should contain:
|
|
65
|
-
"""
|
|
66
|
-
#!/bin/sh
|
|
67
|
-
set -e
|
|
68
|
-
|
|
69
|
-
# Implementation note: 'tee' is used as a sudo-friendly 'cat' to populate a file with the contents provided below.
|
|
70
|
-
|
|
71
|
-
tee /etc/conjur.conf > /dev/null << EOF
|
|
72
|
-
account: test
|
|
73
|
-
appliance_url: https://conjur/api
|
|
74
|
-
cert_file: /etc/conjur-test.pem
|
|
75
|
-
netrc_path: /etc/conjur.identity
|
|
76
|
-
plugins: []
|
|
77
|
-
EOF
|
|
78
|
-
|
|
79
|
-
tee /etc/conjur-test.pem > /dev/null << EOF
|
|
80
|
-
-----BEGIN CERTIFICATE-----
|
|
81
|
-
MIIDZTCCAk2gAwIBAgIJAMzfPBZBq82XMA0GCSqGSIb3DQEBBQUAMDMxMTAvBgNV
|
|
82
|
-
BAMTKGVjMi01NC04My05OS0xMzUuY29tcHV0ZS0xLmFtYXpvbmF3cy5jb20wHhcN
|
|
83
|
-
MTQxMTIxMTUxNDE0WhcNMjQxMTE4MTUxNDE0WjAzMTEwLwYDVQQDEyhlYzItNTQt
|
|
84
|
-
ODMtOTktMTM1LmNvbXB1dGUtMS5hbWF6b25hd3MuY29tMIIBIjANBgkqhkiG9w0B
|
|
85
|
-
AQEFAAOCAQ8AMIIBCgKCAQEAlkhRt1pvOkw1JTtvmfa3lHpT00g0lbBnShN5cKI3
|
|
86
|
-
cT1Na3aGdosPDfn0z+A6GNT2sUcdsc5RLkrZKG2+57B5hyUtdwRoJoTTBqypxJTc
|
|
87
|
-
vkeMpCrcaeY8Ye0zsoBNaeauXLPobtEV4I6IadJGuT2AKILTJLDYdyV4dg2/zN2z
|
|
88
|
-
XmW+9FsDs+aJKtWnpBIkvXcCqbaIgRZSxFNeZUF+xDrZdCRm+qkBXZaMFQzLU0BT
|
|
89
|
-
B239Lmpwp54zsBoTBY9JBS4Atmrwt3YE3JqcIH77GpkgXSx203bYVp0jF3vPxHLU
|
|
90
|
-
bSqhV9Zw7m6V8uF+jvOdrDiZ33OJN9yx6nS+c7NfOyRgGQIDAQABo3wwejB4BgNV
|
|
91
|
-
HREEcTBvgglsb2NhbGhvc3SCBmNvbmp1coIVY29uanVyLWRldi5jb25qdXIubmV0
|
|
92
|
-
ghljb25qdXItZGV2Lml0ZC5jb25qdXIubmV0gihlYzItNTQtODMtOTktMTM1LmNv
|
|
93
|
-
bXB1dGUtMS5hbWF6b25hd3MuY29tMA0GCSqGSIb3DQEBBQUAA4IBAQB+alzAA3ek
|
|
94
|
-
o8QrnoDuWOxTqD0XIwzqux6BM/nM4dZX6drr+D0y8QtMKLZNODazvFCJWNHAWWmD
|
|
95
|
-
FkRudwl3G1Qs56AB+LnQ2jhL5Qf78Rl2vYvdmo8iowEpOBajvzEMLsEaRNmwmSGc
|
|
96
|
-
yvml0YdVSiMdTdIk58qG84pkmteSX9VYE1IF7xfWb3ji8292fm5q6cgqFLNYx2MI
|
|
97
|
-
5UyfyroGMJ2ikzTGS64TpCmi/n1sjl2iM+/QmkHVc3KUIdwAY2NttyZ2pZo2J4i6
|
|
98
|
-
MVs0y+HobWbOKKhyfxpMT59dJxGu21QPbWfQLkHCCOlo2P4z9oku23sbvQQ7CbvS
|
|
99
|
-
VoykXurdaZo9
|
|
100
|
-
-----END CERTIFICATE-----
|
|
101
|
-
EOF
|
|
102
|
-
|
|
103
|
-
touch /etc/conjur.identity
|
|
104
|
-
chmod 600 /etc/conjur.identity
|
|
105
|
-
tee /etc/conjur.identity > /dev/null << EOF
|
|
106
|
-
machine https://conjur/api/authn
|
|
107
|
-
login host/ec2/i-eaa5f700
|
|
108
|
-
password 3a4rb19rpjejr89h6r29kd2fb3808cpy
|
|
109
|
-
EOF
|
|
110
|
-
|
|
111
|
-
curl -L https://www.opscode.com/chef/install.sh | bash
|
|
112
|
-
"""
|
|
113
|
-
And the output should match:
|
|
114
|
-
"""
|
|
115
|
-
chef-solo --recipe-url https:\/\/github.com\/conjur-cookbooks\/conjur\/releases\/download/v\d\.\d\.\d/conjur-v\d\.\d\.\d.tar.gz -o conjur
|
|
116
|
-
"""
|
|
117
|
-
|
|
118
|
-
Scenario: conjurize with arbitrary cookbook
|
|
119
|
-
When I conjurize "--conjur-cookbook-url https://example.com --conjur-run-list fry"
|
|
120
|
-
Then the stdout should contain "chef-solo --recipe-url https://example.com -o fry"
|
|
121
|
-
|
|
122
|
-
Scenario: conjurize with path to chef-solo
|
|
123
|
-
When I conjurize "--chef-executable /path/to/chef-solo --conjur-cookbook-url https://example.com --conjur-run-list fry"
|
|
124
|
-
Then the stdout should contain "/path/to/chef-solo --recipe-url https://example.com -o fry"
|
|
125
|
-
And the stdout should not contain "curl -L https://www.opscode.com/chef/install.sh"
|
|
126
|
-
|
|
127
|
-
Scenario: conjurize with sudo-ized commands
|
|
128
|
-
When I conjurize "--sudo --ssh"
|
|
129
|
-
Then the stdout should contain "sudo -n tee /etc/conjur.conf > /dev/null << EOF"
|
|
130
|
-
And the stdout should contain "sudo -n tee /etc/conjur-test.pem > /dev/null << EOF"
|
|
131
|
-
And the stdout should contain "sudo -n tee /etc/conjur.identity > /dev/null << EOF"
|
|
132
|
-
And the stdout should contain "sudo -n chmod 600 /etc/conjur.identity"
|
|
133
|
-
And the stdout should contain "curl -L https://www.opscode.com/chef/install.sh | sudo -n bash"
|
|
134
|
-
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
@dsl
|
|
2
|
-
Feature: Saving and restoring context
|
|
3
|
-
|
|
4
|
-
Background:
|
|
5
|
-
|
|
6
|
-
Scenario: Environment and api keys are saved in the context
|
|
7
|
-
When I run script:
|
|
8
|
-
"""
|
|
9
|
-
namespace do
|
|
10
|
-
user "bob"
|
|
11
|
-
end
|
|
12
|
-
"""
|
|
13
|
-
Then the context should contain "env"
|
|
14
|
-
And the context should contain "namespace"
|
|
15
|
-
And the context should contain "stack"
|
|
16
|
-
And the context should contain "account"
|
|
17
|
-
And the context should contain "api_keys"
|
|
18
|
-
And the context "api_keys" should contain "1" item
|
|
19
|
-
|
|
20
|
-
Scenario: API keys are restored from the context
|
|
21
|
-
When I use script context:
|
|
22
|
-
"""
|
|
23
|
-
{
|
|
24
|
-
"namespace": "foobar",
|
|
25
|
-
"api_keys": [
|
|
26
|
-
"the-api-key"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
"""
|
|
30
|
-
And I run script:
|
|
31
|
-
"""
|
|
32
|
-
namespace
|
|
33
|
-
"""
|
|
34
|
-
Then the context "namespace" should be "foobar"
|
|
35
|
-
And the context "api_keys" should contain "1" item
|
|
36
|
-
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
@dsl
|
|
2
|
-
Feature: Assigning ownership
|
|
3
|
-
|
|
4
|
-
Background:
|
|
5
|
-
|
|
6
|
-
Scenario: Create without ownership
|
|
7
|
-
When I run script:
|
|
8
|
-
"""
|
|
9
|
-
role "user", "bob"
|
|
10
|
-
"""
|
|
11
|
-
Then the "role" "cucumber:user:bob" should not have an owner
|
|
12
|
-
|
|
13
|
-
Scenario: Create with explicit ownership
|
|
14
|
-
When I run script:
|
|
15
|
-
"""
|
|
16
|
-
role "user", "bob", ownerid: "foobar"
|
|
17
|
-
"""
|
|
18
|
-
Then the "role" "cucumber:user:bob" should be owned by "foobar"
|
|
19
|
-
|
|
20
|
-
Scenario: Create with scoped ownership
|
|
21
|
-
When I run script:
|
|
22
|
-
"""
|
|
23
|
-
role "user", "bob" do
|
|
24
|
-
owns do
|
|
25
|
-
resource "food", "bacon"
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
"""
|
|
29
|
-
Then the "resource" "cucumber:food:bacon" should be owned by "cucumber:user:bob"
|
|
30
|
-
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
@dsl
|
|
2
|
-
Feature: Manpipulating permissions
|
|
3
|
-
|
|
4
|
-
Background:
|
|
5
|
-
|
|
6
|
-
Scenario: Permit using Role#can
|
|
7
|
-
When I run script:
|
|
8
|
-
"""
|
|
9
|
-
bacon = resource "food", "bacon"
|
|
10
|
-
role "user", "bob" do
|
|
11
|
-
can "fry", bacon
|
|
12
|
-
end
|
|
13
|
-
"""
|
|
14
|
-
Then "cucumber:user:bob" can "fry" "cucumber:food:bacon"
|
|
15
|
-
|
|
16
|
-
Scenario: Permit using Role#can with grant option
|
|
17
|
-
When I run script:
|
|
18
|
-
"""
|
|
19
|
-
bacon = resource "food", "bacon"
|
|
20
|
-
role "user", "bob" do
|
|
21
|
-
can "fry", bacon, grant_option: true
|
|
22
|
-
end
|
|
23
|
-
"""
|
|
24
|
-
Then "cucumber:user:bob" can "fry" "cucumber:food:bacon" with grant option
|
|
25
|
-
|
|
26
|
-
Scenario: Permit using Resource#permit
|
|
27
|
-
When I run script:
|
|
28
|
-
"""
|
|
29
|
-
bob = role "user", "bob"
|
|
30
|
-
resource "food", "bacon" do
|
|
31
|
-
permit "fry", bob
|
|
32
|
-
end
|
|
33
|
-
"""
|
|
34
|
-
Then "cucumber:user:bob" can "fry" "cucumber:food:bacon"
|
|
35
|
-
|
|
36
|
-
Scenario: Permit using Resource#permit with grant option
|
|
37
|
-
When I run script:
|
|
38
|
-
"""
|
|
39
|
-
bob = role "user", "bob"
|
|
40
|
-
resource "food", "bacon" do
|
|
41
|
-
permit "fry", bob, grant_option: true
|
|
42
|
-
end
|
|
43
|
-
"""
|
|
44
|
-
Then "cucumber:user:bob" can "fry" "cucumber:food:bacon" with grant option
|
|
45
|
-
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
@dsl
|
|
2
|
-
Feature: Creating a resource
|
|
3
|
-
|
|
4
|
-
Background:
|
|
5
|
-
|
|
6
|
-
Scenario: Create with simple kind and id
|
|
7
|
-
When I run script:
|
|
8
|
-
"""
|
|
9
|
-
resource "food", "bacon"
|
|
10
|
-
"""
|
|
11
|
-
Then the model should contain "resource" "cucumber:food:bacon"
|
|
12
|
-
|
|
13
|
-
Scenario: Create with scope
|
|
14
|
-
When I run script:
|
|
15
|
-
"""
|
|
16
|
-
scope "test" do
|
|
17
|
-
resource "food", "bacon"
|
|
18
|
-
end
|
|
19
|
-
resource "food", "eggs"
|
|
20
|
-
"""
|
|
21
|
-
Then the model should contain "resource" "cucumber:food:test/bacon"
|
|
22
|
-
And the model should contain "resource" "cucumber:food:eggs"
|
|
23
|
-
|