Skip to content

Commit d5801d2

Browse files
committed
added dockerfile version
1 parent badc301 commit d5801d2

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM mcr.microsoft.com/devcontainers/base:bullseye
2+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
3+
&& apt-get -y install git ca-certificates curl apt-transport-https lsb-release gnupg \
4+
python-is-python3 python3-pip gnupg software-properties-common
5+
RUN wget -O- https://apt.releases.hashicorp.com/gpg | \
6+
gpg --dearmor | \
7+
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
8+
RUN echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
9+
sudo tee /etc/apt/sources.list.d/hashicorp.list
10+
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | \
11+
sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
12+
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
13+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
14+
RUN wget -q https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb && \
15+
sudo dpkg -i packages-microsoft-prod.deb
16+
RUN wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null && \
17+
echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
18+
RUN apt-get update && apt-get install -y terraform gh powershell azure-cli trivy
19+
RUN curl -L "$(curl -s https://api.github.com/repos/tenable/terrascan/releases/latest | grep -o -E "https://.+?_Linux_x86_64.tar.gz")" > terrascan.tar.gz && \
20+
tar -xf terrascan.tar.gz terrascan && rm terrascan.tar.gz && \
21+
install terrascan /usr/local/bin && rm terrascan
22+
RUN pip install checkov pre-commit
23+
RUN curl -s https://raw.githubusercontent.com/aquasecurity/tfsec/master/scripts/install_linux.sh | bash
24+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "SecureTerraformDocker",
3+
"build": { "dockerfile": "Dockerfile" },
4+
// Configure tool-specific properties.
5+
"customizations": {
6+
"vscode": {
7+
"extensions": [
8+
"GitHub.copilot",
9+
"GitHub.vscode-pull-request-github",
10+
"streetsidesoftware.code-spell-checker",
11+
"hashicorp.terraform",
12+
"ms-azuretools.vscode-azureterraform",
13+
"tfsec.tfsec",
14+
"Bridgecrew.checkov"
15+
]
16+
}
17+
},
18+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19+
// "forwardPorts": [],
20+
// Use 'postCreateCommand' to run commands after the container is created.
21+
// "postCreateCommand": "uname -a",
22+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}"
23+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
24+
// "remoteUser": "root"
25+
}

0 commit comments

Comments
 (0)