212 Commits

Author SHA1 Message Date
Gage Hugo
fc680cf8c4 Update typo in subPath for volume mount
When using a chart with the flux operator and helm3, it fails
when encountering a volumeMount "subpath" instead of "subPath".

This change corrects the typo to the right camelcase entry.

Change-Id: Id2d9ea25445d84f89b299c7f0b24da1cc5aaf264
2021-01-28 22:51:59 +00:00
Mohammed Naser
f5a757b106 [keystone] Fix fernet secret reset
This patch makes the fernet and credential secret something that gets
created only once when the deployment is first done, as when using Helm,
it's possible that it overrides it's values with an empty secret in the
runs afterwards.

By making it a hook, it will instead create it and leave an owner
reference in Helm 3 to delete it later if the release is deleted.  It
will not manage it afterwards as well.

Change-Id: I7c1c97f38877e0e54bea7fc09b37dd6f77c9dc8a
2020-10-21 16:12:56 -04:00
Gage Hugo
fe53b5e559 Add blank access_rules file
When starting the keystone-api pod, the service checks for a
access_rules file for application credentials during startup.
If the file does not exist, keystone emits a warning saying the
file is not found:

WARNING keystone.access_rules_config.backends.json [-] No config
file found for access rules, application credential access rules
will be unavailable.: FileNotFoundError: [Errno 2] No such file
or directory: '/etc/keystone/access_rules.json'

This change adds in a blank access_rules.json file to the
keystone etc directory in order to surpress this message.

Change-Id: I63ac153cc91ac45b3fd223f8a54b933b5cbffac4
2020-10-15 21:13:34 +00:00
Zuul
4f1e1329ad Merge "Do no recreate fernet tokens on setup" 2020-08-07 19:21:17 +00:00
PrateekDodda
fc5712909e Add missing security context to Keystone pods/containers
This updates the Keystone chart to include the pod
security context on the pod template.

This also adds the container security context to set
readOnlyRootFilesystem flag to true

Change-Id: I0e00571d4060cca914d1bdb4f36e736fa8501130
2020-08-05 13:37:33 -05:00
Gupta, Sangeet (sg774j)
c12ada7224 feat(tls): keystone domain manage script to pass cert
This patch add capability to pass certificate in request method.

Change-Id: I2e431bf3a34f40f58254e4f2b61554453471e0de
2020-07-29 13:21:48 +00:00
Gupta, Sangeet (sg774j)
74dfea1ce9 keystone: Fix indentation
Change-Id: If25cabc5e70897337dfef7e5401936a79878443b
2020-07-28 23:39:00 +00:00
Zuul
2036a98b6d Merge "feat(tls): add tls support to openstack services" 2020-07-27 18:00:51 +00:00
Gupta, Sangeet (sg774j)
b94340008e feat(tls): add tls support to openstack services
Mount tls certs to keystone-domain-manage job containers.

Change-Id: I44eed213cc9235266faf4a0119ed8700206cdad2
2020-07-27 14:52:52 +00:00
Gupta, Sangeet (sg774j)
7b720184e3 feat(tls): Make openstack services compatible with mariadb with TLS
Change database scerets.

Change-Id: I068dfcb23d596d4b9bcde1944fb4def010490452
2020-07-24 23:02:09 +00:00
DODDA, PRATEEK REDDY (pd2839)
46afde4c6d Add missing security context to Keystone pods/containers
This updates the Keystone chart to include the pod
security context on the pod template.

This also adds the container security context to set
readOnlyRootFilesystem flag to true

Change-Id: I655ef19a3c187e3462ff8ec1a54bc9691ca64d41
2020-07-21 17:33:15 +00:00
DODDA, PRATEEK REDDY (pd2839)
2eaa98ecf1 Add missing security context for Keystone rally tests
Change-Id: I29a432f28a4d8dd57341152d60b34c5a391e872f
2020-07-16 13:11:49 -05:00
sgupta
702c17eb78 feat(tls): Make openstack services compatible with mariadb with TLS
Depends-on: https://review.opendev.org/#/c/741037/
Change-Id: I21f4ede3bd18c0af8da1eba60cd0b7b932a31410
2020-07-14 23:32:03 +00:00
Zuul
f9862e221e Merge "Add missing security context to Keystone pods/containers" 2020-07-13 18:57:52 +00:00
Tin Lam
918a307427 feat(tls): add tls support to openstack services
This patch set enables TLS for the following OpenStack services: keystone,
horizon, glance, cinder, heat, nova, placement and neutron for s- (stein)
and t- (train) release. This serves as a consolidation and clean up patch
for the following patches:

