2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-12 08:12:33 +00:00
Commit Graph

164 Commits

Author SHA1 Message Date
Daniel Hilst 6bc7800bba fix(xcat-core): deny the REST aliases when mod_rewrite is not loaded
xcat-ws.conf sends /xcatws and /xcatwsv2 to https only when mod_rewrite is
loaded. Without that module the aliases run the REST CGI on any port.

An IfModule !mod_rewrite.c block now answers 403 for both aliases.
RedirectMatch comes from mod_alias, which the ScriptAlias lines of the
same file already require. Other paths, such as /install, are not changed.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-05 14:03:14 -03:00
Daniel Hilst 74d5184963 fix(xcat-core): xcat-ws.conf names a SUSE module path and never matches its package
`rpm -V xCAT-server` reports /etc/httpd/conf.d/xcat-ws.conf and
/etc/apache2/conf.d/xcat-ws.conf changed on every EL, openEuler and SUSE
management node, for the life of the install. %install shipped the Apache 2.2
fragment as the payload, and %post replaced it with the Apache 2.4 fragment
whenever httpd, apachectl or apache2ctl reported 2.4. Every supported
distribution runs Apache 2.4, so the file on disk never matched the package
digest. The drift is a permanent false positive for anyone who verifies an
installed xCAT before trusting it.

Both fragments also began with
`LoadModule rewrite_module /usr/lib64/apache2-prefork/mod_rewrite.so`. That
file exists only on SUSE under the prefork MPM. Apache tolerates it on EL and
openEuler because conf.modules.d loaded mod_rewrite first, and logs AH01574;
where the module is not loaded first, the missing file stops Apache from
starting.

xcat-ws.conf.apache22 and xcat-ws.conf.apache24 are replaced by one
xcat-ws.conf that serves both generations: the redirect sits behind
<IfModule mod_rewrite.c>, and the authorization directives behind
<IfModule mod_authz_core.c> and its negation. %install copies that one file to
both conf.d paths and %post no longer names them, so the payload is the final
file. %post runs a2enmod rewrite where a2enmod manages modules, which is how
SUSE gets the module the removed LoadModule used to pull in.

xCAT-test/unit/wsapi_apache_conf_portable.t fails 22 of its 30 assertions
without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-05 11:25:38 -03:00
Vinícius Ferrão 6f3d9bb9d1 Add Kea DHCP backend 2026-04-23 02:01:33 -03:00
Markus Hilger f42011a493 Unify shebang lines 2024-05-07 16:43:07 +02:00
Markus Hilger dc13997f14 Remove even more useless executable permissions 2024-05-07 16:34:59 +02:00
Mark Gurevich 884d9d8a10 Handle RESTAPI parameters with null values 2023-03-20 08:52:39 -04:00
Mark Gurevich 71d3b76881 Check SUSE-brand file on SLES 2022-08-15 10:16:22 -04:00
Mark Gurevich 47c02f43f4 Support xcat-core builds on CentOS8 2022-05-12 14:38:12 -04:00
Mark Gurevich 13d51ad7dc Remove depricated Perl usage of keys on scalar 2020-08-11 14:23:27 -04:00
Nick Buonarota 89ae21a719 change accessed attribute from content to text
- content is "Content of the response, in bytes."
- python is smart enough to print this
- might be clearer to use "text" for someone new looking at this example.
2019-02-06 14:09:42 -05:00
Nick Buonarota 2180c28ff8 Change var "all_nodes" to "response" 2019-02-06 14:07:08 -05:00
GONG Jie 92407412a2 Remove trailing spaces in file xCAT-server/xCAT-wsapi/xcatws-test.sh 2017-12-31 23:59:59 +00:00
GONG Jie b35741dd2f Remove trailing spaces in file xCAT-server/xCAT-wsapi/xcatws-test.pl 2017-12-31 23:59:59 +00:00
Yuan Bai 8f4d4f3631 Merge pull request #5174 from gurevichmark/restapi_no_key_match
REST API handle no key match for tables
2018-05-09 14:51:07 +08:00
Mark Gurevich ecc403b136 REST API handle no key match for tables 2018-05-07 16:12:19 -04:00
Mark Gurevich 8e58122278 Add REST API beacon status function 2018-05-07 11:37:02 -04:00
Weihua Hu 9dff3bb734 Merge pull request #5143 from gurevichmark/openbmc_rest_api
REST API for OpenBMC nodes
2018-05-04 11:05:03 +08:00
Mark Gurevich dc9420296a Handle invalid tables in REST API 2018-04-30 13:06:05 -04:00
Mark Gurevich ac99793013 REST API for OpenBMC nodes 2018-04-26 15:15:47 -04:00
ertaozh 9fd4bcca45 Fix issue 5111: REST API does not respect the "host" setting in "policy" table 2018-04-23 08:42:09 -04:00
Mark Gurevich fdb3ccb3ce REST API doc fixes and Python example 2018-04-10 14:18:54 -04:00
bybai 9c7d9847ff clean up word typo 2018-04-09 23:13:01 -04:00
bybai b2bfa9b738 add nodels resource 2018-04-09 23:11:25 -04:00
bybai d2bb5a7290 add xCAT REST API for nodels 2018-04-03 05:33:47 -04:00
ertaozh 71bb049f21 Modify xcatws.cgi permission 2018-03-30 02:53:11 -04:00
chenglch 231d934732 Define some attributes as array type in rest api ver 1.0
Split attribute with comma is not a standard way, this commit
bumped REST version to 1.0 to deal with these attributes in
array type.

```
curl -X GET -k 'http://10.5.101.10/xcatws/nodes/restnode1?userName=root&userPW=cluster'
{"restnode1":{"serialspeed":"115200","nicips.ib1":"10.0.0.100|fd55::214:5eff:fe15:849b","nicnetworks.ib0":"IB00","nicnetworks.ib1":"IB01","cons":"ipmi","postscripts":"syslog,remoteshell,syncfiles,hello,world2","nicips.ib0":"10.10.100.9","groups":"conpute,staticconsolegroup","postbootscripts":"otherpkgs","nictypes.ib0":"Infiniband","nicips.ib2":"10.0.0.103|10.0.0.104"}}

 curl -X GET -k 'http://10.5.101.10/xcatws/nodes/restnode1?userName=root&userPW=cluster&ver=1.0'
{"restnode1":{"nicnetworks.ib0":"IB00","nicnetworks.ib1":"IB01","cons":"ipmi","postscripts":["syslog","remoteshell","syncfiles","hello","world2"],"nicips.ib0":["10.10.100.9"],"nicips.ib2":["10.0.0.103","10.0.0.104"],"groups":["conpute","staticconsolegroup"],"postbootscripts":["otherpkgs"],"serialspeed":"115200","nicips.ib1":["10.0.0.100","fd55::214:5eff:fe15:849b"],"nictypes.ib0":"Infiniband"}}

```
2018-01-29 11:19:09 +08:00
yangsong c88042cb73 fis issue [REST] xCAT restful API xcatws cannot work #4622 (#4623) 2018-01-11 18:49:16 +08:00
Chuck Brazie 4b5fa10b93 Add back in xcatws.cgi
Change-Id: I84a57f3191238cefa792481504d4325672b737a9
2017-10-20 13:59:32 -04:00
Chuck Brazie 2001edd2f9 Delete xcatws.cgi 2017-08-31 09:01:06 -04:00
Chuck Brazie 1cc11dc632 Delete xcat-ws.conf.httpd 2017-08-30 08:12:48 -04:00
Chuck Brazie 39454c1205 Delete xcat-ws.conf.apache2 2017-08-30 08:00:44 -04:00
Chuck Brazie 98b4d2cf9f zVM changes up till April 21
Change-Id: I6c2febd8797f3874fbd8b7bd445f7ce6785155e4
2017-04-21 14:07:34 -04:00
Chuck Brazie 5bab3873a2 Add in version 1 and version 2 REST-API into zVM. Default zVM to version
1 in the zvmxcatws.cgi

Change-Id: I2ad620ded8f4f3bff997bf308881cbeabd61022b
2017-02-20 15:33:44 -05:00
Chuck Brazie 5a83bf5e63 Merge our code with global xCAT team except for xcatws.cgi
Change-Id: I945c430685fa2febd914be09f6a6f976783abeec
2017-02-02 14:31:27 -05:00
chenglch d11a56ac7b Add rest api for the node template
- Enhance global subroutine to support loading json via GET method
- Add --template option for mkdef
- Add GET interface to list/show the /templates/node resource
2016-09-12 15:31:49 +08:00
chenglch f9d339c3ba Update rest api for rinstall and console
- Refactor console api, console will be looked as a service resource
- Add rest api to support rinstall
2016-08-25 13:27:55 +08:00
chenglch 7a3a0836e2 Add trust_host option in rest api for makeconservercf 2016-07-28 02:01:36 -04:00
Mark Gurevich db9a71750e Fix sytax errors reported by perltidy 2016-07-25 08:56:18 -04:00
Mark Gurevich fb911143fe perltidy all perl files, part 2 2016-07-21 13:27:40 -04:00
Mark Gurevich 0a3fbd8d51 perltidy all perl files 2016-07-20 11:40:27 -04:00
chenglch 8187e3efa1 Add rest api helper interface to access non-xcat resource
Currently xcat rest service is running with apache user who do
not have the privilege to manage some local resource like credential
files needed by xcat web ui to get the conserver access.

This patch add scripts in xcatconfig to generate credential files
for conserver user. This patch also add a work around framework for
xcat restapi to provide the interface to get or set the system resource
so that restapi with apache privilege can retrieve the credential files.
2016-07-19 23:09:21 -04:00
chenglch 6845606f29 Add restapi for console
Provide the interface for xcat web GUI to control console
resource.
2016-07-01 04:07:54 -04:00
wangxiaopeng ca7c9ad69a issue 1171: set SSL_verifycn_scheme => none for IO::Socket::SSL->new 2016-06-22 10:04:04 -04:00
WangXiaoPeng 98add47637 Issue 588: fix the issue that def command cannot display the value correctly when it has = inside 2016-01-13 21:03:16 -05:00
wangxiaopeng af02dbd3ba Add rest api doc to ReadTheDoc in rst format. 2016-01-04 06:52:21 -05:00
Victor Hu 8a39aa8aa5 Remove references to sourceforge in these files 2015-10-27 16:54:21 -04:00
bybai faf05c6753 set default scan_methord nmap 2015-08-11 03:06:27 -04:00
bybai 2fa4742127 update vitals restapi 2015-08-11 02:56:42 -04:00
bybai 3dd90a0faa update bmcdiscover restapi 2015-08-11 02:53:22 -04:00
bybai d3e1ab3cd4 update bmcdiscover related rest api 2015-08-11 02:45:24 -04:00