-
Notifications
You must be signed in to change notification settings - Fork 142
Policy Template Factory #2714
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
Draft
jvanderhoof
wants to merge
42
commits into
master
Choose a base branch
from
policy-factory
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Policy Template Factory #2714
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- updates to policy - filter empty request params
a173698 to
0b86380
Compare
- Renamed `Factory` namespace to `Factories` - Refactored retrieval into a Repository
This ensures we detect the issue in which a http proxy is not correctly used with kube exec to inject the Conjur client certificate.
…in docs/Gemfile.lock Signed-off-by: Andy Tinkham <andy.tinkham@cyberark.com>
This commit: - Adds support for regional STS endpoints. - Improves log messaging for failed requests. - Adds unit tests for all authenticator functionality.
Conjur is currently the only project which uses the conjur-rack gem. This PR brings it into Conjur to simplify the authorization process.
This commit: - Replaces a call to `git` with the equivalent Ruby call. This prevents a Git permission error. - Addresses all Rubocop warnings.
Failure caused by regex update in #2792
Includes RSpec unit tests for these cases, along with VCR cassettes to playback authentic Identity responses.
- Spawn multiple processes to execute cucumber tests in parallel. Each process contains it's own indipendent conjur instance and postgresql database to avoid colisions. - Dynamically alter Ruby ENV variables based on the process executing the cucumber feature tests. - Dockerfile has been altered to support replicated services for parallel tests (this has not been altered to be dynamic and consists of static changes). - Alter cucumber.yml profiles to support parallel_tests ruby gem cmd usage The following tests have not been parallelized: - authenticators_k8s - rspec tests
- updates to policy - filter empty request params
6566647 to
d65d499
Compare
d65d499 to
dbea020
Compare
dbea020 to
8031a2a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This work is an extension of the my Hackathon effort from this past fall, which aimed enable an API for generating a variety of Conjur resources.
This effort:
Overview
Factory Structure
Factories are stored in Conjur Variables as Base64 encoded values. The above examples are all stored in the
conjur/factories/corepolicy. Shortly, we'll addconjur/factories/authenticatorsto encapsulate authenticator creation.The API selects the desired policy (ex.
coreorauthenticators) as well as the target variable name (group,policy,user,managed-policy, etc), we have an immense amount of flexibility to organize and create factories in the future.Using JSON Schema, each factory defines the inputs it requires and and optionally accepts. This information is available through the factory's
infoendpoint. This allows us to dynamically include these endpoints in CLIs and SDKs in the future.Security
Factory endpoint requests require
executepermission on the Factory variable and appropriate permssion on the target Policy. This allows Conjur RBAC to be used to manage who/what can use Factories to extend policy, and all actions are captured in Conjur Audit.Demo
To install the base policies required for the Policy Factory, run the following command on Conjur (Conjur needs to be running):
The above command will install a base policy into the
conjur/factoriesnamespace. This base policy includes factories for creating Conjur (all in thecorenamespace):GroupManagedPolicy- creates a policy with an owner groupPolicyUserWith the above factory templates, the following API endpoints become available:
API Overview
Group Endpoint Information
Response:
{ "title": "Group Template", "description": "Creates a Conjur Group", "type": "object", "properties": { "id": { "description": "Group ID", "type": "string" }, "branch": { "description": "Policy branch to load this group into", "type": "string" }, "annotations": { "description": "Additional annotations to add to the group", "type": "object" } }, "required": ["id", "branch"] }Create Group
Accepts a JSON object with the following params:
{ "id": "foo-bar", "branch": "foo/bar/baz", "annotations": { "test": "task", "authn/k8s": "value" } }The above will commit the following into the
foo/bar/baznamespace:The above API was created from the following schema:
{ "title": "Group Template", "description": "Creates a Conjur Group", "type": "object", "properties": { "id": { "description": "Group ID", "type": "string" }, "branch": { "description": "Policy branch to load this group into", "type": "string" }, "annotations": { "description": "Additional annotations to add to the group", "type": "object" } }, "required": ["id", "branch"] }and uses the following policy template:
Managed Policy Endpoint Information
Response:
{ "title": "Group Template", "description": "Creates a Conjur Group", "type": "object", "properties": { "id": { "description": "Group ID", "type": "string" }, "branch": { "description": "Policy branch to load this group into", "type": "string" }, "annotations": { "description": "Additional annotations to add to the group", "type": "object" } }, "required": ["id", "branch"] }Create Managed Policy
This endpoint creates a policy with a corresponding owner group.
Accepts a JSON object with the following params:
{ "id": "foo-bar", "branch": "foo/bar/baz", "annotations": { "test": "task", "authn/k8s": "value" } }The above will commit the following into the
foo/bar/baznamespace:The above API was created from the following schema:
{ "title": "Managed Policy Template", "description": "Policy with an owner group", "type": "object", "properties": { "name": { "description": "Policy name (used to create the policy ID and the <name>-admins owner group)", "type": "string" }, "branch": { "description": "Policy branch to load this policy into", "type": "string" }, "annotations": { "description": "Additional annotations to add to the user", "type": "object" } }, "required": ["id", "branch"] }and uses the following policy template:
Policy Endpoint Information
Response:
{ "title": "User Template", "description": "Creates a Conjur Policy", "type": "object", "properties": { "id": { "description": "Policy ID", "type": "string" }, "branch": { "description": "Policy branch to load this policy into", "type": "string" }, "owner": { "description": "Optional owner of this policy", "type": "string" }, "annotations": { "description": "Additional annotations to add to the user", "type": "object" } }, "required": ["id", "branch"] }Create Policy
Accepts a JSON object with the following params:
{ "id": "foo-bar", "branch": "foo/bar/baz", "owner": "!group foo-bar" "annotations": { "test": "task", "authn/k8s": "value" } }The above will commit the following policy into the
foo/bar/baznamespace, owned by the Conjur groupfoo-bar:The above API was created from the following schema:
{ "title": "User Template", "description": "Creates a Conjur Policy", "type": "object", "properties": { "id": { "description": "Policy ID", "type": "string" }, "branch": { "description": "Policy branch to load this policy into", "type": "string" }, "owner": { "description": "Optional owner of this policy", "type": "string" }, "annotations": { "description": "Additional annotations to add to the user", "type": "object" } }, "required": ["id", "branch"] }and uses the following policy template:
User Endpoint Information
Response:
{ "title": "User Template", "description": "Creates a Conjur User", "type": "object", "properties": { "id": { "description": "User ID", "type": "string" }, "branch": { "description": "Policy branch to load this user into", "type": "string" }, "annotations": { "description": "Additional annotations to add to the user", "type": "object" } }, "required": ["id", "branch"] }Create User
Accepts a JSON object with the following params:
{ "id": "foo-bar", "branch": "foo/bar/baz", "annotations": { "test": "task", "authn/k8s": "value" } }The above will commit the following into the
foo/bar/baznamespace:The above API was created from the following schema:
{ "title": "User Template", "description": "Creates a Conjur User", "type": "object", "properties": { "id": { "description": "User ID", "type": "string" }, "branch": { "description": "Policy branch to load this user into", "type": "string" }, "annotations": { "description": "Additional annotations to add to the user", "type": "object" } }, "required": ["id", "branch"] }and uses the following policy template:
Connected Issue/Story
N/A
Definition of Done
At least 1 todo must be completed in the sections below for the PR to be
merged.
Changelog
CHANGELOG update
Test coverage
changes, or
Documentation
READMEs) were updated in this PRBehavior
Security