diff --git a/docs/expressions/index.md b/docs/expressions/index.md index 4355dfca3..9f34050ef 100644 --- a/docs/expressions/index.md +++ b/docs/expressions/index.md @@ -1,6 +1,6 @@ # Expressions -Expressions allow you to write custom Logic using Python code. +Expressions allow you to write custom logic using Python code. Expressions are used in different places throughout passbook, and can do different things. @@ -46,7 +46,7 @@ return pb_is_group_member(request.user, name="test_group") ### `pb_user_by(**filters) -> Optional[User]` -Fetch a user matching `**filters`. Returns None if no user was found. +Fetch a user matching `**filters`. Returns "None" if no user was found. Example: diff --git a/docs/expressions/reference/user-object.md b/docs/expressions/reference/user-object.md index 5cdb0780a..69eeeaaac 100644 --- a/docs/expressions/reference/user-object.md +++ b/docs/expressions/reference/user-object.md @@ -2,18 +2,18 @@ The User object has the following attributes: - - `username`: User's Username - - `email` User's E-Mail - - `name` User's Display Name - - `is_staff` Boolean field if user is staff - - `is_active` Boolean field if user is active - - `date_joined` Date User joined/was created - - `password_change_date` Date Password was last changed - - `attributes` Dynamic Attributes + - `username`: User's username. + - `email` User's email. + - `name` User's display mame. + - `is_staff` Boolean field if user is staff. + - `is_active` Boolean field if user is active. + - `date_joined` Date user joined/was created. + - `password_change_date` Date password was last changed. + - `attributes` Dynamic attributes. ## Examples -List all the User's Group Names +List all the User's group names: ```python for group in user.groups.all(): diff --git a/docs/flow/flows.md b/docs/flow/flows.md index 5c429db15..d8eec0690 100644 --- a/docs/flow/flows.md +++ b/docs/flow/flows.md @@ -2,17 +2,17 @@ Flows are a method of describing a sequence of stages. A stage represents a single verification or logic step. They are used to authenticate users, enroll them, and more. -Upon Flow execution, a plan is generated, which contains all stages. This means upon execution, all attached policies are evaluated. This behaviour can be altered by enabling the **Re-evaluate Policies** option on the binding. +Upon flow execution, a plan containing all stages is generated. This means that all attached policies are evaluated upon execution. This behaviour can be altered by enabling the **Re-evaluate Policies** option on the binding. -To determine which flow is linked, passbook searches all Flows with the required designation and chooses the first instance the current user has access to. +To determine which flow is linked, passbook searches all flows with the required designation and chooses the first instance the current user has access to. ## Permissions -Flows can have policies assigned to them, which determines if the current user is allowed to see and use this flow. +Flows can have policies assigned to them. These policies determine if the current user is allowed to see and use this flow. ## Designation -Flows are designated for a single Purpose. This designation changes when a Flow is used. The following designations are available: +Flows are designated for a single purpose. This designation changes when a flow is used. The following designations are available: ### Authentication @@ -22,24 +22,24 @@ The authentication flow should always contain a [**User Login**](stages/user_log ### Invalidation -This designates a flow to be used for the invalidation of a session. +This designates a flow to be used to invalidate a session. This stage should always contain a [**User Logout**](stages/user_logout.md) stage, which resets the current session. ### Enrollment -This designates a flow for enrollment. This flow can contain any amount of Prompt stages, E-Mail verification or Captchas. At the end to create the user, you can use the [**User Write**](stages/user_write.md) stage, which either updates the currently staged user, or if none exists, creates a new one. +This designates a flow for enrollment. This flow can contain any amount of verification stages, such as [**email**](stages/email/index.md) or [**captcha**](stages/captcha/index.md). At the end, to create the user, you can use the [**user_write**](stages/user_write.md) stage, which either updates the currently staged user, or if none exists, creates a new one. ### Unenrollment -This designates a flow for unenrollment. This flow can contain any amount of verification, like [**E-Mail**](stages/email/index.md) or [**Captcha**](stages/captcha/index.md). To finally delete the account, use the [**User Delete**](stages/user_delete.md) stage. +This designates a flow for unenrollment. This flow can contain any amount of verification stages, such as [**email**](stages/email/index.md) or [**captcha**](stages/captcha/index.md). As a final stage, to delete the account, use the [**user_delete**](stages/user_delete.md) stage. ### Recovery -This designates a flow for recovery. This flow normally contains an [**Identification**](stages/identification/index.md) stage to find the user. Then it can contain any amount of verification, like [**E-Mail**](stages/email/index.md) or [**Captcha**](stages/captcha/index.md). -Afterwards, use the [**Prompt**](stages/prompt/index.md) stage to ask the user for a new password and use [**User Write**](stages/user_write.md) to update the password. +This designates a flow for recovery. This flow normally contains an [**identification**](stages/identification/index.md) stage to find the user. It can also contain any amount of verification stages, such as [**email**](stages/email/index.md) or [**captcha**](stages/captcha/index.md). +Afterwards, use the [**prompt**](stages/prompt/index.md) stage to ask the user for a new password and the [**user_write**](stages/user_write.md) stage to update the password. ### Change Password -This designates a flow for password changing. This flow can contain any amount of verification, like [**E-Mail**](stages/email/index.md) or [**Captcha**](stages/captcha/index.md). -Afterwards, use the [**Prompt**](stages/prompt/index.md) stage to ask the user for a new password and use [**User Write**](stages/user_write.md) to update the password. +This designates a flow for password changes. This flow can contain any amount of verification stages, such as [**email**](stages/email/index.md) or [**captcha**](stages/captcha/index.md). +Afterwards, use the [**prompt**](stages/prompt/index.md) stage to ask the user for a new password and the [**user_write**](stages/user_write.md) stage to update the password. diff --git a/docs/flow/stages/captcha/index.md b/docs/flow/stages/captcha/index.md index f9d730013..422caa4e4 100644 --- a/docs/flow/stages/captcha/index.md +++ b/docs/flow/stages/captcha/index.md @@ -2,6 +2,6 @@ This stage adds a form of verification using [Google's ReCaptcha](https://www.google.com/recaptcha/intro/v3.html). -This stage has two required fields. You need a Public and a Private key, both of which you can acquire at https://www.google.com/recaptcha/admin. +This stage has two required fields: Public key and private key. These can both be acquired at https://www.google.com/recaptcha/admin. ![](captcha-admin.png) diff --git a/docs/flow/stages/dummy/index.md b/docs/flow/stages/dummy/index.md index 2321803cb..9564585de 100644 --- a/docs/flow/stages/dummy/index.md +++ b/docs/flow/stages/dummy/index.md @@ -1,5 +1,5 @@ # Dummy stage -This stage is used for development, and has no function. It presents the User with a form, that requires a single confirmation. +This stage is used for development and has no function. It presents the user with a form which requires a single confirmation. ![](dummy.png) diff --git a/docs/flow/stages/email/index.md b/docs/flow/stages/email/index.md index c7f2f5e68..75dcb6d57 100644 --- a/docs/flow/stages/email/index.md +++ b/docs/flow/stages/email/index.md @@ -1,5 +1,5 @@ -# E-Mail +# Email -This stage can be used for E-Mail verification. passbook's background worker will send an E-Mail using the specified connection details. When an E-Mail can't be delivered, it is automatically periodically retried. +This stage can be used for email verification. passbook's background worker will send an email using the specified connection details. When an email can't be delivered, delivery is automatically retried periodically. ![](email-recovery.png) diff --git a/docs/flow/stages/identification/index.md b/docs/flow/stages/identification/index.md index 4096f40b0..c9b431e29 100644 --- a/docs/flow/stages/identification/index.md +++ b/docs/flow/stages/identification/index.md @@ -14,7 +14,7 @@ Valid choices: ### Template -This specifies which template is rendered. Currently there are two templates. +This specifies which template is rendered. Currently there are two templates: The `Login` template shows configured Sources below the login form, as well as linking to the defined Enrollment and Recovery flows. diff --git a/docs/flow/stages/invitation/index.md b/docs/flow/stages/invitation/index.md index db01b83be..06fd798ac 100644 --- a/docs/flow/stages/invitation/index.md +++ b/docs/flow/stages/invitation/index.md @@ -1,7 +1,7 @@ # Invitation Stage -This stage can be used to invite users. You can use this enroll users with preset values. +This stage can be used to invite users. You can use this to enroll users with preset values. -If the option `Continue Flow without Invitation`, this stage will continue when no invitation token is present. +If the option `Continue Flow without Invitation` is enabled, this stage will continue even when no invitation token is present. -If you want to check if a user has used an invitation within a policy, you can check `request.context.invitation_in_effect`. +To check if a user has used an invitation within a policy, you can check `request.context.invitation_in_effect`. diff --git a/docs/flow/stages/password/index.md b/docs/flow/stages/password/index.md index 319b0f486..3c0aeeaed 100644 --- a/docs/flow/stages/password/index.md +++ b/docs/flow/stages/password/index.md @@ -1,3 +1,3 @@ # Password Stage -This is a generic password prompt, which authenticates the currently `pending_user`. This stage allows the selection of the Backend the user is authenticated against. +This is a generic password prompt which authenticates the current `pending_user`. This stage allows the selection of the source the user is authenticated against. diff --git a/docs/flow/stages/prompt/index.md b/docs/flow/stages/prompt/index.md index c05f37858..61b2f83d0 100644 --- a/docs/flow/stages/prompt/index.md +++ b/docs/flow/stages/prompt/index.md @@ -6,20 +6,20 @@ This stage is used to show the user arbitrary prompts. The prompt can be any of the following types: -| | | +| Type | Description | |----------|------------------------------------------------------------------| -| text | Arbitrary text, no client-side validation is done. | -| email | E-Mail input, requires a valid E-Mail adress | -| password | Password Input | -| number | Number Input, any number is allowed | -| checkbox | Simple Checkbox | -| hidden | Hidden Input field, allows for the pre-setting of default values | +| text | Arbitrary text. No client-side validation is done. | +| email | Email input. Requires a valid email adress. | +| password | Password input. | +| number | Number input. Any number is allowed. | +| checkbox | Simple checkbox. | +| hidden | Hidden input field. Allows for the pre-setting of default values.| -A Prompt has the following attributes: +A prompt has the following attributes: ### `field_key` -HTML name used for the prompt. This key is also used to later retrieve the data in expression policies: +The HTML name used for the prompt. This key is also used to later retrieve the data in expression policies: ```python request.context.get('prompt_data').get('') @@ -27,16 +27,16 @@ request.context.get('prompt_data').get('') ### `label` -Label used to describe the Field. This might not be shown depending on the template selected. +The label used to describe the field. Depending on the selected template, this may not be shown. ### `required` -Flag that decides whether or not this field is required. +A flag which decides whether or not this field is required. ### `placeholder` -Field placeholder, shown within the input field. This field is also used by the `hidden` type as the actual value. +A field placeholder, shown within the input field. This field is also used by the `hidden` type as the actual value. ### `order` -Numerical index of the prompt. This applies to all stages this prompt is a part of. +The numerical index of the prompt. This applies to all stages which this prompt is a part of. diff --git a/docs/flow/stages/prompt/validation.md b/docs/flow/stages/prompt/validation.md index f2e64a9df..22d6b79f7 100644 --- a/docs/flow/stages/prompt/validation.md +++ b/docs/flow/stages/prompt/validation.md @@ -11,6 +11,6 @@ if request.context.get('prompt_data').get('password') == request.context.get('pr pb_message("Passwords don't match.") return False ``` -This policy expects you two have two password fields with `field_key` set to `password` and `password_repeat`. +This policy expects you to have two password fields with `field_key` set to `password` and `password_repeat`. -Afterwards bind this policy to the prompt stage you want to validate. +Afterwards, bind this policy to the prompt stage you want to validate. diff --git a/docs/installation/docker-compose.md b/docs/installation/docker-compose.md index bc54863e3..cae2fb093 100644 --- a/docs/installation/docker-compose.md +++ b/docs/installation/docker-compose.md @@ -1,6 +1,6 @@ # docker-compose -This installation Method is for test-setups and small-scale productive setups. +This installation method is for test-setups and small-scale productive setups. ## Prerequisites @@ -9,6 +9,8 @@ This installation Method is for test-setups and small-scale productive setups. ## Install +Download the latest `docker-compose.yml` from [here](https://raw.githubusercontent.com/BeryJu/passbook/master/docker-compose.yml). Place it in a directory of your choice. + ``` wget https://raw.githubusercontent.com/BeryJu/passbook/master/docker-compose.yml # Optionally enable Error-reporting @@ -22,4 +24,12 @@ docker-compose up -d docker-compose exec server ./manage.py migrate ``` -Afterwards, you can log in using `pbadmin` as username and password. +The compose file references the current latest version, which can be overridden with the `SERVER_TAG` environment variable. + +If you plan to use this setup for production, it is also advised to change the PostgreSQL password by setting `PG_PASS` to a password of your choice. + +Now you can pull the Docker images needed by running `docker-compose pull`. After this has finished, run `docker-compose up -d` to start passbook. + +passbook will then be reachable via HTTP on port 80, and HTTPS on port 443. You can optionally configure the packaged traefik to use Let's Encrypt certificates for TLS Encryption. + +The initial setup also creates a default admin user called `pbadmin` with the same password. It is highly recommended to change this password as soon as you log in. diff --git a/docs/installation/kubernetes.md b/docs/installation/kubernetes.md index c5a7c1df9..35882adab 100644 --- a/docs/installation/kubernetes.md +++ b/docs/installation/kubernetes.md @@ -1,6 +1,6 @@ # Kubernetes -For a mid to high-load Installation, Kubernetes is recommended. passbook is installed using a helm-chart. +For a mid to high-load installation, Kubernetes is recommended. passbook is installed using a helm-chart. This installation automatically applies database migrations on startup. After the installation is done, you can use `pbadmin` as username and password. diff --git a/docs/integrations/services/aws/index.md b/docs/integrations/services/aws/index.md index af87c8d9d..f4835240f 100644 --- a/docs/integrations/services/aws/index.md +++ b/docs/integrations/services/aws/index.md @@ -9,19 +9,19 @@ The following placeholders will be used: -- `passbook.company` is the FQDN of the passbook Install +- `passbook.company` is the FQDN of the passbook install. -Create an application in passbook and note the slug, as this will be used later. Create a SAML Provider with the following Parameters: +Create an application in passbook and note the slug, as this will be used later. Create a SAML provider with the following parameters: - ACS URL: `https://signin.aws.amazon.com/saml` - Audience: `urn:amazon:webservices` - Issuer: `passbook` -You can of course use a custom Signing Certificate, and adjust durations. +You can of course use a custom signing certificate, and adjust durations. ## AWS -Create a Role with the Permissions you desire, and note the ARN. +Create a role with the permissions you desire, and note the ARN. AWS requires two custom PropertyMappings; `Role` and `RoleSessionName`. Create them as following: @@ -29,4 +29,4 @@ AWS requires two custom PropertyMappings; `Role` and `RoleSessionName`. Create t ![](./property-mapping-role-session-name.png) -Afterwards export the Metadata from passbook, and create an Identity Provider [here](https://console.aws.amazon.com/iam/home#/providers). +Afterwards export the metadata from passbook, and create an Identity Provider [here](https://console.aws.amazon.com/iam/home#/providers). diff --git a/docs/integrations/services/gitlab/index.md b/docs/integrations/services/gitlab/index.md index 7b04e5d83..2cd2bf47b 100644 --- a/docs/integrations/services/gitlab/index.md +++ b/docs/integrations/services/gitlab/index.md @@ -14,13 +14,13 @@ The following placeholders will be used: - `gitlab.company` is the FQDN of the GitLab Install - `passbook.company` is the FQDN of the passbook Install -Create an application in passbook and note the slug, as this will be used later. Create a SAML Provider with the following Parameters: +Create an application in passbook and note the slug, as this will be used later. Create a SAML provider with the following parameters: - ACS URL: `https://gitlab.company/users/auth/saml/callback` - Audience: `https://gitlab.company` - Issuer: `https://gitlab.company` -You can of course use a custom Signing Certificate, and adjust durations. To get the value for `idp_cert_fingerprint`, you can use a tool like [this](https://www.samltool.com/fingerprint.php). +You can of course use a custom signing certificate, and adjust durations. To get the value for `idp_cert_fingerprint`, you can use a tool like [this](https://www.samltool.com/fingerprint.php). ## GitLab Configuration diff --git a/docs/integrations/services/harbor/index.md b/docs/integrations/services/harbor/index.md index fd1ac0142..4058a3e81 100644 --- a/docs/integrations/services/harbor/index.md +++ b/docs/integrations/services/harbor/index.md @@ -11,10 +11,10 @@ From https://goharbor.io The following placeholders will be used: -- `harbor.company` is the FQDN of the Harbor Install -- `passbook.company` is the FQDN of the passbook Install +- `harbor.company` is the FQDN of the Harbor install. +- `passbook.company` is the FQDN of the passbook install. -Create an application in passbook. Create an OpenID Provider with the following Parameters: +Create an application in passbook. Create an OpenID provider with the following parameters: - Client Type: `Confidential` - Response types: `code (Authorization Code Flow)` diff --git a/docs/integrations/services/rancher/index.md b/docs/integrations/services/rancher/index.md index ccd4e0152..e2c9d8d51 100644 --- a/docs/integrations/services/rancher/index.md +++ b/docs/integrations/services/rancher/index.md @@ -5,23 +5,23 @@ From https://rancher.com/products/rancher !!! note "" - An Enterprise Platform for Managing Kubernetes Everywhere + An enterprise platform for managing Kubernetes Everywhere Rancher is a platform built to address the needs of the DevOps teams deploying applications with Kubernetes, and the IT staff responsible for delivering an enterprise-critical service. ## Preparation The following placeholders will be used: -- `rancher.company` is the FQDN of the Rancher Install -- `passbook.company` is the FQDN of the passbook Install +- `rancher.company` is the FQDN of the Rancher install. +- `passbook.company` is the FQDN of the passbook install. -Create an application in passbook and note the slug, as this will be used later. Create a SAML Provider with the following Parameters: +Create an application in passbook and note the slug, as this will be used later. Create a SAML provider with the following parameters: - ACS URL: `https://rancher.company/v1-saml/adfs/saml/acs` - Audience: `https://rancher.company/v1-saml/adfs/saml/metadata` - Issuer: `passbook` -You can of course use a custom Signing Certificate, and adjust durations. +You can of course use a custom signing certificate, and adjust durations. ## Rancher diff --git a/docs/integrations/services/sentry/index.md b/docs/integrations/services/sentry/index.md index bb2456e36..d88de4fa7 100644 --- a/docs/integrations/services/sentry/index.md +++ b/docs/integrations/services/sentry/index.md @@ -15,10 +15,10 @@ From https://sentry.io The following placeholders will be used: -- `sentry.company` is the FQDN of the Sentry Install -- `passbook.company` is the FQDN of the passbook Install +- `sentry.company` is the FQDN of the Sentry install. +- `passbook.company` is the FQDN of the passbook install. -Create an application in passbook. Create an OpenID Provider with the following Parameters: +Create an application in passbook. Create an OpenID provider with the following parameters: - Client Type: `Confidential` - Response types: `code (Authorization Code Flow)` diff --git a/docs/integrations/services/tower-awx/index.md b/docs/integrations/services/tower-awx/index.md index 16c210e88..5855b8ab8 100644 --- a/docs/integrations/services/tower-awx/index.md +++ b/docs/integrations/services/tower-awx/index.md @@ -10,30 +10,30 @@ From https://docs.ansible.com/ansible/2.5/reference_appendices/tower.html Tower allows you to control access to who can access what, even allowing sharing of SSH credentials without someone being able to transfer those credentials. Inventory can be graphically managed or synced with a wide variety of cloud sources. It logs all of your jobs, integrates well with LDAP, and has an amazing browsable REST API. Command line tools are available for easy integration with Jenkins as well. Provisioning callbacks provide great support for autoscaling topologies. !!! note - AWX is the Open-Source version of Tower, and AWX will be used interchangeably throughout this document. + AWX is the open-source version of Tower. The term "AWX" will be used interchangeably throughout this document. ## Preparation The following placeholders will be used: -- `awx.company` is the FQDN of the AWX/Tower Install -- `passbook.company` is the FQDN of the passbook Install +- `awx.company` is the FQDN of the AWX/Tower install. +- `passbook.company` is the FQDN of the passbook install. -Create an application in passbook and note the slug, as this will be used later. Create a SAML Provider with the following Parameters: +Create an application in passbook and note the slug, as this will be used later. Create a SAML provider with the following parameters: - ACS URL: `https://awx.company/sso/complete/saml/` - Audience: `awx` - Issuer: `https://awx.company/sso/metadata/saml/` -You can of course use a custom Signing Certificate, and adjust durations. +You can of course use a custom signing certificate, and adjust durations. ## AWX Configuration Navigate to `https://awx.company/#/settings/auth` to configure SAML. Set the Field `SAML SERVICE PROVIDER ENTITY ID` to `awx`. -For the fields `SAML SERVICE PROVIDER PUBLIC CERTIFICATE` and `SAML SERVICE PROVIDER PRIVATE KEY`, you can either use custom Certificates, or use the self-signed Pair generated by Passbook. +For the fields `SAML SERVICE PROVIDER PUBLIC CERTIFICATE` and `SAML SERVICE PROVIDER PRIVATE KEY`, you can either use custom certificates, or use the self-signed pair generated by passbook. -Provide Metadata in the `SAML Service Provider Organization Info` Field: +Provide metadata in the `SAML Service Provider Organization Info` field: ```json { @@ -45,7 +45,7 @@ Provide Metadata in the `SAML Service Provider Organization Info` Field: } ``` -Provide Metadata in the `SAML Service Provider Technical Contact` and `SAML Service Provider Technical Contact` Fields: +Provide metadata in the `SAML Service Provider Technical Contact` and `SAML Service Provider Technical Contact` fields: ```json { @@ -71,4 +71,4 @@ In the `SAML Enabled Identity Providers` paste the following configuration: } ``` -`x509cert` is the Certificate configured in passbook. Remove the --BEGIN CERTIFICATE-- and --END CERTIFICATE-- headers, then enter the cert as one non-breaking string. +`x509cert` is the certificate configured in passbook. Remove the `--BEGIN CERTIFICATE--` and `--END CERTIFICATE--` headers, then enter the cert as one non-breaking string. diff --git a/docs/policies/expression.md b/docs/policies/expression.md index c6d9c9374..c057c9e41 100644 --- a/docs/policies/expression.md +++ b/docs/policies/expression.md @@ -21,10 +21,10 @@ return False ### Context variables - `request`: A PolicyRequest object, which has the following properties: - - `request.user`: The current User, which the Policy is applied against. ([ref](../expressions/reference/user-object.md)) + - `request.user`: The current user, against which the policy is applied. ([ref](../expressions/reference/user-object.md)) - `request.http_request`: The Django HTTP Request. ([ref](https://docs.djangoproject.com/en/3.0/ref/request-response/#httprequest-objects)) - - `request.obj`: A Django Model instance. This is only set if the Policy is ran against an object. + - `request.obj`: A Django Model instance. This is only set if the policy is ran against an object. - `request.context`: A dictionary with dynamic data. This depends on the origin of the execution. -- `pb_is_sso_flow`: Boolean which is true if request was initiated by authenticating through an external Provider. +- `pb_is_sso_flow`: Boolean which is true if request was initiated by authenticating through an external provider. - `pb_client_ip`: Client's IP Address or '255.255.255.255' if no IP Address could be extracted. - `pb_flow_plan`: Current Plan if Policy is called from the Flow Planner. diff --git a/docs/policies/index.md b/docs/policies/index.md index 4c86878b2..ad612c3e5 100644 --- a/docs/policies/index.md +++ b/docs/policies/index.md @@ -2,7 +2,7 @@ ## Kinds -There are two different Kind of policies, a Standard Policy and a Password Policy. Normal Policies just evaluate to True or False, and can be used everywhere. Password Policies apply when a Password is set (during User enrollment, Recovery or anywhere else). These policies can be used to apply Password Rules like length, etc. The can also be used to expire passwords after a certain amount of time. +There are two different kinds of policies; Standard Policy and Password Policy. Normal policies evaluate to True or False, and can be used everywhere. Password policies apply when a password is set (during user enrollment, recovery or anywhere else). These policies can be used to apply password rules such as length, complexity, etc. They can also be used to expire passwords after a certain amount of time. ## Standard Policies @@ -10,9 +10,9 @@ There are two different Kind of policies, a Standard Policy and a Password Polic ### Reputation Policy -passbook keeps track of failed login attempts by Source IP and Attempted Username. These values are saved as scores. Each failed login decreases the Score for the Client IP as well as the targeted Username by one. +passbook keeps track of failed login attempts by source IP and attempted username. These values are saved as scores. Each failed login decreases the score for the client IP as well as the targeted username by 1 (one). -This policy can be used to for example prompt Clients with a low score to pass a Captcha before they can continue. +This policy can be used, for example, to prompt clients with a low score to pass a captcha before they can continue. ## Expression Policy @@ -24,19 +24,19 @@ See [Expression Policy](expression.md). ### Password Policy -This Policy allows you to specify Password rules, like Length and required Characters. +This policy allows you to specify password rules, such as length and required characters. The following rules can be set: -- Minimum amount of Uppercase Characters -- Minimum amount of Lowercase Characters -- Minimum amount of Symbols Characters -- Minimum Length -- Symbol charset (define which characters are counted as symbols) +- Minimum amount of uppercase characters. +- Minimum amount of lowercase characters. +- Minimum amount of symbols characters. +- Minimum length. +- Symbol charset (define which characters are counted as symbols). ### Have I Been Pwned Policy -This Policy checks the hashed Password against the [Have I Been Pwned](https://haveibeenpwned.com/) API. This only sends the first 5 characters of the hashed password. The remaining comparison is done within passbook. +This policy checks the hashed password against the [Have I Been Pwned](https://haveibeenpwned.com/) API. This only sends the first 5 characters of the hashed password. The remaining comparison is done within passbook. ### Password-Expiry Policy -This policy can enforce regular password rotation by expiring set Passwords after a finite amount of time. This forces users to set a new password. +This policy can enforce regular password rotation by expiring set passwords after a finite amount of time. This forces users to set a new password. diff --git a/docs/property-mappings/expression.md b/docs/property-mappings/expression.md index 3888ce92d..067386b52 100644 --- a/docs/property-mappings/expression.md +++ b/docs/property-mappings/expression.md @@ -1,12 +1,12 @@ # Property Mapping Expressions -The property mapping should return a value that is expected by the Provider/Source. What types are supported, is documented in the individual Provider/Source. Returning `None` is always accepted, this simply skips this mapping. +The property mapping should return a value that is expected by the Provider/Source. Supported types are documented in the individual Provider/Source. Returning `None` is always accepted and would simply skip the mapping for which `None` was returned. !!! notice These variables are available in addition to the common variables/functions defined in [**Expressions**](../expressions/index.md) ### Context Variables -- `user`: The current user, this might be `None` if there is no contextual user. ([ref](../expressions/reference/user-object.md)) -- `request`: The current request, this might be `None` if there is no contextual request. ([ref](https://docs.djangoproject.com/en/3.0/ref/request-response/#httprequest-objects)) -- Arbitrary other arguments given by the provider, this is documented on the Provider/Source. +- `user`: The current user. This may be `None` if there is no contextual user. ([ref](../expressions/reference/user-object.md)) +- `request`: The current request. This may be `None` if there is no contextual request. ([ref](https://docs.djangoproject.com/en/3.0/ref/request-response/#httprequest-objects)) +- Other arbitrary arguments given by the provider, this is documented on the Provider/Source. diff --git a/docs/property-mappings/index.md b/docs/property-mappings/index.md index 7e7e21e17..7b7edd0d4 100644 --- a/docs/property-mappings/index.md +++ b/docs/property-mappings/index.md @@ -1,16 +1,16 @@ # Property Mappings -Property Mappings allow you to pass information to external Applications. For example, pass the current user's Groups as a SAML Parameter. Property Mappings are also used to map Source fields to passbook fields, for example when using LDAP. +Property Mappings allow you to pass information to external applications. For example, pass the current user's groups as a SAML parameter. Property Mappings are also used to map Source fields to passbook fields, for example when using LDAP. ## SAML Property Mapping -SAML Property Mappings allow you embed Information into the SAML AuthN Request. THis Information can then be used by the Application to assign permissions for example. +SAML Property Mappings allow you embed information into the SAML AuthN request. This information can then be used by the application to, for example, assign permissions to the object. -You can find examples [here](integrations/) +You can find examples [here](integrations/). ## LDAP Property Mapping -LDAP Property Mappings are used when you define a LDAP Source. These Mappings define which LDAP Property maps to which passbook Property. By default, these mappings are created: +LDAP Property Mappings are used when you define a LDAP Source. These mappings define which LDAP property maps to which passbook property. By default, the following mappings are created: - Autogenerated LDAP Mapping: givenName -> first_name - Autogenerated LDAP Mapping: mail -> email @@ -18,4 +18,4 @@ LDAP Property Mappings are used when you define a LDAP Source. These Mappings de - Autogenerated LDAP Mapping: sAMAccountName -> username - Autogenerated LDAP Mapping: sn -> last_name -These are configured for the most common LDAP Setups. +These are configured with most common LDAP setups. diff --git a/docs/providers.md b/docs/providers.md index 28cedf417..b48312612 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -1,15 +1,15 @@ # Providers -Providers allow external Applications to authenticate against passbook and use its User Information. +Providers allow external applications to authenticate against passbook and use its user information. ## OpenID Provider -This provider uses the commonly used OpenID Connect variation of OAuth2. +This provider utilises the commonly used OpenID Connect variation of OAuth2. ## OAuth2 Provider -This provider is slightly different than the OpenID Provider. While it uses the same basic OAuth2 Protocol, it provides a GitHub-compatible Endpoint. This allows you to integrate Applications, which don't support Custom OpenID Providers. -The API exposes Username, E-Mail, Name and Groups in a GitHub-compatible format. +This provider is slightly different than the OpenID Provider. While it uses the same basic OAuth2 Protocol, it provides a GitHub-compatible endpoint. This allows you to integrate applications which don't support custom OpenID providers. +The API exposes username, email, name, and groups in a GitHub-compatible format. This provider currently supports the following scopes: - `openid`: Access OpenID Userinfo @@ -20,5 +20,5 @@ This provider currently supports the following scopes: ## SAML Provider -This provider allows you to integrate Enterprise Software using the SAML2 Protocol. It supports signed Requests. This Provider uses [Property Mappings](property-mappings/index.md#saml-property-mapping) to determine which fields are exposed and what values they return. This makes it possible to expose Vendor-specific Fields. -Default fields are exposed through Auto-generated Property Mappings, which are prefixed with "Autogenerated..." +This provider allows you to integrate enterprise software using the SAML2 Protocol. It supports signed requests and uses [Property Mappings](property-mappings/index.md#saml-property-mapping) to determine which fields are exposed and what values they return. This makes it possible to expose vendor-specific fields. +Default fields are exposed through auto-generated Property Mappings, which are prefixed with "Autogenerated". diff --git a/docs/sources.md b/docs/sources.md index 28c6e6bfd..d1ffab326 100644 --- a/docs/sources.md +++ b/docs/sources.md @@ -1,39 +1,39 @@ # Sources -Sources allow you to connect passbook to an existing User directory. They can also be used for Social-Login, using external Providers like Facebook, Twitter, etc. +Sources allow you to connect passbook to an existing user directory. They can also be used for social logins, using external providers such as Facebook, Twitter, etc. ## Generic OAuth Source **All Integration-specific Sources are documented in the Integrations Section** -This source allows users to enroll themselves with an External OAuth-based Identity Provider. The Generic Provider expects the Endpoint to return OpenID-Connect compatible Information. Vendor specific Implementations have their own OAuth Source. +This source allows users to enroll themselves with an external OAuth-based Identity Provider. The generic provider expects the endpoint to return OpenID-Connect compatible information. Vendor-specific implementations have their own OAuth Source. -- Policies: Allow/Forbid Users from linking their Accounts with this Provider -- Request Token URL: This field is used for OAuth v1 Implementations and will be provided by the Provider. -- Authorization URL: This value will be provided by the Provider. -- Access Token URL: This value will be provided by the Provider. -- Profile URL: This URL is called by passbook to retrieve User information upon successful authentication. -- Consumer key/Consumer secret: These values will be provided by the Provider. +- Policies: Allow/Forbid users from linking their accounts with this provider. +- Request Token URL: This field is used for OAuth v1 implementations and will be provided by the provider. +- Authorization URL: This value will be provided by the provider. +- Access Token URL: This value will be provided by the provider. +- Profile URL: This URL is called by passbook to retrieve user information upon successful authentication. +- Consumer key/Consumer secret: These values will be provided by the provider. ## SAML Source -This source allows passbook to act as a SAML Service Provider. Just like the SAML Provider, it supports signed Requests. Vendor specific documentation can be found in the Integrations Section +This source allows passbook to act as a SAML Service Provider. Just like the SAML Provider, it supports signed requests. Vendor-specific documentation can be found in the Integrations Section. ## LDAP Source -This source allows you to import Users and Groups from an LDAP Server +This source allows you to import users and groups from an LDAP Server. -- Server URI: URI to your LDAP Server/Domain Controller -- Bind CN: CN to bind as, this can also be a UPN in the format of `user@domain.tld` -- Bind password: Password used during the bind process -- Enable Start TLS: Enables StartTLS functionality. To use SSL instead, use port `636` -- Base DN: Base DN used for all LDAP queries -- Addition User DN: Prepended to Base DN for User-queries. -- Addition Group DN: Prepended to Base DN for Group-queries. -- User object filter: Consider Objects matching this filter to be Users. -- Group object filter: Consider Objects matching this filter to be Groups. -- User group membership field: Field which contains Groups of user. -- Object uniqueness field: Field which contains a unique Identifier. -- Sync groups: Enable/disable Group synchronization. Groups are synced in the background every 5 minutes. -- Sync parent group: Optionally set this Group as parent Group for all synced Groups (allows you to, for example, import AD Groups under a root `imported-from-ad` group.) -- Property mappings: Define which LDAP Properties map to which passbook Properties. The default set of Property Mappings is generated for Active Directory. See also [LDAP Property Mappings](property-mappings/index.md#ldap-property-mapping) +- Server URI: URI to your LDAP server/Domain Controller. +- Bind CN: CN of the bind user. This can also be a UPN in the format of `user@domain.tld`. +- Bind password: Password used during the bind process. +- Enable StartTLS: Enables StartTLS functionality. To use LDAPS instead, use port `636`. +- Base DN: Base DN used for all LDAP queries. +- Addition User DN: Prepended to the base DN for user queries. +- Addition Group DN: Prepended to the base DN for group queries. +- User object filter: Consider objects matching this filter to be users. +- Group object filter: Consider objects matching this filter to be groups. +- User group membership field: This field contains the user's group memberships. +- Object uniqueness field: This field contains a unique identifier. +- Sync groups: Enable/disable group synchronization. Groups are synced in the background every 5 minutes. +- Sync parent group: Optionally set this group as the parent group for all synced groups. An example use case of this would be to import Active Directory groups under a root `imported-from-ad` group. +- Property mappings: Define which LDAP properties map to which passbook properties. The default set of property mappings is generated for Active Directory. See also [LDAP Property Mappings](property-mappings/index.md#ldap-property-mapping) diff --git a/docs/terminology.md b/docs/terminology.md index 1b345e079..db3e72947 100644 --- a/docs/terminology.md +++ b/docs/terminology.md @@ -1,27 +1,27 @@ ### Policy -A Policy is at a base level a yes/no gate. It will either evaluate to True or False depending on the Policy Kind and settings. For example, a "Group Membership Policy" evaluates to True if the User is member of the specified Group and False if not. This can be used to conditionally apply Stages, grant/deny access to various objects and is also used for other custom logic. +At a base level a policy is a yes/no gate. It will either evaluate to True or False depending on the Policy Kind and settings. For example, a "Group Membership Policy" evaluates to True if the user is member of the specified Group and False if not. This can be used to conditionally apply Stages, grant/deny access to various objects, and for other custom logic. ### Provider -A Provider is a way for other Applications to authenticate against passbook. Common Providers are OpenID Connect (OIDC) and SAML. +A Provider is a way for other applications to authenticate against passbook. Common Providers are OpenID Connect (OIDC) and SAML. ### Source -Sources are ways to get users into passbook. This might be an LDAP Connection to import Users from Active Directory, or an OAuth2 Connection to allow Social Logins. +Sources are locations from which users can be added to passbook. For example, an LDAP Connection to import Users from Active Directory, or an OAuth2 Connection to allow Social Logins. ### Application An application links together Policies with a Provider, allowing you to control access. It also holds Information like UI Name, Icon and more. -### Flows - -Flows are a method of describing a sequence of stages. These flows can be used to defined how a user authenticates, enrolls, etc. - ### Stages -A stage represents a single verification or logic step. They are used to authenticate users, enroll them, and more. These stages can optionally be applied to a flow via policies. +A stage represents a single verification or logic step. They are used to authenticate users, enroll users, and more. These stages can optionally be applied to a flow via policies. + +### Flows + +Flows are an ordered sequence of stages. These flows can be used to define how a user authenticates, enrolls, etc. ### Property Mappings -Property Mappings allow you to make Information available for external Applications. For example, if you want to login to AWS with passbook, you'd use Property Mappings to set the User's Roles based on their Groups. +Property Mappings allow you to make information available for external applications. For example, if you want to login to AWS with passbook, you'd use Property Mappings to set the user's roles in AWS based on their group memberships in passbook. diff --git a/docs/upgrading-from-0.8.x.md b/docs/upgrading-from-0.8.x.md index 2e9e39d22..d0728f8db 100644 --- a/docs/upgrading-from-0.8.x.md +++ b/docs/upgrading-from-0.8.x.md @@ -4,13 +4,13 @@ Due to some database changes that had to be rather sooner than later, there is n To export data from your old instance, run this command: -(with docker-compose) +- docker-compose ``` docker-compose exec server ./manage.py dumpdata -o /tmp/passbook_dump.json passbook_core.User passbook_core.Group passbook_crypto.CertificateKeyPair passbook_audit.Event docker cp passbook_server_1:/tmp/passbook_dump.json passbook_dump.json ``` -(with kubernetes) +- kubernetes ``` kubectl exec -it passbook-web-... -- ./manage.py dumpdata -o /tmp/passbook_dump.json passbook_core.User passbook_core.Group passbook_crypto.CertificateKeyPair passbook_audit.Event kubectl cp passbook-web-...:/tmp/passbook_dump.json passbook_dump.json @@ -18,13 +18,13 @@ kubectl cp passbook-web-...:/tmp/passbook_dump.json passbook_dump.json After that, create a new passbook instance in a different namespace (kubernetes) or in a different folder (docker-compose). Once this instance is running, you can use the following commands to restore the data. On docker-compose, you still have to run the `migrate` command, to create all database structures. -(docker-compose) +- docker-compose ``` docker cp passbook_dump.json new_passbook_server_1:/tmp/passbook_dump.json docker-compose exec server ./manage.py loaddata /tmp/passbook_dump.json ``` -(with kubernetes) +- kubernetes ``` kubectl cp passbook_dump.json passbook-web-...:/tmp/passbook_dump.json kubectl exec -it passbook-web-... -- ./manage.py loaddata /tmp/passbook_dump.json