2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-15 12:17:47 +00:00

1287 Commits

Author SHA1 Message Date
Jarrod Johnson
1bf7c6970f Merge branch 'master' into osdeploy 2020-03-13 11:06:26 -04:00
Jarrod Johnson
a86d962984 Fix missing pwd import
The pwd module was accidentally omitted, fix the mistake.
2020-03-13 11:04:16 -04:00
Jarrod Johnson
6ade0952c7 Workaround incorrect TLS clients
Standards compliant TLS clients require
that IP addresses be compared against
IP type SAN fields.

However, some firmware ignores IP fields and only checks DNS fields.

Workaround and provide compatibility
by duplicating the IP as DNS and IP fields.

Also, clean up the temporary config file when done.
2020-03-12 19:06:05 -04:00
Jarrod Johnson
517101f596 Reduce spurious logging
When ignoring DHCPREQUEST,
do not log, since DISCOVER
was enough logging.
2020-03-12 18:08:48 -04:00
Jarrod Johnson
1bfc949466 Add message when insecure is needed
Practically speaking, this will be only choice for most people, but we
must make sure that the user acknowledges the risk.
2020-03-12 17:42:56 -04:00
Jarrod Johnson
e97214ca50 Merge branch 'master' into osdeploy 2020-03-12 16:05:08 -04:00
Jarrod Johnson
9ee29aabe1 Set certificate ownership properly
When creating certificate for collective, ensure that the certificate
is usable by confluent when running
as non-root.
2020-03-12 16:04:23 -04:00
Jarrod Johnson
57ff9808c4 Fix infinite loop in DHCP parsing
Accidentally failed to actually traverse
the data.
2020-03-11 15:43:34 -04:00
Jarrod Johnson
0f67f5c382 Draft attempt at refactoring PXE
The plan is to have 'discovery'
data only on DISCOVER, but
still parse and be able to react to
REQUEST packets.

Additionally add the attributes
to control deployment state and
permissible protocols.
2020-03-11 15:22:45 -04:00
Jarrod Johnson
d38b06224c Merge branch 'master' into osdeploy 2020-03-11 09:30:18 -04:00
Jarrod Johnson
f2bd796c2a Further clean up license error handling
Backup of nodelicense was not
consistently checked between
redfish and ipmi plugins.
2020-03-11 09:29:41 -04:00
Jarrod Johnson
9ea9188fdf Get closer to replying to PXE
Monitor and maintain a uuid and
mac map to node in preparation for
efficient handling of
DISCOVERs/REQUESTS from
ONIE and/or PXE.
2020-03-10 11:16:59 -04:00
Jarrod Johnson
597393842a Add transaction ID to the carried information
The ability to extend an OFFER requires that we also keep track
of the transaction id.
2020-03-09 15:30:26 -04:00
Jarrod Johnson
b9fc9b3c19 Put the recvmsg info into the handler payload
This allows the rest of the discovery infrastructure to operate
with this data.
2020-03-09 15:14:05 -04:00
Jarrod Johnson
49b8e12a01 Update TODO
We have now done IP_PKTINFO, but there is a potential TODO
if wanting to properly honor unicast request.

