Skip to content

Instantly share code, notes, and snippets.

View snyk-omar's full-sized avatar
🐼

Omar Quimbaya snyk-omar

🐼
View GitHub Profile
@snyk-omar
snyk-omar / snyk-broker.template.yaml
Created October 28, 2022 19:51
Cloudformation template for Snyk Broker in ECS
AWSTemplateFormatVersion: 2010-09-09
Parameters:
KeyName:
Type: 'AWS::EC2::KeyPair::KeyName'
Description: Name of an existing EC2 KeyPair to enable SSH access to the ECS instances.
VpcId:
Type: 'AWS::EC2::VPC::Id'
Description: Select a VPC that allows instances to access the Internet.
SubnetId:
Type: 'List<AWS::EC2::Subnet::Id>'
@snyk-omar
snyk-omar / delete-all-snyk-code-projects.py
Created August 23, 2022 16:46
Delete all Snyk Code projects
"""
This script goes through all of your organizations in a group and deletes all Snyk Code projects.
Please create a .env file in the same directory as this script and add the following variables:
SNYK_TOKEN = your_snyk_token
GROUP_ID = your_group_id
Afterwards, use a version of Python that is at least 3.7.
@snyk-omar
snyk-omar / delete_all_deactivated_projects.py
Last active July 20, 2022 20:14
Delete all projects that are deactivated in Snyk
"""
This script goes through all of your organizations in a group and deletes anything that is not active.
Please create a .env file in the same directory as this script and add the following variables:
SNYK_TOKEN = your_snyk_token
GROUP_ID = your_group_id
Afterwards, use a version of Python that is at least 3.7.
@snyk-omar
snyk-omar / add-sast-tags.py
Last active July 29, 2022 19:15
Add tags to SAST projects in Snyk.
#! /usr/bin/env python3
"""
Need to install httpx and python-dotenv to run this script.
```
pip install httpx python-dotenv
```
Additionally, you will need a .env file with two variables in it:
@snyk-omar
snyk-omar / delete_projects.py
Created May 10, 2022 19:45
Delete all projects other than Snyk Code projects.
import httpx
import logging
from dotenv import dotenv_values
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
CONFIG = dotenv_values()
def create_client(base_url: str) -> httpx.Client:
#!/usr/bin/env python3
"""
Requires a .env file in the directory where this file is run.
.env file should contain these:
SNYK_TOKEN=TOKEN
ORG_ID=ORG_ID_GUID
Output will be displayed in a log file: main.log.
@snyk-omar
snyk-omar / accept.json
Created March 9, 2022 14:57
Accept.json for Azure Repos + Code Agent HTTP Only
{
"public": [
{
"//": "used for pushing up webhooks from Azure",
"method": "POST",
"path": "/webhook/azure-repos/:webhookId"
}
],
"private": [
{
@snyk-omar
snyk-omar / accept.json
Last active March 9, 2022 14:58
Azure Repos + Code Agent Accept.json
{
"public": [
{
"//": "used for pushing up webhooks from Azure",
"method": "POST",
"path": "/webhook/azure-repos/:webhookId"
}
],
"private": [
{
@snyk-omar
snyk-omar / broker-http-bitbucket-server-accept.json
Last active June 30, 2022 22:52
accept.json for bitbucket servers not using https
{
"public": [
{
"//": "used for pushing up webhooks from bitbucket-server",
"method": "POST",
"path": "/webhook/bitbucket-server/:webhookId"
}
],
"private": [
{