Skip to content

Commit e91cfd2

Browse files
authored
Merge branch 'main' into RHIDP-3974-managing-authorization-using-the-Web-UI
2 parents 7ad5d6b + c589327 commit e91cfd2

9 files changed

+122
-56
lines changed

.github/workflows/build-asciidoc.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name: GitHub Pages
1717

1818
on:
1919
push:
20-
branches:
20+
branches:
2121
- main
2222
- rhdh-1.**
2323
- 1.**.x
@@ -41,14 +41,14 @@ jobs:
4141
run: |
4242
# update
4343
sudo apt-get update -y || true
44-
# install
45-
sudo apt-get -y -q install asciidoctor && asciidoctor --version
44+
# install
45+
sudo apt-get -y -q install podman && podman --version
4646
echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
4747
4848
- name: Build guides and indexes
4949
run: |
5050
echo "Building branch ${{ env.GIT_BRANCH }}"
51-
build/scripts/build.sh -b ${{ env.GIT_BRANCH }}
51+
build/scripts/build-ccutil.sh -b ${{ env.GIT_BRANCH }}
5252
5353
# repo must be public for this to work
5454
- name: Deploy
@@ -60,7 +60,7 @@ jobs:
6060
keep_files: true
6161
publish_dir: ./titles-generated
6262