For now, will just do always-broadcast as the options to do unicast
are more complex to do (either construct the packets or inject neigh
entry manually)
2020-03-09 15:05:19 -04:00
Jarrod Johnson
f20fb70336 Have the peer and target info on DHCP receive
This has the data that will be handy in formulating a reply.
2020-03-09 14:39:53 -04:00
Jarrod Johnson
934f8f0f20 Use recvmsg for PXE
Switch to recvmsg in preparation for getting more
data for forming replies.
2020-03-09 11:25:38 -04:00
Jarrod Johnson
7fe47baab3 Fix another python 3 expectation
python3 needs this stringified from socket that
provides bytes.
2020-03-02 16:42:42 -05:00
Jarrod Johnson
3c1453c16b Actually use the de-lla address
After removing the %, actually use the trimmed address.
2020-03-02 16:23:18 -05:00
Jarrod Johnson
4529924cce Fix credserver python3 and LLA support
Both client and server had an issue with LLA, along with the
usual python3-isms.
2020-03-02 16:06:07 -05:00
Jarrod Johnson
b7b2522f6b Fix python3 compatibility of ssdp
The ssdp module in osdeploy was not reacting
adequately to copernicus.  fix the assumptions about bytes
versus str.
2020-03-02 14:54:23 -05:00
Jarrod Johnson
e257d526c3 Have ip_on_same_subnet normalize ::ffff: addresses
This will cause the ips to count as equivalent rather than giving up
on them.
2020-02-27 17:03:12 -05:00
Jarrod Johnson
a066f061c7 Remove IPv6 portion of IPv4 address
If it is presented as an IPv6 compatible IPv4 address,
make it a normal IP address.
2020-02-27 16:59:32 -05:00
Jarrod Johnson
f798239f90 Switch to using the standard confluent port for credserver
Also add a check and only accept API arming
requests from local ips
2020-02-27 16:36:16 -05:00
Jarrod Johnson
f955086cc3 Create an alternative api.armed behavior
Move from a clock based expiration to a simpler 'once' versus
'continous' model.  'once' is intended to be used generally, 'continuous'
for stateless without benefit of TPM.  The goal would be to use TPM
to seal a key to avoid continuous.
2020-02-27 13:33:05 -05:00
Jarrod Johnson
cd20a23626 Merge branch 'master' into osdeploy 2020-02-27 07:20:20 -05:00
Jarrod Johnson
3c26beda1d Fix loss of web connectivity during XCC discovery
The password policy was incorrectly logging out in the
middle of the flow when a forced password change occurred.
Fix by externally managing the web session.
2020-02-26 10:00:10 -05:00
Jarrod Johnson
54be209f4e Merge branch 'nodesearch' into osdeploy 2020-02-24 16:26:07 -05:00
Jarrod Johnson
114324f513 Add CA to self signed cert constraints
Some applications require this be set for it to work
as an enrolled certificate.  Notably UEFI
requires this.
2020-02-24 15:34:55 -05:00
Jarrod Johnson
24874bb4be Merge branch 'master' into nodesearch 2020-02-20 20:37:23 -05:00
Jarrod Johnson
e2d0e49fc7 Add HTTP boot architecture to pxe
This paves the way for future response to HTTP boot
2020-02-20 20:36:36 -05:00
Jarrod Johnson
da5a34c2e4 Fix wheezy builds 2020-02-20 08:05:21 -05:00
Jarrod Johnson
3629cb8ee7 Fix spelling of cumulus 2020-02-19 16:53:35 -05:00
Jarrod Johnson
eae7b3bd80 Add discovery snoop for Cumulus ZTP
When a cumulus switch does ZTP, detect
in the discovery facility.
2020-02-19 16:26:33 -05:00
Jarrod Johnson
868367e052 Add sensing of ONIE switches
Have nodediscover show detected
ONIE install devices.
2020-02-19 15:20:45 -05:00
Jarrod Johnson
f6d4fef5e6 Improve error message for collective
When trying to not run as root, give a
better error message explaining the
situation more clearly.
2020-02-18 16:16:40 -05:00
Jarrod Johnson
b1b7ec4d50 Add affluent plugin
Implementing Cumulus NOS
support through an agent called
'affluent'.
2020-02-18 14:23:57 -05:00
Jarrod Johnson
c0cd6de4f7 Remove PrivateDevices from unit file
PrivateDevices breaks pam_unix, for some reason.  Remove this
protection.  We still have DevicePolicy closed and running as non-root,
so this should still be relatively safe.i
2020-02-13 11:42:21 -05:00
Jarrod Johnson
4437e81e04 Leverage unix_chkpwd
If doing PAM authentication, we
can setuid to the target user and then
pam_unix will use unix_chkpwd on
our behalf.

Problems with this working in the lab
was resolved by a yum reinstall pam,
so it was presumably due to messed up
setcap or similar experiments.
2020-02-13 10:37:15 -05:00
Jarrod Johnson
6a12af1242 Remove non-root for older distributions
Older systemd does not support capabilities.  For such a platform,
disable non-root mode.
2020-02-12 13:20:08 -05:00
Jarrod Johnson
9879a83a10 Fix mistake in the redfish access protection
It contained a syntax error.
2020-02-11 14:22:19 -05:00
Jarrod Johnson
cce6b824de Merge branch 'master' of github.com:jjohnson42/confluent 2020-02-11 14:09:51 -05:00
Jarrod Johnson
ce1cb952e8 Fix PAM authentication
It's tricky.  On Redhat platforms, we need the CAP_DAC_READ_SEARCH
capability.  Unfortunately this is one of the nicest capabilities to have.

For now add it to ambient set so that PAM can work on redhat platforms.
Mitigate this risk by safeguarding the license handling code, which
is the only known place that can read a file and send it to somewhere.

If we could drop the capability from effective set and add it back in when
needed, that would be nice, but that appears not to be possible.

Short of that, having a separate authentication process
running and dropping privilege would potentially work.
2020-02-11 14:09:22 -05:00
Jarrod Johnson
c6812274e4 Fix media list through collective
The Media class was not
serializable by msgpack.  Fix this
and improve error messages in
future instances of this behavior.
2020-02-11 09:04:49 -05:00
Jarrod Johnson
7cd7068dd7 Remove stray developer output
Remove a developer repr from log
output.
2020-02-07 16:01:29 -05:00
Jarrod Johnson
48f0330568 Add affluent support to /networking
The /networking backend will now
check for affluent on the switches and
use it if possible for improved performance.
2020-02-07 15:57:33 -05:00
Jarrod Johnson
66e1d17d28 Have systemd manage confluent run dir
The run directory has to be created and owned by confluent,
or else things cannot start.
2020-02-06 13:45:46 -05:00
Jarrod Johnson
7480494432 Tighten up new PAM check
For one, remove the password cache cleaning, as it no longer is run.

For another, skip the fork if uid is already 0.

Finally, wrap the check in a try/finally to keep the privileged process
more certain in exiting.
2020-02-06 10:05:57 -05:00
Jarrod Johnson
49c00bfbb7 Become root to check a password
Running as non-root had broken PAM support.  Allow setuid so we
can assume root in one specific case.
2020-02-05 16:06:13 -05:00
Jarrod Johnson
201985dd0e Fix missing argument to rpc_set_user
Requests were unable to traverse
a collective.
2020-02-05 14:55:51 -05:00