[0] https://review.opendev.org/#/c/733291
[1] https://review.opendev.org/#/c/735202
[2] https://review.opendev.org/#/c/733962
[3] https://review.opendev.org/#/c/733404
[4] https://review.opendev.org/#/c/734896

This also addresses comments mentioned in previous patches.

Co-authored-by: Gage Hugo <gagehugo@gmail.com>
Co-authored-by: sgupta <sg774j@att.com>

Depends-on: https://review.opendev.org/#/c/737194/

Change-Id: Id34ace54298660b4b151522916e929a29f5731be
Signed-off-by: Tin Lam <tin@irrational.io>
2020-07-10 09:36:31 -05:00
DODDA, PRATEEK REDDY
cba3deb94e Add missing security context to Keystone pods/containers
This updates the Keystone chart to include the pod
security context on the pod template.

This also adds the container security context to set
readOnlyRootFilesystem flag to true.

Change-Id: I2ac3a4efa6798e263de19f0db444f37c5236d121
2020-07-09 18:20:23 -05:00
diwakar thyagaraj
477602f2e7 Enable Apparmor to osh test Pods
Change-Id: I0a67f66cc4ed8a1e3a5c3c458b7c1521f9169160
Signed-off-by: diwakar thyagaraj <diwakar.chitoor.thyagaraj@att.com>
2020-06-01 18:32:51 +00:00
Gage Hugo
db79e79788 Remove OSH Authors copyright
The current copyright refers to a non-existent group
"openstack helm authors" with often out-of-date references that
are confusing when adding a new file to the repo.

This change removes all references to this copyright by the
non-existent group and any blank lines underneath.

Change-Id: Ia035037e000f1bf95202fc07b8cd1ad0fc019094
2020-04-03 20:53:32 +00:00
KAVVA, JAGAN MOHAN REDDY (jk330k)
e9700988dc Enable Docker default AppArmor profile to keystone
This adds default Apparmor profile to keystone.

Change-Id: Ief454ca936ea21a061562432b2aa1e8045cbc4e9
2020-02-12 22:26:40 +00:00
Tin Lam
45e22e45a5 [Keystone] Fix status code logic
This patch set fixes an issue with where the keystone chart's
domain-manage job/pod always restart once due to a calculation
logic error.

Change-Id: I801d04559a526d3a7339cd5102f2e738af9f72e0
Signed-off-by: Tin Lam <tin@irrational.io>
2020-01-31 14:29:46 -06:00
Andrey Volkov
8957bacb4a Do no recreate fernet tokens on setup
In case of keystone-fernet-setup job rerun (delete and create),
fernet tokens are recreated. Which leads to ongoing openstack request
fail.

keystone-manage fernet_setup is idempotent, let's make the
keystone-fernet-setup job idempotent as well.

Change-Id: I62e741fe5192b7a0018bc84ccdac1ea5311a1e03
2019-12-06 13:44:33 +03:00
Evgeny L
91f87c21dc Add missing pod labels for CronJobs
Pods for some of the CronJobs do not have correct
application and component labels applied, they are
unable to start if Network Policies are enabled.

Change-Id: Ie4eed0e9829419b4b2e40e9b712b73a86d6fc3d2
2019-10-28 19:57:08 +00:00
Tin Lam
938a1deb03 Ensure python scripts are py3 compatible
This patch set is one of many to migrate existing code/script to be
python-3 compatible as python-2 is sunsetting in January of 2020.

Change-Id: I337069203a3273e9aba6a37294ee3c25e5b4870a
Signed-off-by: Tin Lam <tin@irrational.io>
2019-10-10 23:10:03 +00:00
Andrii Ostapenko
3468ae43c9 Add strict False param for Config parser
Py3 RawConfigParser does not allow options duplication.

Change-Id: I251fe9c2028fed2f55dee0ef92a3cda89da8a9f6
2019-09-27 15:26:52 -05:00
Itxaka
b4eaa63548
Keystone: allow probes configuration
Probe configuration is now available for keystone for both liveness and
readiness checks.

Change-Id: I1f0e0a1ff9cd10c5acbec33af87aa9e59959b2d2
2019-09-25 12:17:43 +02:00
Itxaka
a6ccab5270
Use proper keystone path for probes
Using the direct / path for the keystone probes can lead to the
probes receiving an http 300. We want to have an http 200 so there
is no warning from the probes. Use the full v3 path so the probes
are stable

Change-Id: If8b45801bb053778bd2e1691ff8556aa73cb434d
2019-09-17 12:06:21 +02:00
Zuul
59f27040d5 Merge "Handle keystone cred cleanup hook fail" 2019-09-13 18:45:02 +00:00
Gage Hugo
56538d7c76 Handle keystone cred cleanup hook fail
In cases where mariadb is not accessable, either from being deleted
prior to deleting keystone, or some other reason, it is preferred
to fail and move on with the keystone-credential-cleanup.

