Compare commits

..
14 Commits
Author SHA1 Message Date
DigitalInfinity 344db34c07 updated stepca 2025-01-24 19:10:47 +01:00
DigitalInfinity d1cd672bcd Revert "updates"
This reverts commit 62df127cfb.
2025-01-17 19:57:28 +01:00
DigitalInfinity 62df127cfb updates 2024-08-31 22:36:46 +02:00
DigitalInfinity 84e841451f updated playbook for ste-ca 2023-06-25 00:31:22 +02:00
DigitalInfinity 136cda0bdd changed trigger 2022-06-20 21:14:05 +02:00
DigitalInfinity 9b69ce37eb easier service-file, no error on rpi 2021-06-06 19:28:32 +01:00
DigitalInfinity f25d2c2010 2nd run destroyed ca.json 2021-06-06 19:17:29 +01:00
DigitalInfinity 00d4ffaf73 removed comment 2021-06-06 17:48:49 +01:00
DigitalInfinity 7f8ed555e8 update step-ca role 2021-06-06 17:48:25 +01:00
DigitalInfinity 94feea5298 removed packages, better download them 2021-06-06 17:05:09 +01:00
DigitalInfinity 9b5d32d43b upated role step-ca 2021-06-06 16:32:53 +01:00
DigitalInfinity 683a3446f0 updated to support multiple architectures 2021-06-06 15:51:31 +01:00
DigitalInfinity ab540c9090 added binaries for amd64 and armv7l 2021-06-06 15:51:16 +01:00
DigitalInfinity 414498e36a updated .gitignore 2021-06-06 15:46:45 +01:00
4 changed files with 74 additions and 84 deletions

No files matched your search

