-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fd1247
commit a5e94a0
Showing
2 changed files
with
74 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,3 +120,9 @@ test-report.xml | |
|
||
# VSCode | ||
.vscode/ | ||
|
||
# Certificates | ||
support/*.csr | ||
support/*.key | ||
*.csr | ||
*.key |
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,68 @@ | ||
#!/bin/sh | ||
set -euo nounset | ||
|
||
# Custom Domain Helper | ||
# | ||
# Usage: ./custom_url.sh [optional: DOMAIN] | ||
|
||
# Sorry, internal! - https://apps.nrs.gov.bc.ca/int/confluence/display/DEVGUILD/Generating+a+CSR | ||
# https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent | ||
|
||
|
||
### Get inputs | ||
|
||
# Vanity URL (DOMAIN) | ||
if [[ -z "${1:-}" ]]; then | ||
echo "Enter the fully qualified domain name (FQDN) name for the certificate:" | ||
read DOMAIN | ||
else | ||
DOMAIN="${1}" | ||
fi | ||
echo -e "\nDomain: ${DOMAIN}" | ||
|
||
# Default subject | ||
SUBJECT="/C=CA/ST=British Columbia/L=Victoria/O=Government of the Province of British Columbia/CN=${DOMAIN}" | ||
echo -e "\nSubject: $SUBJECT" | ||
|
||
# Accept or create a new subject | ||
echo "Accept subject? (y/n)" | ||
read ACCEPT | ||
if [[ "${ACCEPT^}" != "Y" ]]; then | ||
echo "Subject: " && read SUBJECT | ||
fi | ||
|
||
# Generate the key and csr | ||
openssl req -new -newkey rsa:2048 -nodes -keyout ${DOMAIN}.key -out ${DOMAIN}.csr -subj "${SUBJECT}" | ||
echo -e "The following have been created:" | ||
ls -l ${DOMAIN}.{csr,key} | ||
|
||
echo "" | ||
echo "BC Gov Natural Resources Only! ---" | ||
echo "" | ||
echo "Create a JIRA issue:" | ||
echo "" | ||
echo "- Project: Service Desk (SD)" | ||
echo "- Issue Type: Service Request" | ||
echo "- Title: SSL Certificate Request for ${DOMAIN}" | ||
echo "- Summary: SSL Certificate Request for ${DOMAIN}" | ||
echo "- Component/s: Other - N/A - Not Applicable" | ||
echo "- Assignee: NRIDS Infrastructure and Middle Tier WLRS:EX" | ||
echo "- Teams Involved: Tier 3 - Infrastructure" | ||
echo "- Description: " | ||
echo " Please create an SSL certificate for: ${DOMAIN}" | ||
echo "" | ||
echo " iStore billing codes ---" | ||
echo " - Client:" | ||
echo " - Responsibility:" | ||
echo " - Service Line:" | ||
echo " - Project:" | ||
echo " - Expense Authority:" | ||
echo "" | ||
echo "- Attach the newly generated CSR file only" | ||
|
||
# Open JIRA - optional | ||
echo -e "\nWould you like to be redirected to Natural Resources JIRA? (y/n)" | ||
read ACCEPT | ||
if [[ "${ACCEPT^}" == "Y" ]]; then | ||
xdg-open 'https://apps.nrs.gov.bc.ca/int/jira/secure/CreateIssue!default.jspa' | ||
fi |