This change adds hook-failed to the "hook-delete-policy" for the
keystone-credential-cleanup job. This is address cases where deleting
keystone would cause the delete task to hang while the cleanup hook
would fail to connect to mariadb, often due to mariadb being already
deleted.

Change-Id: Ice7187fe6329c8b12333f508351bd5f9e2cdc8e2
2019-09-03 13:15:28 -05:00
Ivan Kolodyazhny
7b30ea5d3f Fix keystone-credential-cleanup job with Python 3
Python 3 renamed ConfigParser module to configparser.
This patch fixes compatibility with Python 3 for the
keystone-credential-cleanup job.

Change-Id: I6e34ba995d7a02f94b12162f0e5f8f326dfa8108
2019-09-03 15:30:21 +03:00
Gage Hugo
a57cd78439 Fix credential cleanup hook
The keystone-credential-cleanup hook was previously changed to
post-delete, this can cause issues where the serviceName is deleted
prior to running and will cause this to fail. This change reverts
the hook back to pre-delete to avoid this issue.

Change-Id: I45f3e73f8a957576ef82a733c1a7b7feaba7b679
2019-07-09 06:12:11 +00:00
Zuul
f67940e3ce Merge "Change cred-cleanup to not restart on failure" 2019-06-22 05:11:05 +00:00
Dejaeger, Darren (dd118r)
aa0d80c59d Add node selector to Keystone test pod
This PS looks to add a node selector into the Keystone test pod's
spec.

Change-Id: If92e0eb6814e25ba108f36298ba01044d42ced33
2019-06-20 11:58:41 -04:00
Pete Birley
9bcf0df94c Messaging: use htk function to directly hit RabbitMQ servers
This PS updates the charts to use the htk function recently introduced
to allow oslo.messaging clients ans servers to directly hit their
backends rather than using either DNS or K8S svc based routing.

Depends-On: I5150a64bd29fa062e30496c1f2127de138322863

Change-Id: I458b4313c57fc50c8181cedeca9919670487926a
Signed-off-by: Pete Birley <pete@port.direct>
2019-06-18 21:47:45 +00:00
Pete Birley
31bd9c832d Logs: Make it optional to use log_config_append option
This PS enables the use of simple logging options if desired.

Change-Id: If6ea420c6ed595b3b6b6eedf99a0bf26a20b6abf
Signed-off-by: Pete Birley <pete@port.direct>
2019-06-17 13:51:21 -05:00
Gage Hugo
f088fee667 Change cred-cleanup to not restart on failure
When cleaning up an entire openstack deployment, it's possible
that mariadb will be deleted prior to keystone, and as a result
keystone-credential-cleaup hook will not be able to run. This
blocks the cleanup from occuring successfully.

This change sets the keystone-credential-cleanup hook to run
"post-delete" and the pod restart policy to "Never". If
the mariadb deployment is gone, this hook is unneeded.

Change-Id: I7e2e4680e35fb243488e707cf5a4a26e05433913
2019-06-12 15:26:50 +00:00
Gage Hugo
3b14e77d2a Skip cred-key setup when keys already exist
This change adds a conditional to the _fernet_setup to avoid
overwriting credential-keys when keystone-manage credential-setup
is ran and there are already existing credential keys. This will
mitigate issues where encrypted credential blobs in keystone were
becoming un-decryptable when the credential keys were being
overridden or lost upon upgrading.

Change-Id: Iac2b080d5d44bdf07534126419a1d5dd86055d6b
2019-04-26 18:31:07 +00:00
Pete Birley
623c131292 OSH: Add emptydirs for tmp
This PS adds emptydirs backing the /tmp directory in pods, which
is required in most cases for full operation when using a read only
filesystem backing the container.

Additionally some yaml indent issues are resolved.

Change-Id: I9df8f70e913b911ff755600fa2f669d9c5dcb928
Signed-off-by: Pete Birley <pete@port.direct>
2019-04-20 08:55:44 -05:00
Gage Hugo
3d6f3088a3 Add credential delete hook to keystone chart
This change creates a pre-delete hook to clean out all entries
in the credential table of the keystone database when the
keystone service is deleted. Note that these are not
the typical username/password.[0]

This fixes the issue of leftover credential blobs being saved
in the database that are unable to be decrypted since the
original encryption keys are removed upon deletion of the
keystone service

[0] https://specs.openstack.org/openstack/keystone-specs/specs/keystone/newton/credential-encryption.html

