Commit Graph

112 Commits

Author SHA1 Message Date
Rodrigo Barbieri 0967f6ec4e Add cache_time for identity
This patch adds a config option to allow
configuring the cache_time for identity elements.

It is also including a complementary fix for
change I49e46e010c543f831959581b2122f59068f2c07b
that missed adjusting the correct template, and
used the wrong comparison "is not None".

Closes-bug: #2054418
Related-bug: #1771114
Change-Id: I57d376eb6c1f0f38cdd028aacf397aaf7f3a1cda
2024-03-19 16:40:19 -03:00
Edward Hope-Morley 0cb787bb9d Make role-cache-expiration configurable
We use a default expiration_time (dogpile-expiration-time)
of 600s which means that role assignments will take up to
this amount of time before all caches are updated to
reflect changes. This may not be suitable for some clouds
that make frequent changes to role assignments and lowering
the global value is not recommended so this overrides the
[role] cache_time to a more appropriate value and also
makes it configurable. We leave default value as None so
that the global value is still inherited but this at least
allows it to be customised.

Change-Id: I49e46e010c543f831959581b2122f59068f2c07b
Closes-Bug: #1771114
2023-06-09 16:29:59 +01:00
Arif Ali b5c4eb2eae
Add auth_ttl into keystone.conf
There is a requirement for some end users where we need to specify
auth_ttl to a higher level. This should help with these users

Change-Id: Ifd515d7c103a6b24c4f5da500442406f04fb372f
2023-01-19 08:09:53 +00:00
Bas de Bruijne 6e5189646f Use juju-exec in chron jobs for juju3 support
Change-Id: Id2a92a134c2e663b3dca10dbc36dd7c7afc9c86b
2022-12-08 15:56:43 -04:00
Felipe Reyes cdce143628 Include openidc-*.conf in Apache.
This change adds a new configuration in line Apache's frontend
configuration to include (if present) the files generated by the
keystone-openidc charm to configure Open ID Connect configuration

Change-Id: I8c96b1f1ffad84d57276fd60461c1aee60b32d3b
2022-07-26 18:07:42 -04:00
Hemanth Nakkina f5d9b9ed40 New option default_authorization_ttl
Add new option default_authorization_ttl used for
federation to set validity of group memberships
coming from a mapping.

Closes-Bug: #1970388
Change-Id: I4a8dbc501e14d1201ceed27077554924c56e3abd
2022-05-16 12:05:15 +05:30
Dmitrii Shcherbakov f30d5e38f6 Revert a admin_and_matching_domain_id rule change
This reverts commit cef78d47fb.
Related-Bug: #1950379

Change-Id: I871eac8af34e49e771ffa8a7d8076d0bbcbb40ae
2021-11-11 15:37:54 +03:00
Nobuto Murata 44bf92f6bf Ease KeepAliveTimeout in line with keystoneauth1.session.Session
Apache2's default value for KeepAliveTimeout is 5 seconds, which is okay
for general web-page serving use cases. However, sessions and connection
pools created by keystoneauth1.session.Session can be terminated
unnecessarily during multiple API calls in a session due to the short
KeepAliveTimeout.

Let's ease KeepAliveTimeout to 75 seconds, which is fairly standard for
API services behind a reverse proxy since it's the default value of
nginx.

Closes-Bug: #1947010
Change-Id: Iff24f0f4b35fcc239abc14f37a76dcad8380d785
2021-10-17 02:42:33 +00:00
Zuul c2ca8d2184 Merge "policy: correct domain_id match for admin_and_matching_domain_id" 2021-10-06 00:17:00 +00:00
David Ames 7e6647951d Set WSGI env with lang=C.UTF-8
The default apache2 environment, and therefore the default WSGI
environment, sets LANG=C. For languages beyond the scope of ASCII
this can create problems.

Explicitly set the lang and locale to C.UTF-8 which will support all
UTF-8 language sets.

Change-Id: I110cc089fa7d51dfd513c630cb28cd49b330bf6f
Closes-Bug: #1933109
2021-06-22 10:06:17 -07:00
James Page cef78d47fb policy: correct domain_id match for admin_and_matching_domain_id
Ensure that the 'admin_and_matching_domain_id' rule correct
matches to the target.domain_id field, ensuring that domain
admins can actually query user and projects within a domain.

