Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genisys server component for listening for new clients to come online and provision them with Ansible playbooks #53

Merged
merged 22 commits into from
Feb 15, 2024

Conversation

xeluior
Copy link
Owner

@xeluior xeluior commented Feb 1, 2024

This PR creates a new genisys subsystem which creates an HTTP(S) server that listens for clients to send their "hello"s on first boot (see PR #51). On receiving a new hello, the server records the new client in the specified Ansible inventory and runs the specified set of playbooks on the new client.

genisys/server.py Fixed Show fixed Hide fixed
genisys/server.py Fixed Show fixed Hide fixed

# write the certs to their files
with cert_path.open('w') as cert_file:
cert_file.write(pem_cert.decode())

Check failure

Code scanning / CodeQL

Clear-text storage of sensitive information High

This expression stores
sensitive data (certificate)
as clear text.
@xeluior xeluior requested review from HenrithicusGreenson, BBergle, r-akers and patedm01 and removed request for HenrithicusGreenson and BBergle February 9, 2024 18:01
@xeluior xeluior marked this pull request as ready for review February 9, 2024 18:02
ansible_cmd = ['ansible', '--inventory', body['hostname']]
for playbook in server.config.get_section('ansible').get('playbooks', []):
ansible_cmd.append(playbook)
subprocess.run(ansible_cmd, check=True)

Check failure

Code scanning / CodeQL

Uncontrolled command line Critical

This command line depends on a
user-provided value
.
@xeluior xeluior linked an issue Feb 14, 2024 that may be closed by this pull request
@xeluior xeluior merged commit 62888ab into main Feb 15, 2024
9 checks passed
@xeluior xeluior deleted the server branch February 15, 2024 13:21
@xeluior xeluior linked an issue Feb 28, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants