50 Commits

Author SHA1 Message Date
Steve Baker
c0c1768e4a Consolidated api-paste.ini file
Load a single api-paste.ini file, specified by config
Delete unused paste.ini files
Update docs for new paste.ini and config arrangement

There will be a corresponding devstack change, and once this is in
I will email the packagers on the packaging implications

Change-Id: Ic10b1a486094d15bfd832f0f934e6268ec323085
2013-04-24 09:18:15 +12:00
Steve Baker
28b60667e2 Move ec2token defaults from paste.ini to .conf
paste.ini files can now be considered not user-editable
(in normal circumstances)

Change-Id: Ia2a6d784ed2fad009de9e77717e6e0dc00c5e2f4
2013-04-24 07:38:27 +12:00
Steve Baker
419a3d953e Move heat-api auth_token conf from paste.ini
keystone auth_token middleware now allows heat to have auth_token
configuration in heat-api.conf. Moves the example of
auth_token configuration from heat-api-paste.ini to heat-api.conf.
This simplifies user configuations and users is no longer required
to edit heat-api-paste.ini.

This does not break backward compatibility. auth_token first
tries the configurations in /etc/heat/heat-api-paste.ini and then the
above configurations. Thus a user who already uses heat-api-paste.ini
does not need to change it.

Change-Id: Ia0a4d912cd7380094e121ee4af733277ca4d812e
Blueprint: keystone-middleware
2013-04-23 10:29:02 +12:00
Steve Baker
cfda18b43e Subclass keystone middleware to set headers
Replace old forked auth_token with a subclass
of keystoneclient middleware.

The advantages of moving to keystoneclient middleware:
- can use v3 (or v2) keystone api
- PKI tokens
- token revocation

The subclass sets the following headers to be consumed by our
request context filter:
- X-Admin-User
- X-Admin-Pass
- X-Admin-Tenant-Name
- X-Auth-Url

The need to override _build_user_headers should be a short-term thing,
X-Admin-* isn't actually used currently, and there are a few options
that need to be discussed for getting X-Auth-Url to the engine.

Change-Id: Iacc5046fbf559724a4ae0bd6091d662e23d65544
Blueprint: keystone-middleware
2013-04-23 10:28:58 +12:00
Steven Hardy
011d8397b4 heat : cloudwatch paste.ini credentials incorrect
The cloudwatch paste config should specify service/heat
like the other API services, not admin/admin

Change-Id: I0590c88edd6b544aba467ab171dd7f610b50c380
2013-04-09 10:12:19 +01:00
Steve Baker
1b63311092 Remove paste config for non-existant cache filters
This appears to be junk DNA from glance, which has filters
for caching image files.

Change-Id: Id7ae29028d351dd005a61a5727bc7d40ceb0a705
2013-04-09 09:41:52 +12:00
Steve Baker
412a0d5696 Remove unused and deprecated auth-context filter
keystone.middleware.auth_token is now just aliased to
keystoneclient.middleware.auth_token.

Also heat_auth_token doesn't seem to exist, so this has likely
always been broken

Change-Id: I5eadd9a02e41921b39fc8b6783c22010893bb5e9
2013-04-09 09:41:52 +12:00
Steven Dake
8634e15ca1 Stop heat services from logging to stderr by default
Change the configuration files to set use_stderr to False by
default.  Oslo's log sets use_stderr to True by default, and
the only reasonable way to override is via the config files.

Change-Id: Ibc4ac3b8cb5d7478260d5d014eb48860bae4bc0b
Fixes: Bug #1146848
2013-03-05 09:01:56 -07:00
Robert van Leeuwen
151ee297c3 Removes unused config settings from heat-engine.conf
Change-Id: Ia660009f18eae9d9c22adc5ab36c18f711856bce
Fixes: bug #1134346
2013-02-27 14:35:52 +01:00
Clint Byrum
14358bb9e1 Add config for boto https_validate_certificates
Boto does not, by default, validate https ceritificates on endpoints. We
now provide a way to specify it in the heat configuration along side
is_secure. Heat deployers may also need to turn this off if boto ever
does make it default and they want to use self signed certs.

Fixes bug #1130345

Change-Id: I09b684dd28a8a57c6ce514d1df1e699e7c8b182e
2013-02-19 12:23:40 -08:00
Steven Hardy
5531eee5e4 heat engine : add option to control instance boto http/https
Currently the heat-jeos code defaults to http only, but we are
about to fix that, so we instead need a way to specify if
instances should connect via http or https - boto provides the
is_secure config file option, so add a new heat option which
controls this setting in the boto config we create in userdata

fixes bug 1117594