Change-Id: I4c000363dd7746f401613d99210e8ca12f34b010
Closes-Bug: 1830076
2021-06-15 16:47:46 +01:00
Zuul eba83e91ca Merge "Refresh cipher suites and protocols" 2021-04-09 02:32:19 +00:00
Corey Bryant 152e5b6cfe Support configurable dogpile cache expiration
The [cache]/expiration_time currently caches items for the default
of 600s and is not configurable via the charm. This change adds a
dogpile-cache-expiration config option that will default to 600s
so as not to cause any behavior changes by default.

Closes-Bug: #1899117
Change-Id: I639b2b77d5db69744897b6798613a797d05fe23b
Co-authored-by: Chris MacNaughton <chris.macnaughton@canonical.com>
2021-04-07 09:05:09 +02:00
Nobuto Murata 4c7c98ab90 Refresh cipher suites and protocols
The last update was 2016, and it's time to drop TLSv1 and TLSv1.1 as the
base configuration recommended by Mozilla.
https://wiki.mozilla.org/Security/Server_Side_TLS

This is equivalent to a charm-helper's change:
27d6ceb385

Closes-Bug: #1886630
Change-Id: Ia8cb1ad7417014fbc20178ccc598117c97a34188
2021-03-29 11:46:21 +09:00
Liam Young 57b9d62aaf Make catalog-cache-expiration configurable
Expose catalog-cache-expiration which can be used to specify how
long catalogue entries will  be cached for. In addiontion inform
charms that receive notifications of endpoint changes what this
setting is.

Change-Id: I3ce72efc5bd96c987748f66a275f92941daa8fe5
2020-09-29 15:59:38 +00:00
Zuul 7ff71cad6c Merge "Replace use of admin_token with Keystone bootstrap" 2020-03-18 16:43:44 +00:00
Frode Nordahl 0a02c30fe5
Replace use of admin_token with Keystone bootstrap
Stop the use of the admin_token and use the bootstrap process
to initialize Keystone instead.  Fortunately the implementation
of the bootstrap process is both idempotent when it needs to be
and it can be safely called on an existing deployment.

Subsequently we can migrate by just removing the admin_token
from the configuration and create new credentials for use by
the charm with a call to ``keystone-manage bootstrap``.

Remove configuration templates for versions prior to Mitaka, by
doing this we need to move any configuration initially defined
prior to Miataka forward to the ``templates/mitaka`` folder.

A side effect of this migration is that newly bootstrapped
deployments will get their ``default`` domain created with a
literal ID of ``default``.  Prior to this change third party
software making assumptions about that being the case may have
had issues.

Closes-Bug: #1859844
Closes-Bug: #1837113
Related-Bug: #1774733
Closes-Bug: #1648719
Closes-Bug: #1578678
Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/191
Change-Id: I23940720c24527ee34149f035c3bdf9ff54812c9
2020-03-13 09:52:10 +01:00
Camille Rodriguez 248239ea54 Modifying wsgi template to add optional config for Kerberos authentication
For the keystone-kerberos charm to configure correctly
with the keystone charm, the apache config needs to be
edited. Also, the alias needs the info of the keystone
context for the location of the script, hence cannot
be put in a separate optional config. It does not affect
non kerberos configuration.

Change-Id: I2842b628f0c3f88bd7efd735f76926b5d34cc108
2020-03-12 15:45:33 -05:00
Zuul 2b6b708fab Merge "Implement Security Compiance option for password" 2020-02-19 14:50:17 +00:00
Alex Kavanagh e83cb05bf8 Implement Security Compiance option for password
This feature adds a "password-security-compliance" option to the
charm to enable setting of keys in the "[security_compliance]" section
of the keystone.conf file.  This section was added in the Newton
release, and so this feature supports this from the Newton release.

It also protects the service accounts from two of the PCI-DSS options
but setting the user options 'ignore_password_expiry' and
'ignore_change_password_upon_first_use' to True to prevent the cloud
from being broken.

Change-Id: If7c54fae73188284bd9b03a53626cdf52158b994
Closes-Bug: #1776688
2020-02-05 18:10:12 +00:00
tpsilva 92e75b5aad Disable Apache port 80
Currently, Apache ports.conf file is not being configured by this
charm. This patch changes the ports.conf default file with another one
that does not open port 80 on SSL environments.

