Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ RUN \
echo "### cleanup ###" && \
echo "##############" && \
cd /root && \
rm -rf /tmp/env-install-workdir

rm -rf /tmp/env-install-workdir && \
echo "##############" && \
echo "### dnf clean ##" && \
echo "##############" && \
dnf clean all && \
rm -rf /var/cache/dnf

# Lambda and SASL_SSL_Artifacts
COPY $SASL_SSL_ARTIFACTS /opt/sasl_ssl_artifacts/
COPY src $LAMBDA_TASK_ROOT/src
Expand All @@ -79,5 +84,15 @@ ENV \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib \
KRB5CCNAME=FILE:/tmp/krb5cc

# Run as non-root user (AVD-DS-0002).
# The base image has no shadow-utils, so register the user directly in
# /etc/passwd + /etc/group. Lambda only needs read access to the task root
# and write access to /tmp.
RUN echo 'app:x:1000:1000::/home/app:/sbin/nologin' >> /etc/passwd && \
echo 'app:x:1000:' >> /etc/group && \
mkdir -p /home/app && \
chown -R 1000:1000 /home/app ${LAMBDA_TASK_ROOT} /opt/certs /opt/sasl_ssl_artifacts
USER 1000

# Set lambda entry point as CMD
CMD ["src.event_gate_lambda.lambda_handler"]
12 changes: 9 additions & 3 deletions terraform_examples/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ resource "aws_security_group" "event_gate_sg" {
tags = { "BuiltBy" = "Terraform" }
}

resource "aws_vpc_security_group_egress_rule" "allow_all_traffic_ipv4" {
# Example only — these terraform_examples are illustrative and not used for

@lsulak lsulak Jun 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this comment be updated? I mean, it looks like you added the CIDR block by yourself, or no ? If no, how it will be updated?

# real deployments. In production, egress is governed by org-managed policies
# in the target (internal, non-SEN) AWS account. The dummy restricted CIDR and
# port below satisfy AVD-AWS-0104; replace with values appropriate to your VPC.
resource "aws_vpc_security_group_egress_rule" "allow_https_egress_ipv4" {
security_group_id = aws_security_group.event_gate_sg.id
cidr_ipv4 = "0.0.0.0/0"
ip_protocol = "-1"
cidr_ipv4 = "10.0.0.0/32"
from_port = 443
to_port = 443
ip_protocol = "tcp"
}

data "aws_s3_object" "event_gate_lambda_zip" {
Expand Down
Loading