Change-Id: I0b9201107570334d9846d9613d252da1a91efe8a
Signed-off-by: Steven Hardy <shardy@redhat.com>
2013-02-08 11:39:17 +00:00
Steven Hardy
d4999382a5 heat clients : Make boto client select http/https from configfile
Currently we hardcode is_secure=False, but boto supports configuration
of this option from the config file (either ~/.boto or /etc/boto.cfg)
so better to do that

NOTE - you will need to update your boto config to include is_secure=0
to retain current (non https) behavior, since it defaults to on

ref bug 1117594

Change-Id: Ic13e8604f12d3d5be4ec132a1bc04ae7624ec85d
Signed-off-by: Steven Hardy <shardy@redhat.com>
2013-02-08 11:34:58 +00:00
Steven Hardy
1b1dd456b2 heat api : Add policy.json authorization to cloudwatch API
Adds a basic policy.json to authorize all actions for the CW API -
this will deny access to the in-instance users defined in stack
templates (which are assigned the heat_stack_user role) to all API
actions apart from PutMetricData action, which is used by
cfn-push-stats to provide metric data from the instances

Change-Id: I2bbb885bec98b85828cdb92d7efc0688da7be3c1
Signed-off-by: Steven Hardy <shardy@redhat.com>
2013-02-07 10:22:14 +00:00
Steven Hardy
dfacae65b5 heat api : Add policy.json authorization to CFN API
Adds a basic policy.json to authorize all actions for the CFN API -
this will deny access to the in-instance users defined in stack
templates (which are assigned the heat_stack_user role) to all API
actions apart from DescribeStackResource, which is used for metadata
updates

ref bug 1115758

Change-Id: I1431c1f23593fffd0f911f71ef9c186a43e5063a
Signed-off-by: Steven Hardy <shardy@redhat.com>
2013-02-06 14:58:23 +00:00
Steven Hardy
38b7e7d501 heat api paste.ini auth_uri should use auth_port
For token based auth to work, the auth_uri needs to use
auth_port, which points at the internalURL of the keystone
service, the current config uses publicURL which causes
token auth requests to keystone to fail

ref bug 1072944

Change-Id: If7e0c2246205377f57f879ccf8bf36ff8b0d92e1
Signed-off-by: Steven Hardy <shardy@redhat.com>
2013-01-22 16:34:49 +00:00
Tomas Sedovic
41a1c8d05f Add auth middleware for custom cloud backend
Custom backends will want to provide their own authentication mechanisms
instead of using the Keystone token or EC2-like systems we have in
place.

This adds a new middleware and paste pipeline for the custom backend
that will skip the normal authentication and queries the backend's
`authenticated(context)` method instead.

Since the backend is connected to the Engine whereas the auth middleware
is run in the API service (which may sit on a separate box and have no
access to the engine config or the custom backend itself), we add a new
RPC call that lets API verify the passed credentials.

Change-Id: I2fc4a19564b1e410adb79bd9266f6b6da07dd6c9
Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2013-01-14 10:21:59 +01:00
Tomas Sedovic
714c3f9e7c Add configurable cloud backend
This allows us to use a different IaaS backend (other than OpenStack).
OpenStack is still used by default.

Change-Id: I1772d57ae583a281204edfb80fbfde220b004a9d
Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2013-01-14 10:21:59 +01:00
Steven Hardy
6ae3ff0a4e Remove heat-metadata service
Remove heat-metadata service, since the last remaining function
(waitcondition handle notification) is now handled via the CFN
API

blueprint metsrv-remove
Signed-off-by: Steven Hardy <shardy@redhat.com>
Change-Id: Ie36c86ce86f6c47e8d9f8accf8ec17084fb8cffd
2012-11-30 08:45:02 +00:00
Steven Hardy
17dd71b017 heat engine : Convert WaitConditionHandle to pre-signed URLs
Change WaitConditionHandle so it provides a pre-signed URL which
allows authenticated wait condition notification via the CFN API

blueprint metsrv-remove
Change-Id: I5c1c3a17ade35c810e49b1f27d80bcfea9e89485
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-11-29 20:20:27 +00:00
Steven Hardy
a425ae02af heat engine : append watch server url to instance userdata
Append url for watch server to instance userdata, which avoids
post-install sed mangling in the template, and will make it easier
to transparently switch to a different metric service

Change-Id: I59b9b7efcd75d44e88ebe0a116a9ce1e3ef20c14
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-11-14 11:37:24 +00:00
Steve Baker
f77c09c2a5 Rename heat client to heat-cfn.
This is to allow python-heatclient to eventually become the default heat
client.

Documentation in heat.wiki will be updated to refer to heat-cfn when this
change is pushed.

Change-Id: I2209c36adf41fa5d0df0caf9200f7fedbdd51805
2012-11-05 12:23:17 +13:00
Steven Hardy
0ba94dcc7a heat engine : add heat_waitcondition_server_url
Add config option for waitcondition server, since metadata
and waitcondition notifications are no longer handled by the
same API

Change-Id: Idc1b39c6c60b8473316fe4861f0f060568540b09
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-10-26 17:38:47 +01:00
Steven Hardy
997a2165e7 heat metadata : remove metadata_url logic
Remove logic where the heat-metadata server registers a
URL on startup with the engine.  The instance metadata is
now served via the CFN api, so we just have a config-file
option specifying the URL of the CFN API.  We don't want to
preserve the "register on startup" logic, because we need the
engine to have access to this information even if it is
restarted independent of some other service (avoid reliance on
services coming up in a particular order)

Change-Id: I690170977227ec96451d2a2fd25f7e507370b604
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-10-26 17:35:47 +01:00
Steven Hardy
cd9a3a7c95 heat engine : add template-defined users to keystone role
Add all keystone users created by the User resource type
to a special keystone role, which can be used later for
defining RBAC policy for these users, and also works around
a keystone bug (1060959) on Folsom

Fixes #279

Change-Id: I94931e427ed51f4332bcb506220925b7ce8097bc
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-10-25 13:59:49 +01:00
Zane Bitter
2e7e7c44cf Change the service user to match devstack
The user which authenticates keystone tokens should be the "heat" user in
the "service" tenant. This changes the default configuration to do this, as
devstack already does.

Ref #269

Change-Id: I89978ec0b490f6d404c568197dd4208097a4b695
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-10-22 13:59:25 +02:00
Zane Bitter
9e237f5a66 Add the beginnings of an OpenStack ReST API
So far only access to stacks (not resources and events) is implemented.

Change-Id: I9655e9441087ef60c06e67e2d6ae68ec4a3b2d11
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-09-27 21:37:37 +02:00
Zane Bitter
f26b218831 Allow separate versioning of each API
Previously, all APIs used single versioning definition. Since these are
likely to change at different rates (AWS APIs are unlikely to change at
all, but OpenStack APIs probably will), give each their own version
definition.

Change-Id: I6985205dfcb5baf6f49ad32b091d811f97d1552a
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-09-27 15:52:17 +02:00
Zane Bitter
715a62d2b4 Move CloudFormation API to heat.api.cfn package
Change-Id: Ib0adf6f38da298b0b87d80272904767066b41087
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-09-27 15:00:30 +02:00
Steven Hardy
89bedcb4d2 heat : move boto.cfg to correct location
boto.cfg needs to be under /etc not /etc/heat
or boto won't find it

Change-Id: I0981bb3bd46dd1630633576fc77d085410bf6362
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-09-11 19:05:36 +01:00
Steven Hardy
455bb8889f heat : comment credentials in template boto.cfg
Comment out the credentials section in /etc/boto.cfg
this allows us to pass the correct host/endpoint without
having world-readable credentials.  This can then be used
as a template for per-user ~/.boto files if desired

Change-Id: I4cea0cb3b790186ddc041edad0ab4ee4b7e8f956
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-09-11 19:03:41 +01:00
Zane Bitter
55eb1746aa Reorganise etc directory for easier installation
This also means that the install script will install bash-completion for
heat.

Change-Id: Ib60346c72ce6277951cb51952e359f97be20a1be
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-09-07 15:11:37 +02:00
Angus Salkeld
be128a81c6 Delete unused heat-engine-paste.ini
Change-Id: I4c8d5b2d98634aa4d711d3fe8816891476645548
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-07 13:12:27 +10:00
Zane Bitter
2f9a1310e3 Rename heat-api to heat-api-cfn
The previous heat-api is, in fact, a CloudFormation-compatible API. Rename
it to heat-api-cfn, analogous to how the EC2 API in Nova is named
nova-api-ec2.

Change-Id: I9759f10cee6a60cdc9cb917966eb9fb95a618f85
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-09-06 16:11:24 +02:00
Steven Hardy
51dc63bb07 heat cli : initial heat-watch cloudwatch API client
Implements new client to demonstrate new Cloudwatch API

Currently only provides options for DescribeAlarms,
ListMetrics, PutMetricData and SetAlarmState

Signed-off-by: Steven Hardy <shardy@redhat.com>
Change-Id: I3963a07694cec9af96d9d7369cc7d18d629fcd2d
2012-08-31 18:27:48 +01:00
Steven Hardy
311092a294 heat API : Implement initial CloudWatch API
Initial AWS-compatible CloudWatch API implementation
Supports the following API actions:
- DescribeAlarms : describe alarm/watch details
- ListMetrics : List watch metric datapoints
- PutMetricData : Create metric datapoint
- SetAlarmState : temporarily set alarm state