Change-Id: I35ba6bb31af6d795d02d90d0d127ac5c6c129d0f
Closes-bug: #1845665
2020-01-29 18:22:27 +00:00
Tiago Pasqualini da Silva 057a3ad7b2 Revert "Disable Apache default ports"
This reverts commit 25562b842e.

Change-Id: I48496e7d9649b3d7d68cc2c992332e018da263b9
2019-12-20 02:05:25 +00:00
tpsilva 25562b842e Disable Apache default ports
Openstack services don't use the default ports (80 and 443), so
change Apache to not open them.

Change-Id: I394e03de59e1d8f8e65197509dcf95fa05727afa
Closes-bug: #1845665
2019-11-27 12:51:51 +00:00
Eduardo Sousa d52e1b4b4b Replacing direct import for OAuth plugin
The direct import of the auth plugin
'keystone.auth.plugins.oauth1.OAuth' is deprecated since
Liberty.

The entrypoint should only be defined in case there is a
need to override the default implementation with a custom
class.

A closer inspection to the code confirms that:
70c9dd8256/keystone/conf/auth.py (L63)

Closes-Bug: #1837109

Change-Id: Icbad28cdefbccb6e6499ad4e19ad0d6bfaeff677
2019-09-24 14:14:23 +01:00
Eduardo Sousa 7d24238e72 Replacing direct import for token plugin
The direct import of the auth plugin
'keystone.auth.plugins.token.Token' is deprecated since
Liberty.

The entrypoint should only be defined in case there is a
need to override the default implementation with a custom
class.

A closer inspection to the code confirms that:
70c9dd8256/keystone/conf/auth.py (L38)

Closes-Bug: #1837110

Change-Id: I80e584de7d5bf46c5621e357333853975cfebade
2019-09-24 13:23:27 +01:00
Eduardo Sousa 631749ee7b Removing deprecated 'driver' option
Removing deprecated 'driver' option from 'token'
group in Queens.

Note: it was getting stuck during pause_resume test. Problem is fixed.

The value was deprecated in Pike:
05c535c0bc/keystone/conf/token.py (L76)

Closes-Bug: #1837108

Change-Id: I97c1bdc8f96b6320a52fdc2b329d2e8905f5be0e
2019-09-23 03:59:10 +01:00
David Ames a103c15e40 Use AuthMethod context
Rather than use hard coded auth methods, use the protocal named passed
over the keystone-fid-service-provider relation.

Also, when using federation do not allow the "external" method as they
are mutually exclusive.

Change-Id: I08f0632630d7f0e8d2d7ddb057e02f9febf9ad6f
Closes-Bug: #1828015
Closes-Bug: #1828018
2019-05-16 21:49:01 +00:00
Dmitrii Shcherbakov e580d1acf3 Enable application_credential auth plugin
Enables a client to use application credentials for authentication.

Change-Id: If6ff4bcabec2f976b79d87d57f4a763e8828c302
Closes-Bug: #1827058
2019-04-30 16:50:44 +03:00
Chris MacNaughton d8c406e405 Ensure Keystone sets check-max-request-body-size
Change-Id: I580669d82c3f37adceb75d5d6f368b09ea41b9da
Closes-Bug: #1819134
Func-Test-PR: https://github.com/openstack-charmers/zaza/pull/198
2019-03-11 12:36:54 +00:00
Aymen Frikha c272d2c707 Add support for Middleware
This patch creates a new middleware context to retrieve data
from subordinate charm and update the kesytone configuration file.
It also allows integration with keystone-middleware interface:
https://github.com/openstack-charmers/interface-keystone-middleware
This patch uses the subordinate configuration approach
to retrieve data from the subordinate charm.

Every changes required for paste.ini file will be handled by
the subordinate charm. The latter should deal with keystone upgrades.

Closes-Bug: #1808597

Change-Id: I4897011fbc791abc97e34e75826579820e80a4f1
2019-01-07 18:52:05 +00:00
Sahid Orentino Ferdjaoui d0720953c2 remove idle_timeout's opt in favor of connection_recycle_time
In icehouse database/idle_timeout has been deprecated in favor to
database/connection_recycle_time. This commit reflects the change in
our templates.

