conjur-cli 5.6.6 → 6.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +5 -5
  2. data/.dockerignore +1 -1
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +1 -1
  5. data/APPLIANCE_VERSION +1 -1
  6. data/CHANGELOG.md +3 -42
  7. data/Gemfile +4 -7
  8. data/Humanfile.md +31 -0
  9. data/Jenkinsfile +34 -63
  10. data/README.md +41 -55
  11. data/Rakefile +5 -1
  12. data/bin/conjur +0 -2
  13. data/build-deb.sh +1 -3
  14. data/ci/cli-test.sh +6 -0
  15. data/ci/package.sh +3 -1
  16. data/ci/publish.sh +2 -2
  17. data/ci/secrets/publish.yml +2 -2
  18. data/ci/wait_for_server.sh +10 -0
  19. data/conjur-cli.gemspec +7 -7
  20. data/dev/docker-compose.yml +24 -0
  21. data/dev/start.sh +15 -0
  22. data/dev/stop.sh +5 -0
  23. data/docker-compose.yml +30 -0
  24. data/features/authentication/authenticate.feature +34 -0
  25. data/features/authentication/login.feature +13 -0
  26. data/features/authentication/logout.feature +15 -0
  27. data/{acceptance-features → features}/authentication/whoami.feature +0 -0
  28. data/features/authorization/resource/annotate.feature +22 -0
  29. data/features/authorization/resource/check.feature +47 -0
  30. data/{acceptance-features → features}/authorization/resource/exists.feature +18 -6
  31. data/features/authorization/resource/permitted_roles.feature +35 -0
  32. data/features/authorization/resource/show.feature +34 -0
  33. data/features/authorization/role/exists.feature +28 -0
  34. data/features/authorization/role/members.feature +45 -0
  35. data/features/authorization/role/memberships.feature +43 -0
  36. data/features/conjurenv/check.feature +34 -0
  37. data/features/conjurenv/run.feature +15 -0
  38. data/{acceptance-features → features}/conjurenv/template.feature +8 -3
  39. data/{acceptance-features → features}/directory/user/update_password.feature +8 -2
  40. data/{acceptance-features → features}/directory/variable/value.feature +9 -5
  41. data/{acceptance-features → features}/directory/variable/values-add.feature +8 -3
  42. data/features/hostfactory/tokens.feature +22 -0
  43. data/features/pubkeys/show.feature +18 -0
  44. data/features/step_definitions/authn_steps.rb +22 -0
  45. data/features/step_definitions/cli_steps.rb +28 -0
  46. data/features/step_definitions/file_steps.rb +12 -0
  47. data/features/step_definitions/flow_control_steps.rb +7 -0
  48. data/features/step_definitions/graph_steps.rb +4 -3
  49. data/{acceptance-features → features}/step_definitions/http_steps.rb +0 -0
  50. data/features/step_definitions/overrides.rb +9 -0
  51. data/features/step_definitions/policy_steps.rb +11 -0
  52. data/{acceptance-features → features}/step_definitions/trusted_proxy_steps.rb +0 -0
  53. data/features/support/blank.yml +1 -0
  54. data/features/support/env.rb +21 -7
  55. data/features/support/hooks.rb +31 -116
  56. data/features/support/world.rb +16 -76
  57. data/jenkins.sh +33 -0
  58. data/lib/conjur/authenticator.rb +83 -0
  59. data/lib/conjur/authn.rb +5 -20
  60. data/lib/conjur/cli.rb +13 -6
  61. data/lib/conjur/command.rb +30 -350
  62. data/lib/conjur/command/authn.rb +23 -15
  63. data/lib/conjur/command/host_factories.rb +2 -74
  64. data/lib/conjur/command/hosts.rb +6 -113
  65. data/lib/conjur/command/init.rb +20 -35
  66. data/lib/conjur/command/{secrets.rb → policies.rb} +33 -22
  67. data/lib/conjur/command/pubkeys.rb +3 -63
  68. data/lib/conjur/command/resources.rb +45 -162
  69. data/lib/conjur/command/roles.rb +11 -181
  70. data/lib/conjur/command/rspec/helpers.rb +0 -1
  71. data/lib/conjur/command/rspec/mock_services.rb +4 -4
  72. data/lib/conjur/command/users.rb +2 -159
  73. data/lib/conjur/command/variables.rb +5 -218
  74. data/lib/conjur/complete.rb +2 -2
  75. data/lib/conjur/config.rb +1 -11
  76. data/lib/conjur/conjurenv.rb +12 -9
  77. data/lib/conjur/identifier_manipulation.rb +3 -5
  78. data/lib/conjur/version.rb +2 -2
  79. data/{publish-rubygem.sh → publish.sh} +0 -4
  80. data/spec/authn_spec.rb +4 -0
  81. data/spec/command/hosts_spec.rb +2 -69
  82. data/spec/command/init_spec.rb +16 -11
  83. data/spec/command/pubkeys_spec.rb +1 -46
  84. data/spec/command/resources_spec.rb +21 -170
  85. data/spec/command/roles_spec.rb +5 -181
  86. data/spec/command/users_spec.rb +3 -79
  87. data/spec/command_spec.rb +1 -20
  88. data/spec/complete_spec.rb +1 -23
  89. data/spec/config_spec.rb +1 -1
  90. data/spec/spec_helper.rb +4 -5
  91. data/test.sh +29 -25
  92. metadata +92 -212
  93. data/.githooks/pre_commit/run_specs.rb +0 -23
  94. data/Dockerfile +0 -15
  95. data/Dockerfile.fpm +0 -18
  96. data/Dockerfile.publish +0 -12
  97. data/Dockerfile.standalone +0 -33
  98. data/Dockerfile.validate-packaging +0 -9
  99. data/VERSION +0 -1
  100. data/acceptance-features/audit/audit_event_send.feature +0 -107
  101. data/acceptance-features/audit/fetch.feature +0 -16
  102. data/acceptance-features/audit/send.feature +0 -51
  103. data/acceptance-features/authentication/authenticate.feature +0 -10
  104. data/acceptance-features/authentication/login.feature +0 -12
  105. data/acceptance-features/authentication/logout.feature +0 -13
  106. data/acceptance-features/authorization/resource/annotate.feature +0 -35
  107. data/acceptance-features/authorization/resource/check.feature +0 -24
  108. data/acceptance-features/authorization/resource/create.feature +0 -21
  109. data/acceptance-features/authorization/resource/deny.feature +0 -12
  110. data/acceptance-features/authorization/resource/give.feature +0 -24
  111. data/acceptance-features/authorization/resource/permit.feature +0 -20
  112. data/acceptance-features/authorization/resource/permitted_roles.feature +0 -16
  113. data/acceptance-features/authorization/resource/show.feature +0 -28
  114. data/acceptance-features/authorization/role/create.feature +0 -13
  115. data/acceptance-features/authorization/role/exists.feature +0 -19
  116. data/acceptance-features/authorization/role/grant_to.feature +0 -21
  117. data/acceptance-features/authorization/role/graph.feature +0 -57
  118. data/acceptance-features/authorization/role/members.feature +0 -23
  119. data/acceptance-features/authorization/role/memberships.feature +0 -27
  120. data/acceptance-features/bootstrap.feature +0 -13
  121. data/acceptance-features/conjurenv/check.feature +0 -21
  122. data/acceptance-features/conjurenv/run.feature +0 -10
  123. data/acceptance-features/directory/group/create.feature +0 -20
  124. data/acceptance-features/directory/group/retire.feature +0 -54
  125. data/acceptance-features/directory/host/create.feature +0 -23
  126. data/acceptance-features/directory/host/retire.feature +0 -6
  127. data/acceptance-features/directory/hostfactory/create.feature +0 -28
  128. data/acceptance-features/directory/hostfactory/tokens.feature +0 -16
  129. data/acceptance-features/directory/layer/create.feature +0 -10
  130. data/acceptance-features/directory/layer/hosts-add.feature +0 -9
  131. data/acceptance-features/directory/layer/hosts-remove.feature +0 -10
  132. data/acceptance-features/directory/layer/retire.feature +0 -43
  133. data/acceptance-features/directory/user/create.feature +0 -23
  134. data/acceptance-features/directory/user/retire.feature +0 -6
  135. data/acceptance-features/directory/variable/create.feature +0 -14
  136. data/acceptance-features/directory/variable/retire.feature +0 -17
  137. data/acceptance-features/dsl/policy_owner.feature +0 -45
  138. data/acceptance-features/dsl/resource_owner.feature +0 -17
  139. data/acceptance-features/dsl/retire.feature +0 -15
  140. data/acceptance-features/global-privilege/elevate.feature +0 -20
  141. data/acceptance-features/global-privilege/reveal.privilege +0 -20
  142. data/acceptance-features/pubkeys/add.feature +0 -22
  143. data/acceptance-features/pubkeys/delete.feature +0 -9
  144. data/acceptance-features/pubkeys/names.feature +0 -26
  145. data/acceptance-features/pubkeys/show.feature +0 -27
  146. data/acceptance-features/step_definitions/cli_steps.rb +0 -57
  147. data/acceptance-features/step_definitions/graph_steps.rb +0 -22
  148. data/acceptance-features/step_definitions/user_steps.rb +0 -51
  149. data/acceptance-features/support/env.rb +0 -23
  150. data/acceptance-features/support/hooks.rb +0 -178
  151. data/acceptance-features/support/world.rb +0 -176
  152. data/acceptance-features/trusted_proxies.feature +0 -82
  153. data/bin/conjurize +0 -26
  154. data/bin/jsonfield +0 -70
  155. data/build-standalone +0 -6
  156. data/deprecations.sh +0 -38
  157. data/features/conjurize.feature +0 -134
  158. data/features/dsl_context.feature +0 -36
  159. data/features/dsl_host_create.feature +0 -11
  160. data/features/dsl_ownership.feature +0 -30
  161. data/features/dsl_permission.feature +0 -45
  162. data/features/dsl_resource_create.feature +0 -23
  163. data/features/dsl_role_create.feature +0 -11
  164. data/features/dsl_user_create.feature +0 -23
  165. data/features/jsonfield.feature +0 -49
  166. data/features/role_graph.feature +0 -58
  167. data/features/step_definitions/conjurize_steps.rb +0 -5
  168. data/features/step_definitions/dsl_steps.rb +0 -52
  169. data/features/support/conjur.conf +0 -6
  170. data/lib/conjur/command/assets.rb +0 -121
  171. data/lib/conjur/command/audit.rb +0 -155
  172. data/lib/conjur/command/bootstrap.rb +0 -129
  173. data/lib/conjur/command/dsl_command.rb +0 -75
  174. data/lib/conjur/command/elevate.rb +0 -76
  175. data/lib/conjur/command/field.rb +0 -45
  176. data/lib/conjur/command/groups.rb +0 -208
  177. data/lib/conjur/command/ids.rb +0 -34
  178. data/lib/conjur/command/layers.rb +0 -211
  179. data/lib/conjur/command/ldapsync.rb +0 -118
  180. data/lib/conjur/command/rspec/audit_helpers.rb +0 -68
  181. data/lib/conjur/command/rubydsl.rb +0 -93
  182. data/lib/conjur/command/script.rb +0 -48
  183. data/lib/conjur/command/server.rb +0 -67
  184. data/lib/conjur/conjurize.rb +0 -71
  185. data/lib/conjur/conjurize/script.rb +0 -150
  186. data/lib/conjur/dsl/runner.rb +0 -273
  187. data/publish-deb.sh +0 -6
  188. data/push-image +0 -29
  189. data/spec/command/assets_spec.rb +0 -115
  190. data/spec/command/audit_spec.rb +0 -376
  191. data/spec/command/elevate_spec.rb +0 -28
  192. data/spec/command/env_spec.rb +0 -168
  193. data/spec/command/groups_spec.rb +0 -77
  194. data/spec/command/host_factories_spec.rb +0 -38
  195. data/spec/command/layers_spec.rb +0 -35
  196. data/spec/command/ldapsync_spec.rb +0 -28
  197. data/spec/command/rubydsl_spec.rb +0 -63
  198. data/spec/command/variable_expiration_spec.rb +0 -164
  199. data/spec/command/variables_spec.rb +0 -192
  200. data/spec/conjurize/script_spec.rb +0 -62
  201. data/spec/conjurize_spec.rb +0 -70
  202. data/spec/dsl/runner_spec.rb +0 -93
  203. data/spec/env_spec.rb +0 -214
