-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typo in dns server when separate server provided for specific dom…
…ain(s) conf.d/ssl-mgr.conf - services can now be wildcard services (ALL or *) Every file in group directory that is a service config will be included as service add self signed wild card example Fix bug with sslm-info not showing IP addresses in SAN
- Loading branch information
Gene C
committed
Nov 27, 2024
1 parent
f066403
commit 7e06eab
Showing
14 changed files
with
151 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Sapience.com | ||
# | ||
# Internal only : signed by my-int which is signed by my-root | ||
# | ||
name = 'Wild Self' | ||
group = 'example.com' | ||
service = 'wild-self' | ||
|
||
signing_ca = 'my-int' | ||
|
||
[KeyOpts] | ||
ktype = 'ec' | ||
ec_algo = 'secp384r1' | ||
|
||
[X509] | ||
CN = "example.com" | ||
O = "Example IT Dept" | ||
OU = 'IT web' | ||
L = '' | ||
ST = '' | ||
C = "US" | ||
email = 'hostmaster@example.com' | ||
|
||
# Change these | ||
sans = ['example.com', '*.example.com'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
""" | ||
Project ssl-mgr | ||
""" | ||
__version__ = "4.5.0" | ||
__version__ = "4.9.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
''' | ||
Generate list of services in a directory | ||
- used when services config set to "*" | ||
''' | ||
import os | ||
import re | ||
from typing import Union | ||
|
||
from utils import (dir_list, open_file) | ||
|
||
def read_file(file): | ||
''' | ||
Read and return rows | ||
''' | ||
fob = open_file(file, 'r') | ||
data = None | ||
if fob: | ||
data = fob.readlines() | ||
fob.close() | ||
return data | ||
|
||
def is_wildcard_services(services: Union[str,[str]]): | ||
''' | ||
Check if wild card (* or ALL) | ||
''' | ||
if not services: | ||
return False | ||
|
||
if isinstance(services, list): | ||
for item in services: | ||
if item in ('*', 'ALL'): | ||
return True | ||
elif services in ('*', 'ALL'): | ||
return True | ||
return False | ||
|
||
def check_is_service(group:str, file:str) -> bool: | ||
''' | ||
Check file is a service config | ||
''' | ||
checks = ['name=', 'group=', 'service=', '[KeyOpts]', '[X509]'] | ||
checks_todo = list(checks) | ||
found = {} | ||
num_checks = len(checks) | ||
|
||
for check in checks: | ||
found[check] = False | ||
|
||
path = os.path.join(group, file) | ||
rows = read_file(path) | ||
|
||
num_checks_found = 0 | ||
is_service_config = False | ||
for row in rows: | ||
# strip all white space | ||
row = re.sub(r"\s+", '', row) | ||
if row == '' or row.startswith('#'): | ||
continue | ||
|
||
checks = list(checks_todo) | ||
for check in checks: | ||
if not found[check] and row.startswith(check): | ||
found[check] = True | ||
num_checks_found += 1 | ||
checks_todo.remove(check) | ||
break | ||
|
||
if num_checks_found == num_checks: | ||
is_service_config = True | ||
break | ||
|
||
return is_service_config | ||
|
||
|
||
def service_list_from_dir(conf_dir:str, group:str) -> [str] : | ||
''' | ||
Generate list of service configs located in conf_dir/group_dir | ||
''' | ||
group_dir = os.path.join(conf_dir, group) | ||
[files, _dirs, _links] = dir_list(group_dir) | ||
if not files: | ||
return [] | ||
|
||
# checks that file is a service config | ||
service_files = [] | ||
for file in files: | ||
if check_is_service(group_dir, file): | ||
service_files.append(file) | ||
|
||
return service_files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters