Skip to content

Commit

Permalink
Add 05 Org Unit
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 22, 2024
1 parent 3a4dfb3 commit 3acd698
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM osixia/openldap:1.5.0

ADD ldif /container/service/slapd/assets/config/bootstrap/ldif
ADD templates /container/templates

ENV LDAP_TLS="false"
ENV LDAP_BASE_DN=""
Expand All @@ -11,3 +12,10 @@ ENV LDAP_REPLICATION="false"
ENV KEEP_EXISTING_CONFIG="false"
ENV LDAP_REMOVE_CONFIG_AFTER_SETUP="true"
ENV LDAP_SSL_HELPER_PREFIX="ldap"

ENV NVM_DIR=/usr/local/nvm
ENV NODE_VERSION=22

ADD start /container/start

ENTRYPOINT ["/container/start"]
16 changes: 16 additions & 0 deletions cloudformation/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import cf from '@openaddresses/cloudfriend';

export default {
Parameters: {
EnableExecute: {
Description: 'Allow SSH into docker container - should only be enabled for limited debugging',
Type: 'String',
AllowedValues: [ 'true', 'false' ],
Default: false
},
SSLCertificateIdentifier: {
Description: 'ACM SSL Certificate for HTTP Protocol',
Type: 'String'
Expand Down Expand Up @@ -99,6 +105,15 @@ export default {
PolicyName: cf.join('-', [cf.stackName, 'api-policy']),
PolicyDocument: {
Statement: [{
Effect: 'Allow',
Action: [
'ssmmessages:CreateControlChannel',
'ssmmessages:CreateDataChannel',
'ssmmessages:OpenControlChannel',
'ssmmessages:OpenDataChannel'
],
Resource: '*'
},{
Effect: 'Allow',
Action: [
'logs:CreateLogGroup',
Expand Down Expand Up @@ -226,6 +241,7 @@ export default {
Properties: {
ServiceName: cf.join('-', [cf.stackName, 'Service']),
Cluster: cf.join(['coe-ecs-', cf.ref('Environment')]),
EnableExecuteCommand: cf.ref('EnableExecute'),
TaskDefinition: cf.ref('TaskDefinition'),
LaunchType: 'FARGATE',
HealthCheckGracePeriodSeconds: 300,
Expand Down
21 changes: 21 additions & 0 deletions start
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -euo pipefail

echo "Generating LDIF"

cotak.gov

echo "Domain: ${LDAPDomain}"

ORG=$(echo "${LDAPDomain}" | sed 's/\..*$//')
TLD=$(echo "${LDAPDomain}" | sed 's/^.*\.//')

for filename in /container/templates/; do
sed -i "s/\$\{ORG\}/${ORG}/" "${filename}"
sed -i "s/\$\{ORG\}/${TLD}/" "${filename}"

cp "${filename}" "/container/service/slapd/assets/config/bootstrap/ldif/"
done

/container/tool/run
6 changes: 6 additions & 0 deletions templates/05-orgUnit.ldif
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dn: ou=People,dc=${ORG},dc=${TLD}
objectclass: organizationalUnit
ou: People
dn: ou=Group,dc=${ORG},dc=${TLD}
objectclass: organizationalUnit
ou: Group

0 comments on commit 3acd698

Please sign in to comment.