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.
- 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
@@ -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,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
|
-
|