Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Dependabot to your Repository - Security Team #4

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
afbdb26
vagrant setup files
JonathanLorimer Nov 26, 2019
ebebc8e
change dir path for tf
JonathanLorimer Nov 26, 2019
5262a70
symlinked kong-plugin
JonathanLorimer Nov 26, 2019
b18f547
hmr for plugins
JonathanLorimer Nov 29, 2019
a2c23cf
Apply suggestions from code review
ioncache Dec 4, 2019
94bb8dc
Merge pull request #1 from ecobee/SBP-4367-hot-module-reload
ioncache Dec 4, 2019
7c88734
SBP-4380: update docs and startup of vagrant container
ioncache Dec 4, 2019
f325313
fix #! line
ioncache Dec 4, 2019
171cc3d
update the init script
ioncache Dec 4, 2019
d01c26d
move kong submodule to this repo isntead of sb-public-api
ioncache Dec 4, 2019
6b07928
removed kong submodule
ioncache Dec 4, 2019
c28cf24
fixed konmg submodule
ioncache Dec 4, 2019
9fb5a8f
fix style of Vagrantfile
ioncache Dec 4, 2019
069523b
install terraform the old way, sad
ioncache Dec 4, 2019
78412a9
switch to terraform 0.12
ioncache Dec 4, 2019
dd089bd
genericise lua plugin compiling
ioncache Dec 4, 2019
107ae49
reorganize files a bit
ioncache Dec 4, 2019
7d8ac05
fix a couple typos in scripts
ioncache Dec 5, 2019
a831edb
ensure kong is started and run under the vagrant user
ioncache Dec 5, 2019
143a1ab
added tf sym link
ioncache Dec 5, 2019
5d57ba1
fix more things broken from rebase
ioncache Dec 5, 2019
214b6e4
Merge pull request #2 from ecobee/SBP-4380-update-vagrant
ioncache Dec 9, 2019
0915a21
removed some commented out things
ioncache Dec 10, 2019
ac4737b
added new test script, logging
ioncache Dec 11, 2019
44cfb3d
added jwt plugin to kong env
ioncache Dec 12, 2019
86ca477
update to kong 1.4.2 and add rate limiting plugin
ioncache Dec 12, 2019
33cdc50
added jwt-claims-headers plugin
ioncache Dec 16, 2019
6cd040a
Merge pull request #3 from ecobee/SBP-4433
ioncache Dec 16, 2019
0df8665
switch to https from git+ssh for submodules
ioncache Dec 16, 2019
696a873
added prometheus to dev startup script
ioncache Feb 27, 2020
1af77d0
adding syslog plugin to dev startup script
oaltalabani Mar 6, 2020
3679e9b
Adding Dependabot Config to your Repository
ecobee-dependabot-scanner[bot] Jul 22, 2020
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
21 changes: 21 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This is an example config
# DOCS: https://dependabot.com/docs/config-file/
version: 1 #required
update_configs: #required
- package_manager: "javascript" #required - options: javascript, ruby:bundler, php:composer, python, go:modules, go:dep, java:maven, java:gradle, dotnet:nuget, rust:cargo, elixir:hex, docker, terraform, submodules, elm
directory: "/" #required
update_schedule: "live" #required - options: live (check docs for supported package_managers, daily (weekdays only), weekly, monthly
target_branch: "main" #optional (default is default branch)
default_reviewers: #optional
- ""
default_assignees: #optional
- ""
default_labels: #optional
- "dependencies"
- "dependabot"
default_milestone: 1 #optional
allowed_updates: #optional, please see docs
ignored_updates: #optional, plese see docs
automerged_updates: #optional, please see docs
version_requirements: #optional, please see docs
commit_message: #optional, please see docs
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
.vagrant/
*console.log

# source code locations
kong/
kong-plugin/

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "submodules/kong"]
path = submodules/kong
url = https://github.com/Kong/kong.git
16 changes: 14 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if ENV["KONG_VERSION"]
version = ENV["KONG_VERSION"]
else
version = "1.4.0"
version = "1.4.2"
end

if ENV["KONG_CASSANDRA"]
Expand Down Expand Up @@ -96,14 +96,26 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder plugin_source, "/kong-plugin"
end