Change-Id: I8adf0878af2f3b880e9194a6cb8d97b58d6895a5
2019-04-17 20:10:48 +00:00
Itxaka
229db2f155 Allow more generic overrides for keystone
With this patch we allow for a more easy way of overriding some
of the values that may be used in other distros while maintainting
the default values if those values are not overriden.

The following values are introduced to be overriden:
conf:
  security:
  software:
    apache2:
      conf_dir:
      site_dir:
      mods_dir:
      binary:
      start_flags:
      a2enmod:
      a2dismod:

On which:
 * conf_dir: directory where to drop the config files
 * site_dir: directory where to drop the enabled virtualhosts
 * mods_dir: directory where to drop any mod configuration
 * binary: the binary to use for launching apache
 * start_flags: any flags that will be passed to the apache binary call
 * a2enmod: mods to enable
 * a2dismod: mods to disable
 * security: security configuration for apache

Notice that if there is no overrides given, it should not affect anything
and the templates will not be changed as the default values are set to what
they used to be as to not disrupt existing deployments.

Change-Id: I7622325cf23e5afb26a5f5e887458fd58af2fab8
2019-04-12 04:16:48 +00:00
Zuul
d40d2d084d Merge "Implement Security Context for Keystone" 2019-03-22 21:32:30 +00:00
pd2839
3cd1b78b68 Implement Security Context for Keystone
Implement container security context for the following Keystone resources:
 - Keystone server deployment

Change-Id: Ia68b5ebe4d76e0405d67224d976fee013cc02d0b
2019-03-19 20:51:59 +00:00
Itxaka
e136b0d822 Fix py3 issue on fernet-manage and update-endpoint
fernet-manage:
 - filter used to return a list on python2 but on python3 it returns
 an iterator which has no len method
 - Coherce the keys var into a list so we can run len on it on both
 versions

update-endpoint:
 - ConfigParser is called configparser on python3
 - try/catch and import the proper configparser

Change-Id: I8296074f4d20e47afe0c7aea41bf21999685aecd
2019-03-14 21:24:47 +00:00
pd2839
0c502d2062 readOnlyFilesystem: true for keystone chart
Fix for adding readOnlyFilesystem flag at pod level

Change-Id: I37fb7f580ae0a408530d58b195c353e41d701eac
2019-03-04 21:43:43 +00:00
Steve Wilkerson
f4c01d2461 Add release-uuid annotation to pod spec
This adds the release-uuid annotation to the pod spec for all
replication controller templates in the openstack-helm charts

Change-Id: I0159f2741c27277fd173208e7169ff657bb33e57
2019-02-12 12:31:59 -06:00
Zuul
326200bf93 Merge "Scan templated python files with bandit" 2019-01-31 13:53:16 +00:00
Pete Birley
a5162ad6d7 Keystone: remove stale pids on startup if present
This PS removes stale pids on startup if present.

Change-Id: Iff136f16f8d15a08e8ce8c51d058b55288f97a2e
Signed-off-by: Pete Birley <pete@port.direct>
2019-01-29 16:30:36 -06:00
Gage Hugo
482dbcac29 Scan templated python files with bandit
This change adds a zuul check job to export any templated python
contained in the helm charts and scan it with bandit for any
potential security flaws.

This also adds two nosec comments on the instances of subprocess
used as they currently do not appear to be malicious, as well
as changing the endpoint_update python code to prevent sql
injection, which satisfies bandit code B608.

Change-Id: I2212d26514c3510353d16a4592893dd2e85cb369
2019-01-22 20:53:52 +00:00
Zuul
e24b21afdd Merge "Keystone podSecurityContext" 2018-12-20 21:51:55 +00:00
Rahul Khiyani
085610523f Keystone podSecurityContext
securitycontext with non-root user is implemented at pod level
and leveraged the helm-toolkit snippet

Fix for adding allowPrivilegeEscalation flag as a blanket
policy on the pod in the keyston chart

Depends-On: I95264c933b51e2a8e38f63faa1e239bb3c1ebfda
Change-Id: I15333df4707948e50deb935ffc1ee599588e4788
2018-12-19 20:55:24 +00:00
Huang,Sophie(sh879n)
3061ae3896 Implemented livenessProbe for different OpenStack api containers
LivenessProbe is added to the below deployments:
  glance-api
  glance-registry
  heat-api
  heat-cfn
  horizon
  keystone-api
  nova-api-metadata
  nova-api-osapi
  nova-placement-api

Change-Id: I76b8cafa437855eeb42b77e88da6e3c514a3ac90
Signed-off-by: Huang,Sophie(sh879n) <sh879n@att.com>
2018-12-14 09:52:50 -06:00