63-
- name: Cleanup merged PR branches
63+
- name: Cleanup merged PR branches
6464
run: |
6565
PULL_URL="https://api.github.com/repos/redhat-developer/red-hat-developers-documentation-rhdh/pulls"
6666
GITHUB_TOKEN="${{ secrets.RHDH_BOT_TOKEN }}"
@@ -70,7 +70,7 @@ jobs:
7070
git checkout gh-pages; git pull || true
7171
dirs=$(find . -maxdepth 1 -name "pr-*" -type d | sed -r -e "s|^\./pr-||")
7272
refs=$(cat pulls.html | grep pr- | sed -r -e "s|.+.html>pr-([0-9]+)</a>.+|\1|")
73-
for d in $(echo -e "$dirs\n$refs" | sort -uV); do
73+
for d in $(echo -e "$dirs\n$refs" | sort -uV); do
7474
PR="${d}"
7575
echo -n "Check merge status of PR $PR ... "
7676
PR_JSON=$(curl -sSL -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" "$PULL_URL/$PR")

assemblies/assembly-authenticating-with-github.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[id="assembly-auth-provider-github"]
2-
= Enabling the GitHub authentication provider
1+
[id="authenticating-with-github"]
2+
= Authenticating with GitHub
33

44
To authenticate users with GitHub or GitHub Enterprise:
55

assemblies/assembly-configuring-authorization-in-rhdh.adoc

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11
[id='configuring-authorization-in-rhdh']
22
= Configuring authorization in {product}
33

4-
include::modules/authorization/con-rbac-overview.adoc[leveloffset=+1]
4+
In link:{authorization-book-url}[{authentication-book-title}], you learnt how to authenticate users to {product}.
5+
{product-short} knowns who the users are.
6+
7+
In this book, learn how to authorize users to perform actions in {product-short}.
8+
Define what users can do in {product-short}.
9+
10+
Role-Based Access Control (RBAC) is a security concept that controls access to resources in a system, and specifies a mapping between users of the system, and the actions they can perform on resources in the system.
11+
You define roles with specific permissions, and then assign the roles to users and groups.
12+
13+
RBAC on {product-short} is built on top of the Permissions framework, which defines RBAC policies in code.
14+
Rather than defining policies in code,
15+
the {product-short} RBAC feature allows you
16+
to define policies in a declarative fashion using a simple CSV based format.
17+
You can define the policies by using {product-short} web interface or REST API, rather than editing the CSV directly.
18+
19+
To apply RBAC in {product-short}:
20+
21+
. The {product-short} administrator sets up the RBAC feature:
22+
.. Enable the RBAC feature
23+
.. Configure Policy Administrators
24+
25+
. The {product-short} policy administrator configures your RBAC policies:
26+
.. Define roles with specific permissions
27+
.. Assign the roles to users and groups
28+
29+
30+
include::modules/authorization/proc-enabling-the-rbac-plugin.adoc[leveloffset=+1]
531

632

733
include::assembly-managing-authorizations-by-using-the-rhdh-web-ui.adoc[leveloffset=+1]
@@ -13,9 +39,6 @@ include::modules/authorization/ref-rbac-permission-policies.adoc[leveloffset=+1]
1339
include::modules/authorization/con-rbac-config-permission-policies.adoc[leveloffset=+2]
1440

1541

16-
include::modules/authorization/con-rbac-config-permission-policies-admin.adoc[leveloffset=+3]
17-
18-
1942
include::modules/authorization/con-rbac-config-permission-policies-external-file.adoc[leveloffset=+3]
2043

2144
include::modules/authorization/proc-mounting-the-policy-csv-file-using-the-operator.adoc[leveloffset=+4]

modules/authentication/proc-enabling-authentication-with-github.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,39 @@ auth:
159159
enterpriseInstanceUrl: ${GITHUB_HOST_DOMAIN}
160160
----
161161

162+
[TIP]
163+
====
164+
To enable GitHub integration with a different authentication provider, complete the following configurations:
165+
166+
* Add the GitHub provider to the existing `auth` section.
167+
* Keep the `signInPage` section from your authentication provider configuration.
168+
169+
.`app-config-rhdh.yaml` fragment with mandatory fields to enable GitHub integration and use a different authentication provider
170+
[source,yaml,subs="+quotes"]
171+
----
172+
auth:
173+
environment: production
174+
providers:
175+
github:
176+
production:
177+
clientId: ${AUTH_GITHUB_CLIENT_ID}
178+
clientSecret: ${AUTH_GITHUB_CLIENT_SECRET}
179+
__<your_other_authentication_providers_configuration>__
180+
integrations:
181+
github:
182+
- host: ${GITHUB_HOST_DOMAIN}
183+
apps:
184+
- appId: ${AUTH_GITHUB_APP_ID}
185+
clientId: ${AUTH_GITHUB_CLIENT_ID}
186+
clientSecret: ${GITHUB_CLIENT_SECRET}
187+
webhookUrl: ${GITHUB_WEBHOOK_URL}
188+
webhookSecret: ${GITHUB_WEBHOOK_SECRET}
189+
privateKey: |
190+
${GITHUB_PRIVATE_KEY_FILE}
191+
signInPage: __<your_main_authentication_provider>__
192+
----
193+
====
194+
162195
--
163196

164197
.Verification

modules/authorization/con-rbac-config-permission-policies-admin.adoc

Lines changed: 0 additions & 36 deletions
This file was deleted.

modules/authorization/con-rbac-overview.adoc

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[id='enabling-and-giving-access-to-rbac']
2+
= Enabling and giving access to the Role-Based Access Control (RBAC) feature
3+
4+
The Role-Based Access Control (RBAC) feature is disabled by default.
5+
Enable the RBAC plugin and declare policy administrators to start using RBAC features.
6+
7+
The permission policies for users and groups in the {product-short} are managed by permission policy administrators. Only permission policy administrators can access the Role-Based Access Control REST API.
8+
9+
.Prerequisites
10+
* You have link:{linkadminguide}#assembly-add-custom-app-file-openshift_admin-rhdh[added a custom {product-short} application configuration], and have sufficient permissions to modify it.
11+
* You have link:{authentication-book-title}[enabled an authentication provider].
12+
13+
.Procedure
14+
. The RBAC plugin is installed but disabled by default.
15+
To enable the `./dynamic-plugins/dist/janus-idp-backstage-plugin-rbac` plugin, edit your `dynamic-plugins.yaml` with the following content.
16+
+
17+
.`dynamic-plugins.yaml` fragment
18+
[source,yaml]
19+
----
20+
plugins:
21+
- package: ./dynamic-plugins/dist/janus-idp-backstage-plugin-rbac
22+
disabled: false
23+
----
24+
+
25+
See link:{installing-and-viewing-dynamic-plugins-url}[{installing-and-viewing-dynamic-plugins-title}].
26+
27+
. Declare policy administrators to enable a select number of authenticated users to configure RBAC policies through the REST API or Web UI, instead of modifying the CSV file directly.
28+
The permissions can be specified in a separate CSV file referenced in the `app-config-rhdh` ConfigMap, or permissions can be created using the REST API or Web UI.
29+
+
30+
To declare users such as _<your_policy_administrator_name>_ as policy administrators, edit your custom {product-short} ConfigMap, such as `app-config-rhdh`, and add following code to the `app-config-rhdh.yaml` content:
31+
+
32+
.`app-config.yaml` fragment
33+
[source,yaml,subs=+quotes]
34+
----
35+
permission:
36+
enabled: true
37+
rbac:
38+
admin:
39+
users:
40+
- name: user:default/__<your_policy_administrator_name>__
41+
----
42+
43+
.Verification
44+
. Sign out from the existing {product} session and log in again using the declared policy administrator account.
45+
. With RBAC enabled, most features are disabled by default.
46+
.. Navigate to the *Catalog* page in {product-very-short}.
47+
The *Create* button is not visible.
48+
You cannot create new components.
49+
.. Navigate to the API page.
50+
The *Register* button is not visible.
51+
52+
.Next steps
53+
* Explicitly enable permissions to resources in {product-short}.

modules/importing-repositories/procedure-enabling-the-bulk-import-from-github-feature.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
You can enable the Bulk Import feature for users and give them the necessary permissions to access it.
44

55
.Prerequisites
6-
* You have link:{authentication-book-url}#enabling-authentication-with-github[configured GitHub authentication and integration].
6+
* You have link:{authentication-book-url}#enabling-authentication-with-github[configured GitHub integration].
77

88
.Procedure
99

modules/importing-repositories/procedure-importing-multiple-repositories-from-github.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
In {product}, you can select your GitHub repositories and automate their onboarding to the {product-short} catalog.
55

66
.Prerequisites
7-
* You have link:{authentication-book-url}#enabling-authentication-with-github[configured GitHub authentication and integration].
87
* You have xref:enabling-and-giving-access-to-the-bulk-import-feature[enabled the Bulk Import feature and gave access to it].
98

109
.Procedure

0 commit comments

Comments
 (0)