# Sync terraform folder
config.vm.synced_folder "./tf", "/tf"

# Copy terraform-provider-kong
config.vm.provision "file", source: "terraform-provider-kong_v5.0.0", destination: "$HOME/.terraform.d/plugins/"

# Sync all helper scripts into vm
config.vm.synced_folder "./scripts", "/home/vagrant/scripts"

config.vm.network :forwarded_port, guest: 8000, host: 8000
config.vm.network :forwarded_port, guest: 8001, host: 8001
config.vm.network :forwarded_port, guest: 8443, host: 8443
config.vm.network :forwarded_port, guest: 8444, host: 8444
config.vm.network :forwarded_port, guest: 9000, host: 9000 # only used with TCP stream proxy with Kong >= 0.15.0
config.vm.network :forwarded_port, guest: 5432, host: 65432

config.vm.provision "shell", path: "provision.sh",
config.vm.provision "shell", path: "./scripts/provision.sh",
env: { "HTTP_PROXY": ENV["HTTP_PROXY"], "HTTPS_PROXY": ENV["HTTPS_PROXY"]},
:args => [version, cversion, utils, anreports, loglevel]

# Run initialize Kong and plugins
config.vm.provision "shell", path: "./scripts/init.sh"
end
1 change: 1 addition & 0 deletions kong
1 change: 1 addition & 0 deletions kong-plugin
15 changes: 15 additions & 0 deletions scripts/compile_plugins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

cd /kong-plugin

for i in *; do
if [ -d $i ]; then
cd $i

printf "\t$i\n\n"

luarocks make *.rockspec

cd /kong-plugin
fi
done
37 changes: 37 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

echo "******************************"
echo "Initializing Terraform"
echo "******************************"

cd /tf/dev

terraform init

echo "******************************"
echo "Bootstrapping Kong DB"
echo "******************************"

kong migrations bootstrap

KONG_STATUS="$(kong health | grep running -o)"

export KONG_PLUGINS=cors,jwt,jwt-claims-headers,permission-middleware,prometheus,rate-limiting,syslog

echo "******************************"
echo "Starting Kong"
echo "plugins enabled:"
echo $KONG_PLUGINS
echo "******************************"

if [ "$KONG_STATUS" == "running" ]; then
kong restart
else
kong start
fi

echo "******************************"
echo "Applying Kong Terraform config"
echo "******************************"

terraform apply -auto-approve
11 changes: 11 additions & 0 deletions scripts/hmr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

reload_plugins() {
echo "Reloading Kong Plugins"
vagrant ssh -c "~/scripts/compile_plugins.sh"
vagrant ssh -c "cd /tf/dev; terraform apply -auto-approve"
}

export -f reload_plugins

fswatch -0 -xr --event=Updated ../../../kong-plugin/permission-middleware | xargs -0 -n1 bash -c reload_plugins
37 changes: 37 additions & 0 deletions scripts/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

echo "*************************************"
echo "Compiling kong middleware"
echo "*************************************"

cd /kong-plugin

for i in *; do
if [ -d $i ]; then
cd $i

printf "\t$i\n\n"

luarocks make *.rockspec

cd /kong-plugin
fi
done

echo "*************************************"
echo "Compiling kong"
echo "*************************************"

cd /
make --directory=./kong dev

if [ ! -f /usr/local/bin/terraform ] ; then
echo "*************************************"
echo "Installing terraform"
echo "*************************************"

cd /tmp
wget --quiet https://releases.hashicorp.com/terraform/0.12.17/terraform_0.12.17_linux_amd64.zip
unzip -qq terraform*.zip
mv ./terraform /usr/local/bin/
fi
File renamed without changes.
5 changes: 5 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

export PATH=/usr/local/bin:/usr/local/openresty/bin:/opt/stap/bin:/usr/local/stapxx:/usr/local/openresty/nginx/sbin:/usr/local/openresty/luajit/bin:$PATH:

/kong/bin/busted /kong-plugin
1 change: 1 addition & 0 deletions submodules/kong
Submodule kong added at 0ce8e3
Binary file added terraform-provider-kong_v5.0.0
Binary file not shown.
1 change: 1 addition & 0 deletions tf