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
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Feature: Create a layer
|
|
2
|
-
|
|
3
|
-
Scenario: Create a layer
|
|
4
|
-
When I successfully run `conjur layer create $ns/test_layer`
|
|
5
|
-
Then the JSON response at "id" should include "test_layer"
|
|
6
|
-
And the JSON response at "hosts" should be []
|
|
7
|
-
|
|
8
|
-
Scenario: Create a layer owned by the security_admin group
|
|
9
|
-
When I successfully run `conjur layer create --as-group $ns/security_admin $ns/test_layer`
|
|
10
|
-
Then the JSON response at "ownerid" should include "security_admin"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Feature: Add hosts to layer
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I run `conjur layer create $ns/testlayer`
|
|
5
|
-
And I run `conjur host create $ns.example.com`
|
|
6
|
-
|
|
7
|
-
Scenario: Add host to layer
|
|
8
|
-
When I successfully run `conjur layer hosts add $ns/testlayer $ns.example.com`
|
|
9
|
-
Then the output should contain "Host added"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Feature: Remove hosts from layer
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I run `conjur layer create $ns/testlayer`
|
|
5
|
-
And I run `conjur host create $ns.example.com`
|
|
6
|
-
And I run `conjur layer hosts add $ns/testlayer $ns.example.com`
|
|
7
|
-
|
|
8
|
-
Scenario: Remove host from layer
|
|
9
|
-
When I successfully run `conjur layer hosts remove $ns/testlayer $ns.example.com`
|
|
10
|
-
Then the output should contain "Host removed"
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
Feature: Retire a layer
|
|
2
|
-
Background:
|
|
3
|
-
When I successfully run `conjur layer create $ns/applayer`
|
|
4
|
-
|
|
5
|
-
Scenario: Basic retirement
|
|
6
|
-
Then I successfully run `conjur layer retire -d user:attic@$ns $ns/applayer`
|
|
7
|
-
|
|
8
|
-
Scenario: Retiring a non-existent thing propagates the 404
|
|
9
|
-
Then I run `conjur layer 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 layer
|
|
14
|
-
Given I login as a new user
|
|
15
|
-
And I run `conjur layer retire -d user:attic@$ns $ns/applayer`
|
|
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 layer retire -d user:foobar $ns/applayer`
|
|
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 layer which I've granted to a group
|
|
26
|
-
Given I successfully run `conjur group create $ns/admin`
|
|
27
|
-
And I successfully run `conjur role grant_to layer:$ns/applayer group:$ns/admin`
|
|
28
|
-
Then I successfully run `conjur layer retire -d user:attic@$ns $ns/applayer`
|
|
29
|
-
|
|
30
|
-
Scenario: I can retire a layer 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 layer:$ns/applayer group:$ns/admin`
|
|
33
|
-
Then I successfully run `conjur layer retire -d user:attic@$ns $ns/applayer`
|
|
34
|
-
|
|
35
|
-
Scenario: I can't retire a layer if I can't admin the layer's role
|
|
36
|
-
Given I successfully run `conjur group create $ns/admin`
|
|
37
|
-
And I successfully run `conjur role grant_to layer:$ns/applayer 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 layer retire -d user:attic@$ns $ns/applayer`
|
|
42
|
-
Then the exit status should be 1
|
|
43
|
-
And the stderr should contain "You can't administer this record"
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Feature: Create a User
|
|
2
|
-
|
|
3
|
-
Scenario: Create a passwordless user
|
|
4
|
-
When I successfully run `conjur user create alice-without-password@$ns`
|
|
5
|
-
And the JSON should have "api_key"
|
|
6
|
-
|
|
7
|
-
Scenario: Create a user with a password
|
|
8
|
-
When I run `conjur user create -p alice-with-password@$ns` interactively
|
|
9
|
-
And I type "foobar"
|
|
10
|
-
And I type "foobar"
|
|
11
|
-
Then the exit status should be 0
|
|
12
|
-
And the JSON should have "api_key"
|
|
13
|
-
|
|
14
|
-
Scenario: Create a user owned by the security_admin group
|
|
15
|
-
When I successfully run `conjur user create --as-group $ns/security_admin alice-without-password@$ns`
|
|
16
|
-
And I keep the JSON response at "ownerid" as "OWNERID"
|
|
17
|
-
Then the output should contain "/security_admin"
|
|
18
|
-
|
|
19
|
-
Scenario: Some characters are disallowed in user ids, such as /
|
|
20
|
-
When I run `conjur user create alice/$ns`
|
|
21
|
-
Then the exit status should be 1
|
|
22
|
-
And the stderr should contain "error: 403 Forbidden"
|
|
23
|
-
And the stdout should not contain anything
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
Feature: create an empty variable
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I successfully run `conjur variable create $ns/secret`
|
|
5
|
-
|
|
6
|
-
Scenario: Variable is created and responds to metadata
|
|
7
|
-
When I run `conjur variable show $ns/secret`
|
|
8
|
-
Then the JSON should have "id"
|
|
9
|
-
And the JSON should have "ownerid"
|
|
10
|
-
And the JSON at "version_count" should be 0
|
|
11
|
-
|
|
12
|
-
Scenario: Variable keeps no value
|
|
13
|
-
When I run `conjur variable value $ns/secret`
|
|
14
|
-
Then the exit status should be 1
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
Feature: Retire a variable
|
|
2
|
-
Background:
|
|
3
|
-
Given I successfully run `conjur variable create $ns/secret the-value`
|
|
4
|
-
|
|
5
|
-
Scenario: Basic retirement
|
|
6
|
-
Then I successfully run `conjur variable retire -d user:attic@$ns $ns/secret`
|
|
7
|
-
|
|
8
|
-
Scenario: A foreign user can't retire a secret
|
|
9
|
-
Given I login as a new user
|
|
10
|
-
And I run `conjur variable retire -d user:attic@$ns $ns/secret`
|
|
11
|
-
Then the exit status should be 1
|
|
12
|
-
And the stderr should contain "You don't own the record"
|
|
13
|
-
|
|
14
|
-
Scenario: I can retire a variable which I've given to a group that I can admin
|
|
15
|
-
Given I successfully run `conjur group create $ns/admin`
|
|
16
|
-
And I successfully run `conjur resource give variable:$ns/secret group:$ns/admin`
|
|
17
|
-
Then I successfully run `conjur variable retire -d user:attic@$ns $ns/secret`
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
Feature: Loading a policy can specify the policy's admin
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I successfully run `conjur group create $ns/admin`
|
|
5
|
-
And a file named "policy.rb" with:
|
|
6
|
-
"""
|
|
7
|
-
policy 'test-policy-1.0' do
|
|
8
|
-
user "test_user"
|
|
9
|
-
end
|
|
10
|
-
"""
|
|
11
|
-
And I reset the command list
|
|
12
|
-
|
|
13
|
-
Scenario: --as-group works
|
|
14
|
-
When I run `conjur rubydsl load --as-group $ns/admin --collection $ns` interactively
|
|
15
|
-
And I pipe in the file "policy.rb"
|
|
16
|
-
And the command completes successfully
|
|
17
|
-
And I reset the command list
|
|
18
|
-
When I run `conjur role members policy:$ns/test-policy-1.0`
|
|
19
|
-
Then the JSON should be:
|
|
20
|
-
"""
|
|
21
|
-
[
|
|
22
|
-
"cucumber:group:%{NAMESPACE}/admin"
|
|
23
|
-
]
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
Scenario: --as-role works
|
|
27
|
-
When I run `conjur rubydsl load --as-role group:$ns/admin --collection $ns` interactively
|
|
28
|
-
And I pipe in the file "policy.rb"
|
|
29
|
-
And the command completes successfully
|
|
30
|
-
And I reset the command list
|
|
31
|
-
When I run `conjur role members policy:$ns/test-policy-1.0`
|
|
32
|
-
Then the JSON should be:
|
|
33
|
-
"""
|
|
34
|
-
[
|
|
35
|
-
"cucumber:group:%{NAMESPACE}/admin"
|
|
36
|
-
]
|
|
37
|
-
"""
|
|
38
|
-
|
|
39
|
-
Scenario: --as-group doesn't interfere with policy ownership of other resources
|
|
40
|
-
When I run `conjur rubydsl load --as-group $ns/admin --collection $ns` interactively
|
|
41
|
-
And I pipe in the file "policy.rb"
|
|
42
|
-
And the command completes successfully
|
|
43
|
-
And I reset the command list
|
|
44
|
-
When I run `conjur resource show user:test_user@$ns-test-policy-1-0`
|
|
45
|
-
Then the JSON at "owner" should be "cucumber:policy:%{NAMESPACE}/test-policy-1.0"
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
Feature: Resources created by a policy are owned by the policy
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given a file named "policy.rb" with:
|
|
5
|
-
"""
|
|
6
|
-
policy 'test-policy-1.0' do
|
|
7
|
-
resource 'webservice', 'web1'
|
|
8
|
-
end
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
Scenario: resource is create with correct ownership
|
|
12
|
-
When I run `conjur rubydsl load --collection $ns` interactively
|
|
13
|
-
And I pipe in the file "policy.rb"
|
|
14
|
-
And the command completes successfully
|
|
15
|
-
And I reset the command list
|
|
16
|
-
When I run `conjur resource show webservice:$ns/test-policy-1.0/web1`
|
|
17
|
-
Then the JSON at "owner" should be "cucumber:policy:%{NAMESPACE}/test-policy-1.0"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
Feature: Retire a policy
|
|
2
|
-
Background:
|
|
3
|
-
Given a file named "policy.rb" with:
|
|
4
|
-
"""
|
|
5
|
-
policy 'test-policy-1.0' do
|
|
6
|
-
end
|
|
7
|
-
"""
|
|
8
|
-
And I run `conjur rubydsl load --as-role user:admin@$ns --collection $ns` interactively
|
|
9
|
-
And I pipe in the file "policy.rb"
|
|
10
|
-
And the exit status should be 0
|
|
11
|
-
|
|
12
|
-
@wip
|
|
13
|
-
Scenario: Basic retirement
|
|
14
|
-
Then I successfully run `conjur rubydsl retire -d user:attic@$ns $ns/test-policy-1.0`
|
|
15
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Feature: 'elevate' can be used to activate root-like privileges
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I successfully run `conjur variable create $ns/secret secretvalue`
|
|
5
|
-
And I create a new user named "alice@$ns"
|
|
6
|
-
|
|
7
|
-
Scenario: The secret value is not accessible without 'elevate' privilege
|
|
8
|
-
Given I login as "alice@$ns"
|
|
9
|
-
When I run `conjur variable value $ns/secret`
|
|
10
|
-
Then the exit status should be 1
|
|
11
|
-
|
|
12
|
-
Scenario: 'elevate' can't be used without permission
|
|
13
|
-
Given I login as "alice@$ns"
|
|
14
|
-
When I run `conjur elevate variable show $ns/secret`
|
|
15
|
-
Then the exit status should be 1
|
|
16
|
-
|
|
17
|
-
Scenario: The secret value is accessible with 'elevate' privilege
|
|
18
|
-
Given I successfully run `conjur resource permit '!:!:conjur' user:alice@$ns elevate`
|
|
19
|
-
And I login as "alice@$ns"
|
|
20
|
-
Then I successfully run `conjur elevate variable value $ns/secret`
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Feature: 'reveal' can be used to see all records
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I successfully run `conjur variable create $ns/secret secretvalue`
|
|
5
|
-
And I create a new user named "alice@$ns"
|
|
6
|
-
|
|
7
|
-
Scenario: The secret value is not accessible without 'reveal' privilege
|
|
8
|
-
Given I login as "alice@$ns"
|
|
9
|
-
When I run `conjur variable show $ns/secret`
|
|
10
|
-
Then the exit status should be 1
|
|
11
|
-
|
|
12
|
-
Scenario: 'reveal' can't be used without permission
|
|
13
|
-
Given I login as "alice@$ns"
|
|
14
|
-
When I run `conjur reveal variable show $ns/secret`
|
|
15
|
-
Then the exit status should be 1
|
|
16
|
-
|
|
17
|
-
Scenario: The secret value is accessible with 'reveal' privilege
|
|
18
|
-
Given I successfully run `conjur resource permit '!:!:conjur' user:alice@$ns reveal`
|
|
19
|
-
And I login as "alice@$ns"
|
|
20
|
-
Then I successfully run `conjur reveal variable show $ns/secret`
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Feature: Register a public key
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I successfully run `conjur user create alice@$ns`
|
|
5
|
-
And I successfully run `ssh-keygen -t rsa -C "laptop" -N "" -f ./id_alice_$ns`
|
|
6
|
-
And I reset the command list
|
|
7
|
-
|
|
8
|
-
Scenario: Register a public key file for a user
|
|
9
|
-
When I run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
|
|
10
|
-
Then the exit status should be 0
|
|
11
|
-
|
|
12
|
-
Scenario: You can't accidentally register the private key
|
|
13
|
-
When I run `conjur pubkeys add alice@$ns @id_alice_$ns`
|
|
14
|
-
Then the exit status should be 1
|
|
15
|
-
And the stderr should contain "Unprocessable Entity"
|
|
16
|
-
|
|
17
|
-
Scenario: Unauthorized users cannot modify public keys
|
|
18
|
-
Given I login as new user "bob@$ns"
|
|
19
|
-
And I reset the command list
|
|
20
|
-
And I run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
|
|
21
|
-
Then the exit status should be 1
|
|
22
|
-
And the stderr should contain "Forbidden"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Feature: Remove a public key
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I successfully run `conjur user create alice@$ns`
|
|
5
|
-
And I successfully run `ssh-keygen -t rsa -C "laptop" -N "" -f ./id_alice_$ns`
|
|
6
|
-
|
|
7
|
-
Scenario: To remove a public key, use the user's login name and the key name (-C option to ssh-keygen)
|
|
8
|
-
Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
|
|
9
|
-
Then I successfully run `conjur pubkeys delete alice@$ns laptop`
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Feature: List known public key names for a user
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I successfully run `conjur user create alice@$ns`
|
|
5
|
-
And I successfully run `ssh-keygen -t rsa -C "laptop" -N "" -f ./id_alice_$ns`
|
|
6
|
-
And I reset the command list
|
|
7
|
-
|
|
8
|
-
Scenario: Initial key names list is empty
|
|
9
|
-
When I run `conjur pubkeys names alice@$ns`
|
|
10
|
-
Then the stdout should contain exactly ""
|
|
11
|
-
|
|
12
|
-
Scenario: After adding a key, the key name is shown
|
|
13
|
-
Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
|
|
14
|
-
And I reset the command list
|
|
15
|
-
And I run `conjur pubkeys names alice@$ns`
|
|
16
|
-
Then the stdout should contain exactly:
|
|
17
|
-
"""
|
|
18
|
-
laptop\n
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
Scenario: After deleting the key, the key names list is empty again
|
|
22
|
-
Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
|
|
23
|
-
And I successfully run `conjur pubkeys delete alice@$ns laptop`
|
|
24
|
-
And I reset the command list
|
|
25
|
-
And I run `conjur pubkeys names alice@$ns`
|
|
26
|
-
Then the stdout should contain exactly ""
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
Feature: Show public keys for a user
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given I successfully run `conjur user create alice@$ns`
|
|
5
|
-
And I successfully run `ssh-keygen -t rsa -C "laptop" -N "" -f ./id_alice_$ns`
|
|
6
|
-
And I reset the command list
|
|
7
|
-
|
|
8
|
-
Scenario: Initial key list is empty
|
|
9
|
-
When I run `conjur pubkeys show alice@$ns`
|
|
10
|
-
Then the stdout should contain exactly "\n"
|
|
11
|
-
|
|
12
|
-
Scenario: After adding a key, the key is shown
|
|
13
|
-
Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
|
|
14
|
-
And I run `conjur pubkeys show alice@$ns`
|
|
15
|
-
And the output should match /^ssh-rsa .* laptop$/
|
|
16
|
-
|
|
17
|
-
Scenario: After deleting the key, the key list is empty again
|
|
18
|
-
Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
|
|
19
|
-
And I successfully run `conjur pubkeys delete alice@$ns laptop`
|
|
20
|
-
And I reset the command list
|
|
21
|
-
And I run `conjur pubkeys show alice@$ns`
|
|
22
|
-
Then the stdout should contain exactly "\n"
|
|
23
|
-
|
|
24
|
-
Scenario: Public keys can be listed using cURL, without authentication
|
|
25
|
-
Given I successfully run `conjur pubkeys add alice@$ns @id_alice_$ns.pub`
|
|
26
|
-
When I successfully run `curl -k $pubkeys_url/alice@$ns`
|
|
27
|
-
Then the output should match /^ssh-rsa .* laptop$/
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
Transform /\$ns/ do |s|
|
|
2
|
-
s.gsub('$ns', namespace)
|
|
3
|
-
end
|
|
4
|
-
|
|
5
|
-
Transform /\$user_role/ do |s|
|
|
6
|
-
s.gsub('$user_role', test_user.role_id)
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
Transform /^table:/ do |table|
|
|
10
|
-
table.tap do |t|
|
|
11
|
-
t.hashes.each do |row|
|
|
12
|
-
row.each do |_,v|
|
|
13
|
-
v.gsub!('$ns', namespace)
|
|
14
|
-
v.gsub!('$user_role', test_user.role_id)
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Then /^I reset the command list/ do
|
|
22
|
-
aruba.command_monitor.clear
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
When /^the command completes successfully/ do
|
|
26
|
-
last_command_started.wait
|
|
27
|
-
last_command_started.terminate
|
|
28
|
-
expect(last_command_started.exit_status).to eq(0)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
Then /^I send the audit event:/ do |event|
|
|
32
|
-
step "I run `env RESTCLIENT_LOG=stderr conjur audit send` interactively"
|
|
33
|
-
last_command_started.write event
|
|
34
|
-
last_command_started.close_io :stdin
|
|
35
|
-
step "the command completes successfully"
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
# this is step copypasted from https://github.com/cucumber/aruba/blob/master/lib/aruba/cucumber.rb#L24
|
|
39
|
-
# original has typo in regexp, which is fixed here
|
|
40
|
-
Given(/^a file named "([^"]*?)" with: '(.*?)'$/) do |file_name, file_content|
|
|
41
|
-
write_file(file_name, file_content)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
Given(/^a file named "([^"]*?)" with namespace substitution:$/) do |file_name, file_content|
|
|
45
|
-
step "a file named \"#{file_name}\" with:", file_content
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
Then /^it prints the path to temporary file which contains: '(.*)'$/ do |content|
|
|
49
|
-
filename = last_command_started.stdout.strip
|
|
50
|
-
tempfiles << filename
|
|
51
|
-
actual_content = File.read(filename)
|
|
52
|
-
expect(actual_content).to match(content)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
Then /^the output from "([^"]*)" should match \/([^\/]*)\/$/ do |cmd, expected|
|
|
56
|
-
assert_matching_output(expected, output_from(cmd))
|
|
57
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Given /^a graph with edges$/ do |table|
|
|
3
|
-
graph table.raw
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
Then %r{^the graph JSON should be:$} do |json|
|
|
7
|
-
json = expand_roles json
|
|
8
|
-
last_graph = extract_filtered_graph json
|
|
9
|
-
expect(last_graph.to_json).to be_json_eql(json)
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
When(/^I( successfully)? run with role expansion "(.*)"$/) do |successfully, cmd|
|
|
13
|
-
role_id_map.each do |role, expanded_role|
|
|
14
|
-
cmd.gsub! role, expanded_role
|
|
15
|
-
end
|
|
16
|
-
self.last_cmd = cmd
|
|
17
|
-
if successfully
|
|
18
|
-
step "I successfully run `#{cmd}`"
|
|
19
|
-
else
|
|
20
|
-
step "I run `#{cmd}`"
|
|
21
|
-
end
|
|
22
|
-
end
|