Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create conjur v5 k8s authenticator #619

Merged
merged 113 commits into from Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
97aed25
create cert injection route and k8s authenticator with authn-k8s copi…
Jun 27, 2018
3a74352
copy over authn-k8s cukes, attempt to add k8s and openshift pipelines
Jun 28, 2018
2e325e3
add missing image tag
Jun 28, 2018
7a31081
Merge branch 'master' into CONJ-5128--create-conjur-v5-k8s-authenticator
Jun 28, 2018
e8424bd
add missing kubectl_client file and gems
Jun 28, 2018
3eb2041
manifest for conjur v5, fix paths in gke script
Jun 29, 2018
dfcbf2f
add cli pod, modify test script to use cli pod to load policy, modify…
Jul 3, 2018
ed3f9ee
make conjur pod name consistent
Jul 3, 2018
255bd35
fix api key env var
Jul 3, 2018
5e93d10
remove finish trap for gke
Jul 3, 2018
bc96aa3
update conjur manifest template
Jul 3, 2018
918e8ff
fix kubectl cp of policies directory
Jul 3, 2018
ad7afdf
remove grant in authn-k8s policy
Jul 3, 2018
6fa1f11
restore trap to clear out images
Jul 3, 2018
57773db
master merge with conflict fix
Jul 5, 2018
57ddf93
use newly-built conjur image
Jul 5, 2018
4b89499
remove trap
Jul 5, 2018
4352ddd
try again to pull correct tag
Jul 5, 2018
e962e8f
fix data key substitution
Jul 5, 2018
dadec2b
comment out openshift testing temporarily
Jul 5, 2018
387b204
use conjur image that was build by pipeline
Jul 5, 2018
2da6258
fix version retrieval
Jul 5, 2018
a70c8ab
fix bash mistake
Jul 5, 2018
07de8c3
temporarily remove gem audit
Jul 5, 2018
c508549
see if sleep solves container not found error
Jul 5, 2018
2d63bef
add some debug printing
Jul 5, 2018
0cd323a
ensure that script is waiting for conjur pod to be ready
Jul 5, 2018
a62a59a
remove db migration
Jul 5, 2018
7d9341c
fix entitelemtn yml extension
Jul 5, 2018
1e2d1d2
fix layer name in entitlements policy
Jul 5, 2018
f746883
restore db migrate
Jul 5, 2018
a7e7271
fix deploy config host name
Jul 5, 2018
dd6a7b4
load platform-specific policies
Jul 5, 2018
e66fffd
remove exit
Jul 5, 2018
d3c4d30
hard-code templater path
Jul 5, 2018
e696ffa
copy policy files from correct container
Jul 5, 2018
af32b65
fix entitlement policy layer
Jul 5, 2018
1fa7762
try sleeping to avoid cli login fail
Jul 5, 2018
72b0750
make deploy config identity name consistent
Jul 5, 2018
4c1cd3d
fix inventory pod manifest paths
Jul 5, 2018
6f9cefb
restore conjur-authn-k8s pod label to fix conjurcmd
Jul 5, 2018
ca15467
update conjur tag in correct place
Jul 5, 2018
81e2022
fix label lookup
Jul 5, 2018
bc02b9e
use conjur test image
Jul 6, 2018
0e214d5
add -r flag to cucumber run
Jul 6, 2018
2873bcf
fix cuke required file and k8s_object_lookup namespacing issues
Jul 6, 2018
4f1fdc8
add missing namespace env var to manifest
Jul 9, 2018
a73da51
add env var to template file
Jul 9, 2018
4d934d8
fix k8sresolver namespacing in cukes
Jul 9, 2018
e450477
update to v5 routes
Jul 9, 2018
d101267
sleep infinity conjur to try to debug
Jul 9, 2018
bf8879e
delete template result
Jul 9, 2018
65a8c2f
delete remaining template results and modify gitignore
Jul 9, 2018
06e292b
sleep infinite conjur server
Jul 9, 2018
a3af5d5
remove conjur sleep infinity
Jul 9, 2018
67cb40a
fix unknown method error
Jul 9, 2018
c6a120b
remove binding.pry
Jul 9, 2018
737167b
add authn-local volume
Jul 9, 2018
8edf2d2
add account to service lookup
Jul 9, 2018
d462e0b
add backtrace for error
Jul 9, 2018
e5aad6d
fix host retrieval
Jul 9, 2018
8cdecba
blind attempt to use token factory
Jul 10, 2018
2a40f6a
use conjur models instead of api client, replace some v4 syntax
Jul 10, 2018
eddbf63
replace v4 permission check
Jul 10, 2018
4ec5b86
replace api usage in ca initialization
Jul 10, 2018
4625a12
add rake task to init ca certs and call in gke script
Jul 10, 2018
2f244fe
fix rake task and convert ca cert secret creation to v5
Jul 10, 2018
3837394
fix rake task output and cert value loading
Jul 10, 2018
e8988ca
fix kubectlexec namespace in cuke
Jul 10, 2018
de99291
pass cert in request body, add account to authenticate url
Jul 10, 2018
9c29864
attempt to simplify policy
Jul 10, 2018
826a5b8
fix gitignore, fix policy file extension
Jul 10, 2018
aff8a5e
cut down policy even more
Jul 10, 2018
ce5c0a2
remove duplicate policy line
Jul 10, 2018
f1b661f
replace policy template vars
Jul 10, 2018
774e23a
copy over authenticate controller helpers, add cert validation
Jul 10, 2018
b875517
fix username in authentication cuke
Jul 10, 2018
73b0491
fix logger calls
Jul 10, 2018
2ae0936
add backtrace print
Jul 10, 2018
32f64dc
add before filters to valid method
Jul 10, 2018
a012169
bare minimum helper methods to load ca
Jul 10, 2018
07510fc
pass host_id_param correctly for validation
Jul 10, 2018
645c4dc
add print statements to check common name match
Jul 10, 2018
5c0c169
fix rails logger calls
Jul 10, 2018
3ff8dc8
only match cn against host identifier
Jul 10, 2018
42fe07f
update response token handling in cukes
Jul 11, 2018
901174a
require conjur_token and use correct variable to store response
Jul 11, 2018
c04641b
use conjur token helper correctly
Jul 11, 2018
0bab605
fix non-existent host error and add other hosts
Jul 11, 2018
e4258fe
include hooks.rb and fix kubectlexec namespace
Jul 11, 2018
1880d39
add cuke @skip tag handling, check for nil response before parsing tokeN
Jul 11, 2018
d1b3fd7
skip backpressure cuke, enable a few more before filters
Jul 11, 2018
46a0289
fix host_lookup error message
Jul 11, 2018
ff3bd89
use partial username for host id param
Jul 11, 2018
eb3ad78
add find_pod before filter
Jul 11, 2018
d636ae9
use hostid for authentication cuke
Jul 11, 2018
b8951b9
add find_container before filter
Jul 11, 2018
53dca3b
remove some cruft, restore cleanup trap
Jul 11, 2018
31a0a47
add openshift tests and modify test scripts
Jul 11, 2018
b85c40e
use oc rsync
Jul 11, 2018
636563d
try removing migrate command
Jul 11, 2018
88b5bd5
Update reek and rubocop todo files
dividedmind Jul 11, 2018
f9e4c6a
add wait for conjurctl server and remove migrate
Jul 11, 2018
38feedd
Merge branch 'CONJ-5128--create-conjur-v5-k8s-authenticator' of githu…
Jul 11, 2018
da2d011
create dir before rsync
Jul 11, 2018
d15150f
remove openshift cleanup trap
Jul 11, 2018
2ddbe2f
rsync policies to correct dir
Jul 11, 2018
1ede166
restore openshift cleanup trap
Jul 11, 2018
60befd5
version and changelog bump
Jul 11, 2018
eb48cd7
restore gem audit
Jul 11, 2018
957ddc0
Revert "version and changelog bump"
Jul 11, 2018
960286f
Remove static analysis
jvanderhoof Jul 11, 2018
2c6ec46
Merge branch 'master' into CONJ-5128--create-conjur-v5-k8s-authenticator
jvanderhoof Jul 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -41,3 +41,10 @@ brakeman-output.*
.idea
TEMP_NOTES.txt
awstest

# authn-k8s plugin
ci/authn-k8s/dev/*.yaml
!ci/authn-k8s/dev/*template*
ci/authn-k8s/dev/policies/*.yml
!ci/authn-k8s/dev/policies/*template*

112 changes: 107 additions & 5 deletions .reek.yml
@@ -1,5 +1,4 @@
# Generated automatically by reek --todo.
# We should go one by one and fix them.
---
detectors:
IrresponsibleModule:
exclude:
Expand All @@ -12,6 +11,7 @@ detectors:
- PossumWorld
- ConjurToken
- AuthenticatorWorld
- AuthnK8sWorld
- FullId
- RotatorWorld
- RotatorWorld::Timer
Expand Down Expand Up @@ -50,6 +50,25 @@ detectors:
- Authentication::AuthenticatorClass
- Authentication::Authn::Authenticator
- Authentication::AuthnIam::Authenticator
- Authentication::AuthnK8s::AuthenticationService
- Authentication::AuthnK8s::AuthenticationError
- Authentication::AuthnK8s::Authenticator
- Authentication::AuthnK8s::CSRVerificationError
- Authentication::AuthnK8s::ClientCertExpiredError
- Authentication::AuthnK8s::ClientCertVerificationError
- Authentication::AuthnK8s::NotFoundError
- Authentication::AuthnK8s::CA
- Authentication::AuthnK8s::K8sObjectLookup
- Authentication::AuthnK8s::K8sObjectLookup::K8sForbiddenError
- Authentication::AuthnK8s::K8sResolver
- Authentication::AuthnK8s::K8sResolver::DeploymentConfig
- Authentication::AuthnK8s::K8sResolver::Pod
- Authentication::AuthnK8s::K8sResolver::ReplicaSet
- Authentication::AuthnK8s::K8sResolver::ServiceAccount
- Authentication::AuthnK8s::K8sResolver::StatefulSet
- Authentication::AuthnK8s::K8sResolver::ValidationError
- Authentication::AuthnK8s::KubectlClient
- Authentication::AuthnK8s::KubectlExec
- Authentication::AuthnLdap::Authenticator
- Authentication::AuthnLdap::Server
- Authentication::InstalledAuthenticators
Expand Down Expand Up @@ -161,6 +180,7 @@ detectors:
exclude:
- String#decode64
- String#encode64
- Authentication::AuthnK8s::Authenticator#URI_from_asn1_seq
- Rotation::Password#self.base58
UncommunicativeVariableName:
exclude:
Expand All @@ -173,11 +193,19 @@ detectors:
- PossumWorld#invoke
- authenticator
- AuthenticateController#authenticate
- AuthenticateController#k8s_inject_client_cert
- CurrentUser#current_user?
- ResourcesController#permitted_roles
- SecretsController#batch
- SecretsController#show
- Authentication::AuthnIam::Authenticator#response_from_signed_request
- Authentication::AuthnK8s::Authenticator#URI_from_asn1_seq
- Authentication::AuthnK8s::Authenticator#cert_spiffe_id
- Authentication::AuthnK8s::Authenticator#csr_spiffe_id
- Authentication::AuthnK8s::Authenticator#find_container
- Authentication::AuthnK8s::Authenticator#k8s_container_name
- Authentication::AuthnK8s::K8sObjectLookup#find_object_by_name
- Authentication::AuthnK8s::KubectlExec#exec
- Authentication::MemoizedRole#self.[]
- Authentication::Strategy#conjur_token
- Rotation::MasterRotator::ScheduledRotation#run
Expand Down Expand Up @@ -205,6 +233,9 @@ detectors:
- PossumWorld#current_user_credentials
- PossumWorld#denormalize
- PossumWorld#rest_resource
- login
- AuthnK8sWorld#pod_certificate
- AuthnK8sWorld#substitute
- verify_data
- ApplicationController#foreign_key_constraint_violation
- ApplicationController#policy_invalid
Expand All @@ -222,6 +253,24 @@ detectors:
- Authentication::AuthnIam::Authenticator#iam_role_matches?
- Authentication::AuthnIam::Authenticator#identity_hash
- Authentication::AuthnIam::Authenticator#response_from_signed_request
- Authentication::AuthnK8s::AuthenticationService#initialize_ca
- Authentication::AuthnK8s::Authenticator#URI_from_asn1_seq
- Authentication::AuthnK8s::Authenticator#authorize_host
- Authentication::AuthnK8s::Authenticator#cert_spiffe_id
- Authentication::AuthnK8s::Authenticator#csr_spiffe_id
- Authentication::AuthnK8s::Authenticator#find_container
- Authentication::AuthnK8s::Authenticator#find_pod
- Authentication::AuthnK8s::Authenticator#find_pod_under_controller
- Authentication::AuthnK8s::Authenticator#install_signed_cert
- Authentication::AuthnK8s::CA#generate
- Authentication::AuthnK8s::K8sResolver::Deployment#validate_pod
- Authentication::AuthnK8s::K8sResolver::DeploymentConfig#validate_pod
- Authentication::AuthnK8s::K8sResolver::Pod#validate_pod
- Authentication::AuthnK8s::K8sResolver::ReplicaSet#validate_pod
- Authentication::AuthnK8s::K8sResolver::ServiceAccount#validate_pod
- Authentication::AuthnK8s::K8sResolver::StatefulSet#validate_pod
- Authentication::AuthnK8s::KubectlExec#exec
- Authentication::AuthnK8s::KubectlExec#exec#message_binary
- Authentication::Security#validate_user_has_access
- Rotation::Rotators::Aws::SecretKey#rotate
- Account#delete
Expand Down Expand Up @@ -260,13 +309,18 @@ detectors:
- PossumWorld#set_result
- PossumWorld#try_request
- AuthenticatorWorld#post
- gen_csr
- AuthnK8sWorld#detect_request_ip
- AuthnK8sWorld#pod_certificate
- PossumWorld#invoke
- RotatorWorld#current_value
- RotatorWorld::PollingSession#captured_values
- app_policy
- load_policy_update
- ApplicationController#foreign_key_constraint_violation
- ApplicationController#validation_failed
- AuthenticateController#authenticate
- AuthenticateController#k8s_inject_client_cert
- HostFactoriesController#create_host
- HostFactoriesController#verify_token
- HostFactoryTokensController#create
Expand All @@ -280,6 +334,21 @@ detectors:
- SecretsController#show
- Authentication::AuthnIam::Authenticator#iam_role_matches?
- Authentication::AuthnIam::Authenticator#response_from_signed_request
- Authentication::AuthnK8s::Authenticator#cert_spiffe_id
- Authentication::AuthnK8s::Authenticator#csr_spiffe_id
- Authentication::AuthnK8s::Authenticator#find_pod
- Authentication::AuthnK8s::Authenticator#find_pod_under_controller
- Authentication::AuthnK8s::Authenticator#inject_client_cert
- Authentication::AuthnK8s::Authenticator#pod_certificate
- Authentication::AuthnK8s::Authenticator#valid?
- Authentication::AuthnK8s::CA#generate
- Authentication::AuthnK8s::K8sResolver::Deployment#validate_pod
- Authentication::AuthnK8s::K8sResolver::DeploymentConfig#validate_pod
- Authentication::AuthnK8s::K8sResolver::ReplicaSet#validate_pod
- Authentication::AuthnK8s::K8sResolver::StatefulSet#validate_pod
- Authentication::AuthnK8s::KubectlClient#client
- Authentication::AuthnK8s::KubectlExec#exec
- Authentication::AuthnK8s::KubectlExec#exec#message_binary
- Authentication::AuthnLdap::Authenticator#valid?
- Authentication::AuthnLdap::Server#self.new
- Authentication::Security#validate_user_has_access
Expand Down Expand Up @@ -311,6 +380,7 @@ detectors:
ControlParameter:
exclude:
- PossumWorld#try_request
- Authentication::AuthnK8s::KubectlExec#exec
- Authentication::Strategy#validate_authenticator_exists
- Rotation::ConjurFacade#expires_at
- Exceptions::RecordNotFound#initialize
Expand All @@ -323,6 +393,7 @@ detectors:
exclude:
- PossumWorld#set_result
- Authentication::AuthenticatorClass#requires_env_arg?
- Authentication::AuthnK8s::K8sObjectLookup#k8s_client_for_method
- Loader::Types::Delete#delete!
- Loader::Types::Record#create!
UtilityFunction:
Expand All @@ -332,6 +403,11 @@ detectors:
- AuthenticatorWorld#admin_password
- AuthenticatorWorld#conjur_hostname
- AuthenticatorWorld#full_username
- gen_csr
- app
- AuthnK8sWorld#authn_k8s_host
- AuthnK8sWorld#kubectl_client
- AuthnK8sWorld#test_namespace
- FullId#make_full_id
- RotatorWorld#valid_aws_credentials?
- RotatorWorld#valid_credentials?
Expand All @@ -352,6 +428,11 @@ detectors:
- RolesController#filtered_roles
- Authentication::AuthnIam::Authenticator#iam_role_matches?
- Authentication::AuthnIam::Authenticator#identity_hash
- Authentication::AuthnK8s::AuthenticationService#conjur_account
- Authentication::AuthnK8s::AuthenticationService#master_host
- Authentication::AuthnK8s::Authenticator#get_subject_hash
- Authentication::AuthnK8s::K8sObjectLookup#kubectl_client
- Authentication::AuthnK8s::KubectlExec#generate_file_tar_string
- Authentication::AuthnLdap::Authenticator#blacklisted_ldap_user?
- Authentication::Security#default_conjur_authn?
- Rotation::NextExpiration#time_from_now
Expand All @@ -361,9 +442,11 @@ detectors:
- Schemata#db
- secrets_version_limit
- Sequel::Model#write_id_to_json
- conjur_api
LongParameterList:
exclude:
- AuthenticatorWorld#authenticate_with_ldap
- login
- RotatorWorld#postgres_password_history
- input
- Authentication::AuditLog#self.record_authn_event
Expand All @@ -372,6 +455,7 @@ detectors:
- Resource#search
FeatureEnvy:
exclude:
- AuthnK8sWorld#pod_certificate
- RotatorWorld::PollingSession#updated_history
- ApplicationController#foreign_key_constraint_violation
- ApplicationController#no_matching_row
Expand All @@ -381,6 +465,7 @@ detectors:
- ApplicationController#validation_failed
- PoliciesController#load_policy
- Authentication::Authn::Authenticator#valid?
- Authentication::AuthnK8s::Authenticator#URI_from_asn1_seq
- Authentication::AuthnLdap::Authenticator#initialize
- Authentication::Strategy#audit_failure
- Authentication::Strategy#audit_success
Expand All @@ -397,17 +482,23 @@ detectors:
- Secret#as_json
NilCheck:
exclude:
- AuthnK8sWorld#pod_certificate
- RotatorWorld#current_value
- RotatorWorld::PollingSession#stop?
- SecretsController#batch
- SecretsController#show
- Authentication::AuthnK8s::Authenticator#find_container
- Authentication::AuthnK8s::Authenticator#host_lookup
- Authentication::AuthnK8s::Authenticator#service_lookup
- Account#create
- Authenticate#self?
- HostFactoryToken#cidr_mask
- Schemata#initialize
NestedIterators:
exclude:
- ApplicationController#validation_failed
- Authentication::AuthnK8s::Authenticator#csr_spiffe_id
- Authentication::AuthnK8s::KubectlExec#generate_file_tar_string
- Loader::Orchestrate#delete_removed
- Loader::Orchestrate#eliminate_shadowed
- Loader::Orchestrate#update_changed
Expand All @@ -422,6 +513,8 @@ detectors:
- ResourcesController
- RolesController
- SecretsController
- Authentication::AuthnK8s::Authenticator
- Authentication::AuthnK8s::KubectlExec
- Rotation::Rotators::Aws::SecretKey::AwsCredentials
- Credentials
- Loader::Orchestrate
Expand All @@ -430,6 +523,7 @@ detectors:
TooManyMethods:
exclude:
- RolesController
- Authentication::AuthnK8s::Authenticator
- Loader::Orchestrate
- Role
MissingSafeMethod:
Expand All @@ -448,6 +542,17 @@ detectors:
- Loader::Types::Revoke
- Loader::Types::User
- Loader::Types::Variable
RepeatedConditional:
exclude:
- Authentication::AuthnK8s::Authenticator
TooManyInstanceVariables:
exclude:
- Authentication::AuthnK8s::Authenticator
- Authentication::AuthnK8s::KubectlExec
- Loader::Orchestrate
BooleanParameter:
exclude:
- Authentication::AuthnK8s::KubectlExec#exec
UnusedParameters:
exclude:
- Rotation::MasterRotator::ScheduledRotation#log_error
Expand All @@ -463,6 +568,3 @@ detectors:
- PolicyVersion#perform_automatic_deletion
- PolicyVersion#policy_filename
- PolicyVersion#update_permitted
TooManyInstanceVariables:
exclude:
- Loader::Orchestrate