-1
View File
@@ -1 +0,0 @@
*.deb
+4 -4
View File
@@ -1,9 +1,9 @@
---
- name: reload systemd
sudo: yes
command: systemctl daemon-reload
- name: restart step-ca
service:
name: step-ca
state: restarted
- name: reload systemd
command: systemctl daemon-reload
+66 -48
View File
@@ -1,22 +1,31 @@
---
- name: Copy Package to host
copy:
src: files/{{ item }}
dest: "/opt/ansiblepackages/{{ item }}"
owner: root
group: root
mode: '0600'
backup: yes
with_items:
- step-cli_0.15.16_amd64.deb
- step-ca_0.15.15_amd64.deb
- name: show ansible_architecture
ansible.builtin.debug:
var: ansible_architecture
- name: install package
- name: set package-names for aarch64
set_fact:
step: https://github.com/smallstep/cli/releases/download/v0.24.2-rc.6/step-cli_0.24.2-rc.6_arm64.deb
stepca: https://github.com/smallstep/certificates/releases/download/v0.24.3-rc.2/step-ca_0.24.3-rc.2_arm64.deb
when: 'ansible_architecture == "aarch64"'
- name: set package-names for amd64
set_fact:
step: https://dl.smallstep.com/cli/docs-ca-install/latest/step-cli_amd64.deb
stepca: https://dl.smallstep.com/certificates/docs-ca-install/latest/step-ca_amd64.deb
when: ansible_architecture == "amd64" or ansible_architecture == "x86_64"
- name: stop when facts not set to download Packages
meta: end_play
when: step is not defined or stepca is not defined
- name: Install step-cli
apt:
deb: "/opt/ansiblepackages/{{ item }}"
with_items:
- step-cli_0.15.16_amd64.deb
- step-ca_0.15.15_amd64.deb
deb: "{{ step }}"
- name: Install step-ca
apt:
deb: "{{ stepca }}"
- name: create user for step-ca
user:
@@ -35,24 +44,10 @@
group: step
mode: "0770"
- name: link .step to /etc/step-ca
file:
state: link
src: /etc/step-ca
dest: ~/.step
- name: init step-ca
command: step ca init --name="{{ pki_name }}" --dns {{ ansible_hostname }} --issuer="{{ pki_name }}" --address=:4343 --provisioner="{{ pki_name }}" --password-file=/etc/step-ca/password.txt --provisioner-password-file=/etc/step-ca/password.txt
command: sudo -u step step ca init --name="{{ pki_name }}" --dns {{ ansible_hostname }} --issuer="{{ pki_name }}" --address=:4343 --provisioner="{{ pki_name }}" --password-file=/etc/step-ca/password.txt --provisioner-password-file=/etc/step-ca/password.txt
args:
creates: /etc/step-ca/config
- name: create /etc/step-ca/db
file:
state: directory
path: /etc/step-ca/db
owner: step
group: step
mode: "0770"
creates: /etc/step-ca/.step/config
- name: set permissions correct
file:
@@ -62,15 +57,6 @@
mode: "0770"
recurse: yes
- name: correct paths
replace:
path: "{{ item }}"
regexp: '\/root\/.step'
replace: "\/etc\/step-ca"
with_items:
- /etc/step-ca/config/ca.json
- /etc/step-ca/config/defaults.json
- name: generate /etc/systemd/system/step-ca.service
template:
src: step-ca.service.j2
@@ -81,6 +67,24 @@
notify:
- reload systemd
#- name: correct ca.json step 1
# lineinfile:
# path: /etc/step-ca/.step/config/ca.json
# line: "{{'\t'}}{{'\t'}}\"type\": \"badgerV2\","
# state: present
# regexp: "^{{'\t'}}{{'\t'}}\"type\": \"badger"
# notify:
# - restart step-ca
#- name: correct ca.json step 2
# lineinfile:
# path: /etc/step-ca/.step/config/ca.json
# line: "{{'\t'}}{{'\t'}}\"badgerFileLoadingMode\": \"FileIO\""
# state: present
# regexp: "^{{'\t'}}{{'\t'}}\"badgerFileLoadingMode\":"
# notify:
# - restart step-ca
- name: Flush handlers
meta: flush_handlers
@@ -95,18 +99,32 @@
- name: Flush handlers
meta: flush_handlers
- name: list provisioners
command: step ca provisioner list
register: povisionerlist
- name: check for acme privisioner
lineinfile:
path: /etc/step-ca/.step/config/ca.json
regexp: '.*"type": "ACME",.*'
line: "{{'\t'}}{{'\t'}}{{'\t'}}{{'\t'}}\"type\": \"ACME\","
state: present
check_mode: yes
register: acmepresent
- name: add acme provisioner
command: step ca provisioner add acme --type ACME
when: not povisionerlist.stdout.find ("ACME") != -1
command: sudo -u step step ca provisioner add acme --type ACME
when: acmepresent is changed
notify:
- restart step-ca
- name: check for default JWK privisioner
lineinfile:
path: /etc/step-ca/.step/config/ca.json
regexp: '.*"type": "JWK",.*'
line: "{{'\t'}}{{'\t'}}{{'\t'}}{{'\t'}}\"type\": \"JWK\","
state: absent
check_mode: yes
register: jwkabsent
- name: remove jwk provisioner
command: step ca provisioner remove "{{ pki_name }}" --type JWK
when: povisionerlist.stdout.find ("JWK") != -1
command: sudo -u step step ca provisioner remove "{{ pki_name }}"
when: jwkabsent is changed
notify:
- restart step-ca
+4 -31
View File
@@ -6,16 +6,16 @@ After=network-online.target
Wants=network-online.target
StartLimitIntervalSec=30
StartLimitBurst=3
ConditionFileNotEmpty=/etc/step-ca/config/ca.json
ConditionFileNotEmpty=/etc/step-ca/.step/config/ca.json
ConditionFileNotEmpty=/etc/step-ca/password.txt
[Service]
Type=simple
User=step
Group=step
Environment=STEPPATH=/etc/step-ca
WorkingDirectory=/etc/step-ca
ExecStart=/usr/bin/step-ca config/ca.json --password-file password.txt
Environment=STEPPATH=/etc/step-ca/.step
WorkingDirectory=/etc/step-ca/.step
ExecStart=/usr/bin/step-ca config/ca.json --password-file ../password.txt
ExecReload=/bin/kill --signal HUP $MAINPID
Restart=on-failure
RestartSec=5
@@ -23,32 +23,5 @@ TimeoutStopSec=30
StartLimitInterval=30
StartLimitBurst=3
; Process capabilities & privileges
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
SecureBits=keep-caps
NoNewPrivileges=yes
; Sandboxing
ProtectSystem=full
ProtectHome=true
RestrictNamespaces=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
PrivateTmp=true
PrivateDevices=true
ProtectClock=true
ProtectControlGroups=true
ProtectKernelTunables=true
ProtectKernelLogs=true
ProtectKernelModules=true
LockPersonality=true
RestrictSUIDSGID=true
RemoveIPC=true
RestrictRealtime=true
SystemCallFilter=@system-service
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
ReadWriteDirectories=/etc/step-ca/db
[Install]
WantedBy=multi-user.target