Change-Id: I6814a9d61d24c713e7a5182bf9683a393cda06bb
Closes-Bug: 1805592
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2018-11-28 10:12:13 +01:00
Alex Kavanagh 59561fdda0 Convert the charm to Python 3 only
Major changes:

 * decoupling the hooks/manager.py file from the charm.  It is now a
   script that is called from hooks/keystone_utils.py as it has to use
   the same Python version/libraries as the installed keystone payload
   software.  keystone_utils.py and manager.py communicate via a Unix
   Domain Socket using json, encoded to base64.
 * As Python3 requires absolute imports, the charmhelpers symlink has
   been removed from hooks, and the hooks and charmhelpers symlinks have
   been removed from the actions directory.  Instead, the path is
   adjusted so that the modules can be found.

Change-Id: I18996e15d2d08b1dacf0533132eae880cbb9aa32
2018-09-21 09:09:47 +00:00
Zuul e472adaf2f Merge "Cleanup `README.md`, `config.yaml` and `templates/`" 2018-08-17 06:16:41 +00:00
Alex Kavanagh b813360bf6 Keystone Fernet Token implementation
This patchset adds more Fernet token implementation:

1. Adds a cron job to rotate / sync keys to other units.
2. Adds additional tests around gating on config.
3. Adds rotation / syncing with more robust key handling.

Change-Id: Ied021ad83c241f241dbb5f9acdede9045e43a8a3
2018-08-14 08:35:43 +02:00
Frode Nordahl 1985c16033
Cleanup `README.md`, `config.yaml` and `templates/`
Remove configuration options which no longer have effect
(the supporting code has been removed).

Update and fix formatting of `README.md`.

Remove templates for no longer supported OpenStack releases.

Change-Id: Ibbda87738d98f6ad97da212ad1b56be88b33e9a3
2018-08-02 13:50:29 +02:00
Frode Nordahl 267aeb824f Remove entry point configuration
The configuration options for plugin entry points is
superflous and leads to Internal Server errors on Rocky.

Remove them from configuration and have Keystone use its
defaults.

Change-Id: I460aec084478f2ead8c16a11c0731bc110197368
Closes-Bug: #1784295
2018-07-30 08:39:38 +02:00
Frode Nordahl 1e991dc28b
Add initial support for Fernet tokens
Starting OpenStack Rocky the currently used `uuid` token format
is no longer supported and we need to change to use `fernet` tokens.

This change provides basic functionalty to initialize fernet token
repository and distribute keys to non-leader units.

A configuration option is also added allowing change of token format
in a controlled manner prior to upgrading to OpenStack Rocky.

Further work is required to implement key rotation, actions etc. and
these topics will be addressed in separate commits.

The commit also fixes a instance of missing release check for writing
of `policy.json`, and a few places where writing of `policy.json`
previously was omitted.

Change-Id: I1d0ff22a5f091b02f5700412745572c246103e9e
2018-07-25 15:23:47 +02:00
Frode Nordahl ac40485052 Update keystone.conf and policy.json for Rocky
Purge references to upstream removed sections and token
features.

policy.json now at level with:
openstack/keystone@0022adb6ae

Change-Id: I0e1163d1c16c7987409dff23ce6cdcc35df302ab
2018-07-24 12:44:35 +02:00
Frode Nordahl 75811fdcf7
Remove references to `pki` and `pkiz` tokens in templates
The functionality was removed from charm in commit
17b24e7fde

Template references was left behind and this commit addresses
that.

Change-Id: I55362faec21f32cccdcb82f810680b70fe2fb53b
2018-07-24 12:40:49 +02:00
Zuul 17acfa25bd Merge "enable totp auth plugin" 2018-07-12 16:07:39 +00:00
Liam Young f960109cb3 Enable proxy header parsing
Ensure that oslo.middleware parses any proxy information
forwarded from haproxy/apache with regards to protocol;
this ensures that https connections are correctly detected.

Includes charm helper sync to bring in oslo middleware
template.

Change-Id: I2ce75a4a2033d8d3c07bd9f7ce6e4f5f6d9488cf
Closes-Bug: 1758675
2018-06-28 11:57:55 +09:00
Dmitrii Shcherbakov 8aed72e20f enable totp auth plugin
The only config change is in keystone.conf to enable totp auth plugin.