Skeleton implementation of all other TODO actions which
returns HeatAPINotImplementedError.

Only basic filtering parameters supported at this time.

Signed-off-by: Steven Hardy <shardy@redhat.com>
Change-Id: I8628854a135fff07b675e85150ea0b50184ed2e1
2012-08-31 18:27:48 +01:00
Steven Hardy
9ccf18433e heat API : move aws common files from api/v1 to api/aws
Move aws api common files to common directory
(so they can be more easily reused by cloudwatch)

Change-Id: I1a455ef11226dd960503bac5d79fa5c28607a1f6
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-08-21 11:54:18 +01:00
Ian Main
58cd52624b Add encryption support for authentication information in db.
This patch uses an encryption key generated in install.sh to perform
symmetrical encryption on sensitive authentication information stored
in the database for HA operations.

Change-Id: Ifd09f3f566ba3ebd941a6f453953576011b518b9
Signed-off-by: Ian Main <imain@redhat.com>
2012-07-26 18:40:18 -07:00
Steven Dake
b34a5cd51d Add an EC2Token_filter_factory and use it as the default paste filter
Change-Id: I70989ff6be655832497e1e8a3019497438a739fb
Signed-off-by: Steven Dake <sdake@redhat.com>
2012-07-20 10:40:53 -07:00
Steven Dake
06705da563 Optimize filter context
Just use a direct filter factory for ContextMiddleware

Change-Id: Ie17bb88c331bdb4354d0abb24346ab80f13cd323
Signed-off-by: Steven Dake <sdake@redhat.com>
2012-07-19 19:52:24 -07:00
Steven Hardy
bb79672aec heat : update config files with new rpc backend
heat-engine.conf, heat-api.conf, heat-metadata.conf
should have:
rpc_backend=heat.openstack.common.rpc.impl_qpid
to work with the reworked rpc code.

Change-Id: I2e5b136240db2fe8f6dfad27da7e31b2a5053a1c
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-17 17:35:45 +01:00
Steven Hardy
9d0a22f92b heat : add heat-boto test client
Add initial version of the heat cli tool which uses boto
- revised following review comments to remove jeos/cfn paths
ref #92

Change-Id: I61b5815b250f3b01d33844ff46dd1612000d51fd
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-04 17:43:35 +01:00
Ian Main
a5962d1078 Authentication Overhaul
This patch updates the authentication system set up in heat:

- We now authenticate against the 'heat' service at the entry
  point to each api call in the engine.
- We are now using the 'Context' class to contain the authentication
  information as intended.
- The two context classes are unified and we now use the same one
  for both WSGI and RPC.  This is the intended design as the
  context is loaded by the WSGI middleware and then passed into the
  RPC methods.
- We are now doing token authentication in the API that works with
  both native keystone and AWS style authentication.  That token is
  then passed on to the engine for further authentication for various
  endpoints.

Note that the heat-api-paste.ini file requires updating in order for
this to work on your system.  Admin user and password must be set
properly in the authtoken section in order to perform token based
authentication.

I suspect there will be a few bugs in here yet.  This is just part of
the authentication/identification changes we need to make but I wanted
to get this in so we could continue to work with a boto based client.

Change-Id: Ib635ecd3088304e8d51d8e1fc31a8b1bf751caf3
Signed-off-by: Ian Main <imain@redhat.com>
2012-05-29 16:54:03 -07:00
Steven Hardy
298e0921ae heat cli : Add options to bash completion script
Ref #87 add completion of long-format options, align the command options with
the "heat help" option

Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-05-16 09:48:37 +01:00
Tomas Sedovic
4fa77a658c Add skeleton structure for the metadata server 2012-04-27 18:40:49 +02:00
Steven Hardy
dfeb65185b heat cli : Add bash_completion.d entry for heat
issue #87 Adds basic bash smart-complete script for heat to bash_completion.d

Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-04-20 21:27:06 +01:00
Chris Alfonso
04d73a59ba Adding the sqlalchemy db implmentation 2012-04-02 13:42:56 -04:00
Chris Alfonso
4018da0186 Add a heat database to store templates, state, and events
Fixes #39
2012-04-02 06:44:10 -04:00
Angus Salkeld
6161c7aa85 Start separating the api and the implementation.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-20 12:58:54 +11:00
Angus Salkeld
2cf38556bf Rename the etc/ files to what they need to be.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-19 22:53:06 +11:00
Angus Salkeld
3b9c41fb6c Initial commit (basics copied from glance)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-13 21:48:07 +11:00