@@ -1,20 +0,0 @@
1
- Feature: Permit a privilege on a Resource
2
-
3
- Background:
4
- Given I successfully run `conjur resource create food:$ns/bacon`
5
-
6
- Scenario: Permission can be granted to a new user
7
-
8
- Given I create a new user named "alice@$ns"
9
- And I successfully run `conjur resource permit food:$ns/bacon user:alice@$ns fry`
10
- And I successfully run `conjur resource show food:$ns/bacon`
11
- Then the JSON at "permissions" should have 1 item
12
- And the JSON at "permissions/0/privilege" should be "fry"
13
- And the JSON at "permissions/0/grant_option" should be false
14
-
15
- Scenario: When granted with "grantable" option, the grantee can grant the privilege to other roles (supported since CLI 4.10.2)
16
- Given I create a new user named "alice@$ns"
17
- And I create a new user named "bob@$ns"
18
- And I successfully run `conjur resource permit --grantable food:$ns/bacon user:alice@$ns fry`
19
- And I login as "alice@$ns"
20
- Then I successfully run `conjur resource permit food:$ns/bacon user:bob@$ns fry`
@@ -1,16 +0,0 @@
1
- Feature: List roles which have a permission on a resource
2
-
3
- Background:
4
- Given I successfully run `conjur resource create food:$ns/bacon`
5
-
6
- Scenario: The owner of a resource is always listed in permitted_roles
7
- When I successfully run `conjur resource permitted_roles food:$ns/bacon fry`
8
- Then the JSON should include %{MY_ROLEID}
9
-
10
- Scenario: When a permission is granted to a new user, the user is listed in permitted_roles
11
- Given I create a new user named "alice@$ns"
12
- And I keep the JSON at "roleid" as "USERID"
13
- And I successfully run `conjur resource permit food:$ns/bacon user:alice@$ns fry`
14
- When I successfully run `conjur resource permitted_roles food:$ns/bacon fry`
15
- Then the JSON should include %{USERID}
16
-
@@ -1,28 +0,0 @@
1
- Feature: Show a resource
2
-
3
- Background:
4
- Given I successfully run `conjur resource create food:$ns/bacon`
5
- And I reset the command list
6
-
7
- Scenario: Showing a resource displays all its fields
8
- When I successfully run `conjur resource show food:$ns/bacon`
9
- Then the JSON should have "id"
10
- And the JSON should have "owner"
11
- And the JSON should have "permissions"
12
- And the JSON should have "annotations"
13
-
14
- Scenario: You can't show a resource on which you have no privileges
15
- Given I login as a new user
16
- And I reset the command list
17
- When I run `conjur resource show food:$ns/bacon`
18
- Then the exit status should be 1
19
- And the output should contain "Forbidden"
20
-
21
- Scenario: You can show any resource if you have a privilege on it
22
- Once alice has a permission to fry bacon, she can show everything
23
- about bacon.
24
-
25
- Given I create a new user named "alice@$ns"
26
- And I successfully run `conjur resource permit food:$ns/bacon user:alice@$ns fry`
27
- And I login as "alice@$ns"
28
- Then I successfully run `conjur resource show food:$ns/bacon`
@@ -1,13 +0,0 @@
1
- Feature: Create a Role
2
-
3
- Scenario: Create an abstract role
4
- When I run `conjur role create job:$ns/chef`
5
- Then the exit status should be 0
6
- And the output should contain "Created role"
7
-
8
- Scenario: Role owner has the new role listed in its memberships
9
- When I run `conjur role create --json --as-group $ns/security_admin job:$ns/chef`
10
- Then the exit status should be 0
11
- And I keep the JSON response at "roleid" as "ROLEID"
12
- And I run `conjur role memberships group:$ns/security_admin`
13
- And the JSON should include %{ROLEID}
@@ -1,19 +0,0 @@
1
- Feature: Test existance of a role
2
-
3
- Scenario: A never-created role does not exist
4
- When I successfully run `conjur role exists --json food:$ns/nonesuch`
5
- Then the JSON at "exists" should be false
6
-
7
- Scenario: A created role does exist
8
- When I successfully run `conjur role create --json food:$ns/bacon`
9
- And I keep the JSON response at "roleid" as "ROLEID"
10
- And I successfully run `conjur role exists --json %{ROLEID}`
11
- Then the JSON at "exists" should be true
12
-
13
- Scenario: Even foreign user can check existance of a role
14
- When I successfully run `conjur role create --json food:$ns/bacon`
15
- And I keep the JSON response at "roleid" as "ROLEID"
16
- And I login as a new user
17
- And I run `conjur role exists --json %{ROLEID}`
18
- Then the JSON at "exists" should be true
19
-
@@ -1,21 +0,0 @@
1
- Feature: Grant membership in a role to another role
2
-
3
- Scenario: Granting a role confers membership
4
- When I successfully run `conjur role create job:$ns/cooks`
5
- And I successfully run `conjur role create people:$ns/alice`
6
- And I successfully run `conjur role grant_to job:$ns/cooks people:$ns/alice`
7
- And I successfully run `conjur role members job:$ns/cooks`
8
- Then the JSON should have 2 entries
9
-
10
- Scenario: Granting a role gives the grantee permissions of the granted role
11
- When I successfully run `conjur role create job:$ns/cooks`
12
- And I successfully run `conjur role create people:$ns/alice`
13
- And I successfully run `conjur resource create food:$ns/bacon`
14
- And I successfully run `conjur resource permit food:$ns/bacon job:$ns/cooks fry`
15
- And I successfully run `conjur resource check -r job:$ns/cooks food:$ns/bacon fry`
16
- Then the output should contain "true"
17
- When I successfully run `conjur resource check -r people:$ns/alice food:$ns/bacon fry`
18
- Then the output should contain "false"
19
- When I successfully run `conjur role grant_to job:$ns/cooks people:$ns/alice`
20
- And I successfully run `conjur resource check -r people:$ns/alice food:$ns/bacon fry`
21
- Then the output should contain "true"
@@ -1,57 +0,0 @@
1
- Feature: Retrieving role graphs
2
- As a Conjur user
3
- In order to understand the role hierarchy
4
- I want to retrieve role graphs and present them in a useful format
5
-
6
- Background:
7
- Given a graph with edges
8
- | Tywin | Jamie |
9
- | Tywin | Cersei |
10
- | Cersei | Joffrey |
11
- | Jamie | Joffrey |
12
- | Aerys | Tyrion |
13
- | Joanna | Tyrion |
14
-
15
- Scenario: Showing the graph as JSON
16
- When I successfully run with role expansion "conjur role graph --as-role Joffrey Joffrey"
17
- Then the graph JSON should be:
18
- """
19
- {
20
- "graph": [
21
- { "parent": "Tywin", "child": "Jamie" },
22
- { "parent": "Tywin", "child": "Cersei"},
23
- { "parent": "Cersei", "child": "Joffrey"},
24
- { "parent": "Jamie", "child": "Joffrey" }
25
- ]
26
- }
27
- """
28
-
29
- Scenario: Short JSON output
30
- When I successfully run with role expansion "conjur role graph --short --as-role Joffrey Joffrey"
31
- Then the graph JSON should be:
32
- """
33
- [
34
- [ "Tywin", "Jamie" ],
35
- [ "Tywin", "Cersei" ],
36
- [ "Jamie", "Joffrey" ],
37
- [ "Cersei", "Joffrey"]
38
- ]
39
- """
40
-
41
- Scenario: I can restrict the output to show only ancestors or descendants
42
- When I successfully run with role expansion "conjur role graph --short --no-ancestors --as-role Cersei Cersei"
43
- Then the graph JSON should be:
44
- """
45
- [
46
- [ "Cersei", "Joffrey" ]
47
- ]
48
- """
49
- When I successfully run with role expansion "conjur role graph --short --no-descendants --as-role Cersei Cersei Jamie"
50
- Then the graph JSON should be:
51
- """
52
- [
53
- [ "Tywin", "Cersei" ],
54
- [ "Tywin", "Jamie" ]
55
- ]
56
- """
57
-
@@ -1,23 +0,0 @@
1
- Feature: List members of a role
2
-
3
- Scenario: Role members list is initally just the creator of the role
4
- When I successfully run `conjur role create job:$ns/chef`
5
- And I successfully run `conjur role members job:$ns/chef`
6
- Then the JSON should have 1 entries
7
-
8
- Scenario: Members can be added to the role by granting them the role
9
- When I successfully run `conjur role create job:$ns/chef`
10
- And I successfully run `conjur user create alice@$ns`
11
- And I successfully run `conjur role grant_to job:$ns/chef user:alice@$ns`
12
- And I successfully run `conjur role members job:$ns/chef`
13
- Then the JSON should have 2 entries
14
-
15
- Scenario: Members list is not expanded transitively
16
- When I successfully run `conjur role create job:$ns/chef`
17
- And I successfully run `conjur group create $ns/cooks`
18
- And I successfully run `conjur user create alice@$ns`
19
- And I successfully run `conjur group members add $ns/cooks user:alice@$ns`
20
- When I successfully run `conjur role grant_to job:$ns/chef group:$ns/cooks`
21
- And I successfully run `conjur role members job:$ns/chef`
22
- Then the JSON should have 2 entries
23
-
@@ -1,27 +0,0 @@
1
- Feature: List memberships of a role
2
-
3
- Scenario: The role memberships list includes the role itself
4
- Given I successfully run `conjur role create job:$ns/chef`
5
- When I successfully run `conjur role memberships job:$ns/chef`
6
- Then the JSON should have 1 entries
7
-
8
- Scenario: Memberships can be added to a role by granting it a new role
9
- Given I successfully run `conjur role create job:$ns/cook`
10
- And I successfully run `conjur role create job:$ns/chef`
11
- # Cooks are chefs
12
- And I successfully run `conjur role grant_to job:$ns/cook job:$ns/chef`
13
- When I successfully run `conjur role memberships job:$ns/chef`
14
- # Therefore chefs are cooks and chefs
15
- Then the JSON should have 2 entries
16
-
17
- Scenario: Members list is expanded transitively
18
- Given I successfully run `conjur role create person:$ns/myself`
19
- And I successfully run `conjur role create job:$ns/cook`
20
- And I successfully run `conjur role create job:$ns/chef`
21
- # I am a chef
22
- And I successfully run `conjur role grant_to job:$ns/chef person:$ns/myself`
23
- # Chefs are cooks
24
- And I successfully run `conjur role grant_to job:$ns/cook job:$ns/chef`
25
- When I successfully run `conjur role memberships person:$ns/myself`
26
- # Therefore I am me, a cook, and a chef
27
- Then the JSON should have 3 entries
@@ -1,13 +0,0 @@
1
- Feature: "conjur bootstrap" creates default resources, privileges and roles
2
-
3
- Background:
4
- Given I successfully run `conjur bootstrap -q`
5
-
6
- Scenario: A new security admin can use 'elevate'
7
- When I successfully run `conjur resource permitted_roles '!:!:conjur' elevate`
8
- Then the stdout should contain "cucumber:group:security_admin"
9
-
10
- Scenario: Run bootstrap and test for the existence of things
11
- Then I successfully run `conjur elevate group show security_admin`
12
- And I successfully run `conjur elevate host show conjur/secrets-rotator`
13
- And I successfully run `conjur elevate resource show webservice:conjur/authn-tv`
@@ -1,21 +0,0 @@
1
- Feature: Check an environment
2
-
3
- Background:
4
- Given I run `conjur variable create $ns/access_key ABCDEF`
5
- And I run `conjur variable create $ns/secret_key XYZQWER`
6
- And I run `conjur variable create $ns/ssh_private_key PRIVATE_KEY_BODY`
7
- And I create a new user named "alice@$ns"
8
- And I run `conjur resource permit variable:$ns/access_key user:alice@$ns execute`
9
- And I run `conjur resource permit variable:$ns/secret_key user:alice@$ns execute`
10
- And I login as "alice@$ns"
11
- And I reset the command list
12
-
13
- Scenario: Check against permitted variables
14
- When I run `conjur env check --yaml '{ aws_access_key: !var $ns/access_key , aws_secret_key: !var $ns/secret_key }'`
15
- Then the exit status should be 0
16
- And the stdout should contain "aws_access_key: available\naws_secret_key: available\n"
17
-
18
- Scenario: Check against restricted variables
19
- When I run `conjur env check --yaml '{ aws_access_key: !var $ns/access_key , ssh_private_key: !var $ns/ssh_private_key }'`
20
- Then the exit status should be 1
21
- And the stdout should contain "aws_access_key: available\nssh_private_key: unavailable\n"
@@ -1,10 +0,0 @@
1
- Feature: Run command in an environment populated from Conjur variables
2
-
3
- Background:
4
- Given I run `conjur variable create $ns/access_key ABCDEF`
5
- And I run `conjur variable create $ns/secret_key XYZQWER`
6
- And I reset the command list
7
-
8
- Scenario:
9
- When I run `bash -c "conjur env run --yaml '{ cloud_access_key: !var $ns/access_key , cloud_secret_key: !var $ns/secret_key }' -- env | grep CLOUD_"`
10
- Then the stdout should contain exactly "CLOUD_ACCESS_KEY=ABCDEF\nCLOUD_SECRET_KEY=XYZQWER"
@@ -1,20 +0,0 @@
1
- Feature: Create a group
2
-
3
- Scenario: Create a new group
4
- When I successfully run `conjur group create $ns/ops`
5
- Then the JSON response should have the following:
6
- | id |
7
- | ownerid |
8
- | resource_identifier |
9
- | roleid |
10
- And the JSON response at "id" should include "/ops"
11
-
12
- Scenario: Add a user to the group and show the list of members
13
- Given I successfully run `conjur user create bob@$ns`
14
- And I successfully run `conjur group create $ns/ops`
15
- And I successfully run `conjur group members add $ns/ops user:bob@$ns`
16
- When I successfully run `conjur group members list $ns/ops`
17
- Then the JSON response should have 2 entries
18
- And the JSON response at "0" should include "admin@"
19
- And the JSON response at "1" should include "bob@"
20
-
@@ -1,54 +0,0 @@
1
- Feature: Retire a group
2
- Background:
3
- When I successfully run `conjur group create $ns/ops`
4
-
5
- Scenario: Basic retirement
6
- Then I successfully run `conjur group retire -d user:attic@$ns $ns/ops`
7
-
8
- Scenario: Retiring a non-existent thing propagates the 404
9
- Then I run `conjur group retire -d user:attic@$ns $ns/foobar`
10
- Then the exit status should be 1
11
- And the stderr should contain "Resource Not Found"
12
-
13
- Scenario: A foreign user can't retire a group
14
- Given I login as a new user
15
- And I run `conjur group retire -d user:attic@$ns $ns/ops`
16
- Then the exit status should be 1
17
- And the stderr should contain "You can't administer this record"
18
-
19
- Scenario: Can't retire to a non-existant role
20
- And I run `conjur group retire -d user:foobar $ns/ops`
21
- Then the exit status should be 1
22
- And the output should match /error: Destination role/
23
- And the output should match /doesn't exist$/
24
-
25
- Scenario: I can retire a group which I've granted to another group
26
- Given I successfully run `conjur group create $ns/admin`
27
- And I successfully run `conjur role grant_to group:$ns/ops group:$ns/admin`
28
- Then I successfully run `conjur group retire -d user:attic@$ns $ns/ops`
29
-
30
- Scenario: I can retire a group which I've given to a group that I can admin
31
- Given I successfully run `conjur group create $ns/admin`
32
- And I successfully run `conjur resource give group:$ns/ops group:$ns/admin`
33
- Then I successfully run `conjur group retire -d user:attic@$ns $ns/ops`
34
-
35
- Scenario: I can't retire a group if I can't admin the group's role
36
- Given I successfully run `conjur group create $ns/admin`
37
- And I successfully run `conjur role grant_to group:$ns/ops group:$ns/admin`
38
- Given I create a new user named "alice@$ns"
39
- And I successfully run `conjur group members add -a $ns/admin alice@$ns`
40
- And I login as "alice@$ns"
41
- And I run `conjur group retire -d user:attic@$ns $ns/ops`
42
- Then the exit status should be 1
43
- And the stderr should contain "You can't administer this record"
44
-
45
- Scenario: I can't retire a group if I can't admin the group's record
46
- Given I successfully run `conjur group create $ns/admin`
47
- And I successfully run `conjur role grant_to -a group:$ns/ops group:$ns/admin`
48
- Given I create a new user named "alice@$ns"
49
- And I successfully run `conjur group members add -a $ns/admin alice@$ns`
50
- And I login as "alice@$ns"
51
- And I run `conjur group retire -d user:attic@$ns $ns/ops`
52
- Then the exit status should be 1
53
- And the stderr should contain "You don't own the record"
54
-
@@ -1,23 +0,0 @@
1
- Feature: Create a Host
2
-
3
- Scenario: Create a host with automatically generated ID
4
- When I successfully run `conjur host create`
5
- And the JSON should have "api_key"
6
- And the JSON should have "id"
7
-
8
- Scenario: Create a host with explicit ID
9
- When I successfully run `conjur host create $ns.myhost.example.com`
10
- And the JSON should have "api_key"
11
- And I keep the JSON response at "id" as "ID"
12
- Then the output should contain "myhost.example.com"
13
-
14
- Scenario: Create a host owned by the security_admin group
15
- When I successfully run `conjur host create --as-group $ns/security_admin`
16
- And I keep the JSON response at "ownerid" as "OWNERID"
17
- Then the output should contain "/security_admin"
18
-
19
- Scenario: Host does not belong to any layers by default
20
- When I successfully run `conjur host create $ns.myhost.example.com`
21
- And I successfully run `conjur host layers $ns.myhost.example.com`
22
- And the JSON should be []
23
-
@@ -1,6 +0,0 @@
1
- Feature: Retire a host
2
- Background:
3
- When I successfully run `conjur host create $ns/host`
4
-
5
- Scenario: Basic retirement
6
- Then I successfully run `conjur host retire -d user:attic@$ns $ns/host`
@@ -1,28 +0,0 @@
1
- Feature: Create a Host Factory
2
-
3
- Background:
4
-
5
- Scenario: Create a host factory successfully
6
- Given I successfully run `conjur layer create --as-group $ns/security_admin $ns/layer`
7
- Then I successfully run `conjur hostfactory create --as-group $ns/security_admin --layer $ns/layer $ns/hostfactory`
8
-
9
- Scenario: The client role can use itself as the hostfactory role
10
- Given I successfully run `conjur user create unprivileged@$ns`
11
- And I successfully run `conjur layer create $ns/layer`
12
- When I run `conjur hostfactory create --as-role user:unprivileged@$ns --layer $ns/layer $ns/hostfactory`
13
-
14
- Scenario: If current role cannot admin the layer, the error is reported
15
- Given I successfully run `conjur layer create $ns/the-layer`
16
- And I login as a new user
17
- Given I successfully run `conjur group create $ns/the-group`
18
- And I run `conjur hostfactory create --as-group $ns/the-group -l $ns/the-layer $ns/the-factory`
19
- Then the exit status should not be 0
20
- And the output should contain "must be an admin of layer"
21
-
22
- Scenario: If current role cannot admin the HF role, the error is reported
23
- Given I successfully run `conjur group create $ns/the-group`
24
- And I login as a new user
25
- Given I successfully run `conjur layer create $ns/the-layer`
26
- And I run `conjur hostfactory create --as-group $ns/the-group -l $ns/the-layer $ns/the-factory`
27
- Then the exit status should not be 0
28
- And the output should contain "must be an admin of role"
@@ -1,16 +0,0 @@
1
- Feature: Host factory tokens
2
-
3
- Background:
4
- Given I successfully run `conjur layer create --as-group $ns/security_admin $ns/layer`
5
- And I successfully run `conjur hostfactory create --as-group $ns/security_admin --layer $ns/layer $ns/hostfactory`
6
-
7
- Scenario: create a host factory token
8
- When I successfully run `conjur hostfactory token create $ns/hostfactory`
9
- Then the JSON should have "0/token"
10
-
11
- Scenario: create a host using a token
12
- When I successfully run `conjur hostfactory token create $ns/hostfactory`
13
- And I keep the JSON response at "0/token" as "TOKEN"
14
- Then I successfully run `conjur hostfactory host create %{TOKEN} $ns/host`
15
- And the JSON should have "api_key"
16
-