A secret can be generated via an arbitrary tool and uploaded to Keystone
via credential api by specifying "totp" credential type, secret and a
user id.

https://developer.openstack.org/api-ref/identity/v3/#create-credential

https://blueprints.launchpad.net/keystone/+spec/totp-auth
https://docs.openstack.org/keystone/pike/advanced-topics/auth-totp.html#configuring-totp

Change-Id: Ie3e4d828aae1f0918ace94adbdfdb81ffdc12878
2018-06-14 19:23:39 +00:00
Frode Nordahl 2443479316
Update policy.json for Queens
Source: 166eced28b15335f816134806bf5bb6b50c222cd

Remove v2 section from template as Queens is v3 only.

Change-Id: Ic2b1215421ad870096fab7e1aee1f7604c1892a2
Closes-Bug: #1774716
2018-06-06 12:58:00 +02:00
Dmitrii Shcherbakov 6f3751cc96 add support for Federated IDentity (FID) and WebSSO
* add support for relating with subordinate charms providing Service
Provider functionality via apache2 authentication modules;
* enable additional authentication methods on the keystone side to
accept parsed assertion data provided via apache2 authentication module
variables exported to WSGI environment;
* move https frontend and WSGI API apache config files to keystone
instead of relying on charm-helpers as modifications are needed there to
add IncludeOptional directives. openstack_https_frontend.conf is added
on purpose as ServerName cannot be correctly determined after ProxyPass
which results in TLS errors during SAML exchange process;
* add an additional relation to openstack-dashboard to provide URL
information necessary to trust 'origin' parameter in WebSSO URLs used by
horizon during the authentication process. Also add a context to render
the federation section that is used to render this information in
keystone.conf;

Subordinates can choose to use different apache2 authentication modules.
If those modules support vhost-level variables then multiple
subordinates for the same module can be used. For example,
mod_auth_mellon can be used multiple times in different vhosts to
protect federated token endpoints related to different identity provider
and protocol combinations).

Trusted dashboard relation could be used to provide dashboard origin URL
from a different site via cross-model relations.

NOTE: this functionality will be triggered only on Ocata+ (inclusive)

Change-Id: I1ef623b0b0e2a9f68cec4be550965c5e15e5f561
2018-05-11 21:09:47 +03:00
James Page e8f1fdd8a1 Remove deploy from source support
Drop support for deployment from Git repositories, as deprecated
in the 17.02 charm release.  This feature is unmaintained and has
no known users.

Change-Id: Ic054e29ef55d8890a3130af16b48f105efcf8f6a
2018-01-12 10:42:25 +00:00
Liam Young 4b00281bb4 Add memcache backend
Install and configure memcached on the keystone units and configure
keystone to use the cache. This should speed up token access for
existing tokens.

Change-Id: I26af0a97660e5bbe293a32e6b9e3d209338f905a
Closes-Bug: #1722541
2017-10-17 11:10:48 +00:00
James Page 9515a78cf0 Use compatible uuid entry point for tokens backend
Ensure that a valid entry point is used for the uuid token
backend, resolving compatibility with later OpenStack releases.

Change-Id: I566e6a2e9c0aa1fc1afe02dbc9f899cfb0c7a9f6
Closes-Bug: 1722909
2017-10-11 16:45:37 -04:00
Jenkins 2359950179 Merge "Snap install OpenStack in Charms" 2017-10-04 18:00:29 +00:00
David Ames 8da85834c2 Snap install OpenStack in Charms
Install OpenStack using snaps. By setting openstack-origin to
snap:track/channel or snap:track the charm will use snaps to
install rather than debs. If channel is left off it defaults to
stable. For example: snap:ocata/edge will install the edge version of
Ocata and snap:pike will install the stable version of Pike.

Charm helpers sync for snap related helpers.

Change-Id: I6e3540e4ffe081540404f91061e5c9b7039b3eac
2017-09-28 17:34:11 +00:00
James Page ee45612e7c pki: conditional enablement of signing section
Only enable the [signing] section of the keystone configuration
if PKI token format is in use; other token formats don't have
support for token revocation retrieval.

Note that PKI format tokens are no longer supported >= Pike.

Change-Id: I8179ecc5d37d866588147f639ebc77a870408dfe
Closes-Bug: 1709189
2017-08-10 15:22:50 +01:00