• Stars
    star
    109
  • Rank 308,869 (Top 7 %)
  • Language
    Shell
  • License
    BSD 3-Clause "New...
  • Created over 5 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SEDATED® Project (Sensitive Enterprise Data Analyzer To Eliminate Disclosure)

SEDATED_logo_full

The SEDATED® Project (Sensitive Enterprise Data Analyzer To Eliminate Disclosure) focuses on preventing sensitive data such as user credentials and tokens from being pushed to Git.

Table of Contents

Purpose

With the myriad of code changes required in today's CICD environment developers are constantly pushing code that could unintentionally contain sensitive information. This potential sensitive data exposure represents a huge risk to organizations (2017 OWASP Top Ten #3 - Sensitive Data Exposure). SEDATED® addresses this issue by automatically reviewing all incoming code changes and providing instant feedback to the developer. If it identifies sensitive data it will prevent the commit(s) from being pushed to the Git server.

**NOTE: ONLY lines being added or modified (beginning with + in the patch file) in commit pushes are scanned by SEDATED®. Lines that are being removed (beginning with - in the patch file) in commit pushes are NOT scanned by SEDATED®.

Setup

1. Clone down SEDATED®

git clone https://github.com/OWASP/SEDATED.git

cd SEDATED/

2. Update .example files

cp /config/whitelists/commit_whitelist.txt.example /config/whitelists/commit_whitelist.txt

cp /config/whitelists/repo_whitelist.txt.example /config/whitelists/repo_whitelist.txt

cp /config/enforced_repos_list.txt.example /config/enforced_repos_list.txt

3. Customize /config/custom_configs.sh Variables and Functions (as desired)

4. Push SEDATED® with Organization Specific Implementation

Push organization specific implementation of SEDATED® to organization's desired Git repository (GitHub, GitLab, Git, etc...).

5. Point pre-receive hook to SEDATED®'s pre-receive.sh file

Instructions for accomplishing this on a GitHub Enterprise instance can be found in GitHub_Enterprise_Setup.md.

Local Testing

  • GitHub Docker Setup - General instructions for setting up a GitHub docker container to act as a Git server with a pre-receive hook enabled for local testing.
    • Some modifications will need to be made to allow SEDATED® to function as designed.
      • always_reject.sh will need to be replaced with the SEDATED® pre-receive.sh script.
      • SEDATED®'s accompanying files/folder structure will need to be included in the same directory/accessible by the pre-receive.sh script.
      • Some additional tweaks may be required as well, but the instructions linked above are a good starting point for local testing.

File Descriptions

pre-receive.sh
  • The heart and soul of SEDATED®.
  • The SEDATED® pre-receive Git hook script used in conjunction with SEDATED®'s regexes (config/regexes.json), identifies added or modified lines of code being pushed to a Git instance that contain hard-coded credentials/sensitive data (as identified in config/regexes.json) and prevents the push IF lines containing hard-coded credentials/sensitive data are found.
/config/custom_configs.sh
  • The SEDATED® custom configurations file used in conjunction with pre-receive.sh allows organizations to customize their SEDATED® implementation without having to modify any of the source code within SEDATED®'s pre-receive.sh file by providing built-in customizable variables and functions that are sourced from pre-receive.sh.
/config/enforced_repos_list.txt
  • Utilized when SEDATED® (pre-receive hook) use_enforced_repo_check_custom flag in config/custom_configs.sh is set to "True".
  • Allows SEDATED® to be "enabled" globally within the enterprise, but "enforced" selectively only on repositories listed in this file.
  • Enforcement for all repositories under a specific organization or username can be accomplished by appending the /* to the end of the organization or username where enforcement is desired.
  • If SEDATED® is enabled globally within an organization and does not appear in the /config/enforced_repos_list.txt file the pusher (if pushing from the command line) will see a customizable message (customize via the /config/custom_configs.sh file) and SEDATED® will NOT scan any of the code included in the push.
  • The flag to enable/disable this functionality can be found in /config/custom_configs.sh and set to "True" or "False".
    • "False" - Every repository with SEDATED® "enabled" will also have SEDATED® "enforced" on it.
    • "True" - Only repositories with SEDATED® "enabled" AND listed in the /config/enforced_repos_list.txt will have SEDATED® "enforced" on them. All other repositories with SEDATED® "enabled" but not listed in the /config/enforced_repos_list.txt file will only see a custom message displayed, no code will be scanned for pushes from those repositories.
  • This file can be blank, only needs to exist if use_enforced_repo_check_custom flag in config/custom_configs.sh is set to "True".
/config/regexes.json
  • Contains the regular expressions (regexes) used to flag sensitive data/hard-coded credentials.
  • These regexes are consumed by GNU grep (in pre-receive.sh) with the -P flag making them Perl-compatible regular expressions (PCREs).
  • Regexes may be added or removed from this file as-needed, however if utilizing the /testing/regex_testing/regex_test_script.sh script the /testing/regex_testing/test_cases.txt file will need to updated by adding or removing the test cases pertaining to the updated regexes so the results from the /testing/regex_testing/regex_test_script.sh will be accurate.
  • If adding/modifying regexes in this file additional escape characters \ may be needed depending on the desired regexes since this file is in JSON format.
/config/whitelists/commit_whitelist.txt
  • Utilized in the case of a false positive, one or more commits can be excluded in the scanning process if their commit ID's are included in this file.
  • Commit ID's will need to be carriage return separated in this file as shown in the /config/whitelists/commit_whitelist.txt.example file.
  • This file can be blank, but does need to exist.
Optional: Request that developers submit pull requests to this (commit_whitelist.txt) file when they encounter false positives so they can be reviewed.
/config/whitelists/repo_whitelist.txt
  • (organization/username)/repositories included in this file will be entirely excluded from scanning for sensitive data/hard-coded credentials until removed from this list.
  • Utilized in the case of a massive push (repository migration for example) where SEDATED® cannot scan the new/modified code included in the push within the 5 second window (the 5 second window is GitHub specific and may be different on other Git instances).
  • (organization/username)/repository names need to be carriage return separated in this file as shown in the /config/whitelists/repo_whitelist.txt.example file.
  • This file can be blank, but does need to exist.
/testing/regex_testing/regex_test_script.sh
  • The SEDATED® regular expression testing script used in conjunction with testing/regex_testing/test_cases.txt is a simple, quick, offline way to test/validate that the regular expressions inside config/regexes.json are valid and matching the desired patterns as well as excluding/not matching as desired.
    • Tests regexes against a list of test cases (/testing/regex_testing/test_cases.txt) to verify regexes working as expected.
    • Includes testing for both positive and negative test cases (/testing/regex_testing/test_cases.txt).
    • MUST use GNU grep when running the script otherwise the script will fail (BSD grep does not have the -P flag).
    • Test cases pulled in for use in this script are pulled in from /testing/regex_testing/test_cases.txt.
/testing/regex_testing/test_cases.txt
  • List of test cases to be passed-in to /testing/regex_testing/regex_test_script.sh for consumption.
  • Each test case has>>pass or >>fail appended to it these let the /testing/regex_testing/regex_test_script.sh script know the expectation for the regexes.
    • >>pass means a push containing the preceeding string will be accepted by SEDATED® (i.e. regexes will NOT flag the preceeding string).
    • >>fail means a push containing the preceeding string will be rejected by SEDATED® (i.e. regexes will flag the preceeding string).

Customization

Custom variables and functions are designed to allow organizations to easily customize their own specific implementation of SEDATED® without altering the main pre-receive hook file that does all the heavy lifting. All custom variables and functions can be found in /config/custom_configs.sh and the explanations of the variables contained in this file are listed below.

Custom Variables

  • show_SEDATED_link_custom - "True" to display link to OWASP/SEDATED GitHub repository (case-sensitive), otherwise set to "False".
  • documentation_link_custom - Add link to organization specific documentation on how the organization would like developers to handle rejected pushes and/or general organization specific information regarding SEDATED®.
    • Displayed back to the developer when a push is rejected.
    • Displayed back to the developer when enforced repo check is set to true and the repo is not included on the enforced_repos_list.txt file.
  • use_enforced_repo_check_custom - "True" or "False" (case-sensitive).
  • enforced_repo_check_true_message_custom with custom message (only necessary if use_enforced_repo_check_custom is set to "True").
  • obfuscate_output_custom - "True" or "False" (case-sensitive). Use this option to mask sensitive data displayed in the output of SEDATED®.

Custom Functions

  • SET_USER_REPO_NAME_CUSTOM
    • Sets user/organization/group and repository name.
    • Sets user/organization/group and repository name using GITHUB_REPO_NAME variable if using GitHub.
    • If not using GitHub custom variables can be set to get these names.
    • The provided non-GitHub names are setup for just getting the names in vanilla Git, but may need to be adjusted based on different implementations (Git SCMs).
  • PRINT_ERROR_MESSAGE_CUSTOM
    • Allows a custom error message to be printed when errors are encountered.
  • EXIT_SEDATED_CUSTOM
    • Take additional custom action when exiting SEDATED® (i.e. log, send metrics, etc...).
    • Defaults to : "do nothing" as an additional action, and is not required to be changed.
  • UNABLE_TO_ACCESS_REPO_WHITELIST_CUSTOM
    • Take additional custom action when SEDATED® is unable to access the repo whitelist file (i.e. print error message, log, send metric, etc...).
    • Defaults to : "do nothing" as an additional action, and is not required to be changed.
  • PUSH_ACCEPTED_CUSTOM
    • Take additional custom action when a push is accepted (i.e. log, send metrics, etc...).
    • Defaults to : "do nothing" as an additional action, and is not required to be changed.
  • UNABLE_TO_ACCESS_REGEXES_CUSTOM
    • Take additional custom action when SEDATED® is unable to access the regexes.json file.
    • Defaults to : "do nothing" as an additional action, and is not required to be changed.
    • SEDATED® will exit 1 and print error message if unable to access regexes, however additional custom action may be performed in these cases if desired (i.e. print additional error message, log, send metric, etc...).
  • PUSH_REJECTED_WITH_VIOLATIONS_CUSTOM
    • Take additional custom action when pushes are rejected for containing violations (i.e. log, send metrics, etc...).
    • Defaults to : "do nothing" as an additional action, and is not required to be changed.
  • UNABLE_TO_ACCESS_COMMIT_WHITELIST_CUSTOM
    • Take additional custom action when SEDATED® is unable to access the commit whitelist file (i.e. log, send metrics, etc...).
    • Defaults to : "do nothing" as an additional action, and is not required to be changed.

Compatibility

Only compatible with SCM tools that utilize the Git version control system.

  • GitHub
  • GitLab
  • Git
    • Preliminarily tested.
    • All SEDATED® files/folders will need to be placed into the .git/hooks/ directory (except documentation folder/files).
    • Remove .sample from pre-receive.sample and copy the code from SEDATED®'s pre-receive.sh file into the pre-receive file we just made from the .sample file.
    • Depending on implementation may want to use git-template or something similar.
  • Any Other Git SCM Tool
    • Not tested.
    • Modifications to SET_USER_REPO_NAME_CUSTOM will likely be required to set user/org and repo name.
    • May require additional modifications to work.

Contribute

Contributions to this project welcome!

You can contribute in either of the following ways:

  • Submit your ideas for improvement to us (or anyone in the community who may want to take on the challenge of turning your idea into reallity within SEDATED®'s code base) please raise an issue with a good explanation of what you think could improve SEDATED® and how you think that could practically happen within the code base.
  • Submit a pull request with your code changes for making SEDATED® better and we will review, test, and merge. :)

Authors

  • Dennis Kennedy
  • Simeon Cloutier

License

SEDATED® is licensed under the BSD 3-Clause "New" or "Revised" License.


**SEDATED® is not guaranteed to flag every instance of hard-coded credential, key, secret, etc... it uses regex pattern matching and though it has gotten pretty good at catching most instances it is not perfect, but we are always open to ideas and/or pull requests to help make SEDATED® even better.

More Repositories

1

CheatSheetSeries

The OWASP Cheat Sheet Series was created to provide a concise collection of high value information on specific application security topics.
Python
26,662
star
2

owasp-mastg

The Mobile Application Security Testing Guide (MASTG) is a comprehensive manual for mobile app security testing and reverse engineering. It describes the technical processes for verifying the controls listed in the OWASP Mobile Application Security Verification Standard (MASVS).
Python
11,307
star
3

Amass

In-depth Attack Surface Mapping and Asset Discovery
Go
7,941
star
4

wstg

The Web Security Testing Guide is a comprehensive Open Source guide to testing the security of web applications and web services.
Dockerfile
6,708
star
5

Go-SCP

Golang Secure Coding Practices guide
Go
4,729
star
6

Top10

Official OWASP Top 10 Document Repository
HTML
4,057
star
7

Nettacker

Automated Penetration Testing Framework - Open-Source Vulnerability Scanner - Vulnerability Management
Python
2,924
star
8

ASVS

Application Security Verification Standard
HTML
2,517
star
9

DevGuide

The OWASP Guide
2,011
star
10

API-Security

OWASP API Security Project
Dockerfile
1,943
star
11

owasp-masvs

The OWASP MASVS (Mobile Application Security Verification Standard) is the industry standard for mobile app security.
Python
1,942
star
12

NodeGoat

The OWASP NodeGoat project provides an environment to learn how OWASP Top 10 security risks apply to web applications developed using Node.js and how to effectively address them.
HTML
1,809
star
13

QRLJacking

QRLJacking or Quick Response Code Login Jacking is a simple-but-nasty attack vector affecting all the applications that relays on “Login with QR code” feature as a secure way to login into accounts which aims for hijacking users session by attackers.
Python
1,308
star
14

SecurityShepherd

Web and mobile application security training platform
Java
1,279
star
15

wrongsecrets

Vulnerable app with examples showing how to not use secrets
Java
1,071
star
16

www-project-top-ten

OWASP Foundation Web Respository
HTML
1,032
star
17

joomscan

OWASP Joomla Vulnerability Scanner Project https://www.secologist.com/
Raku
1,009
star
18

crAPI

completely ridiculous API (crAPI)
Java
961
star
19

www-community

OWASP Community Pages are a place where OWASP can accept community contributions for security-related content.
HTML
888
star
20

railsgoat

A vulnerable version of Rails that follows the OWASP Top 10
HTML
852
star
21

threat-dragon

An open source threat modeling tool from OWASP
JavaScript
818
star
22

java-html-sanitizer

Takes third-party HTML and produces HTML that is safe to embed in your web application. Fast and easy to configure.
Java
788
star
23

OWASP-VWAD

The OWASP Vulnerable Web Applications Directory project (VWAD) is a comprehensive and well maintained registry of all known vulnerable web applications currently available.
749
star
24

DevSecOpsGuideline

The OWASP DevSecOps Guideline can help us to embedding security as a part of the development pipeline.
Python
705
star
25

ZSC

OWASP ZSC - Shellcode/Obfuscate Code Generator https://www.secologist.com/
Python
634
star
26

IoTGoat

IoTGoat is a deliberately insecure firmware created to educate software developers and security professionals with testing commonly found vulnerabilities in IoT devices.
C
628
star
27

Docker-Security

Getting a handle on container security
Dockerfile
613
star
28

OWASP-WebScarab

OWASP WebScarab
Java
582
star
29

www-project-kubernetes-top-ten

OWASP Foundation Web Respository
HTML
550
star
30

MASTG-Hacking-Playground

Java
549
star
31

DVSA

a Damn Vulnerable Serverless Application
JavaScript
515
star
32

glue

Application Security Automation
Ruby
513
star
33

owasp-java-encoder

The OWASP Java Encoder is a Java 1.5+ simple-to-use drop-in high-performance encoder class with no dependencies and little baggage. This project will help Java web developers defend against Cross Site Scripting!
Java
473
star
34

SecureCodingDojo

The Secure Coding Dojo is a platform for delivering secure coding knowledge.
PHP
441
star
35

owasp.github.io

OWASP Foundation main site repository
HTML
423
star
36

rbac

PHP-RBAC is an authorization library for PHP. It provides developers with NIST Level 2 Standard Role Based Access Control and more, in the fastest implementation yet.
PHP
423
star
37

Python-Honeypot

OWASP Honeypot, Automated Deception Framework.
Python
404
star
38

samm

SAMM stands for Software Assurance Maturity Model.
JavaScript
395
star
39

iGoat-Swift

OWASP iGoat (Swift) - A Damn Vulnerable Swift Application for iOS
C
391
star
40

www-project-web-security-testing-guide

The Web Security Testing Guide (WSTG) Project produces the premier cybersecurity testing resource for web application developers and security professionals.
HTML
376
star
41

www-project-top-10-for-large-language-model-applications

OWASP Foundation Web Respository
TeX
374
star
42

threat-model-cookbook

This project is about creating and publishing threat model examples.
Python
373
star
43

igoat

OWASP iGoat - A Learning Tool for iOS App Pentesting and Security by Swaroop Yermalkar
C
368
star
44

O-Saft

O-Saft - OWASP SSL advanced forensic tool
Perl
344
star
45

Vulnerable-Web-Application

OWASP Vulnerable Web Application Project https://github.com/hummingbirdscyber
PHP
324
star
46

vbscan

OWASP VBScan is a Black Box vBulletin Vulnerability Scanner
Perl
322
star
47

Serverless-Goat

OWASP ServerlessGoat: a serverless application demonstrating common serverless security flaws
Python
302
star
48

SecureTea-Project

The OWASP SecureTea Project provides a one-stop security solution for various devices (personal computers / servers / IoT devices)
JavaScript
281
star
49

RiskAssessmentFramework

The Secure Coding Framework
TypeScript
245
star
50

pysap

pysap is an open source Python library that provides modules for crafting and sending packets using SAP's NI, Diag, Enqueue, Router, MS, SNC, IGS, RFC and HDB protocols.
Python
205
star
51

Serverless-Top-10-Project

OWASP Serverless Top 10
199
star
52

phpsec

OWASP PHP Security Project - THIS PROJECT IS INACTIVE AND MAY CONTAIN SECURITY FLAWS
197
star
53

json-sanitizer

Given JSON-like content, The JSON Sanitizer converts it to valid JSON.
Java
190
star
54

D4N155

OWASP D4N155 - Intelligent and dynamic wordlist using OSINT
Shell
186
star
55

www-chapter-japan

OWASP Foundation Web Respository
HTML
181
star
56

Maturity-Models

Node application to help managing Maturity Models like the ones created by BSIMM and OpenSAMM
JavaScript
176
star
57

www-project-ai-security-and-privacy-guide

OWASP Foundation Web Respository
HTML
170
star
58

passfault

OWASP Passfault evaluates passwords and enforces password policy in a completely different way.
JavaScript
169
star
59

OFFAT

The OWASP OFFAT tool autonomously assesses your API for prevalent vulnerabilities, though full compatibility with OAS v3 is pending. The project remains a work in progress, continuously evolving towards completion.
Python
159
star
60

ASST

OWASP ASST (Automated Software Security Toolkit) | A Novel Open Source Web Security Scanner.
JavaScript
152
star
61

IoT-Security-Verification-Standard-ISVS

OWASP IoT Security Verification Standard (ISVS)
TeX
129
star
62

Software-Component-Verification-Standard

Software Component Verification Standard (SCVS)
Python
127
star
63

owasp-summit-2017

Content for OWASP Summit 2017 site
CSS
126
star
64

BLT

OWASP BLT is a bug logging tool to report issues and get points, companies are held accountable.
HTML
124
star
65

www-project-secure-headers

The OWASP Secure Headers Project
Python
122
star
66

sonarqube

OWASP SonarQube Project
Dockerfile
107
star
67

www-project-code-review-guide

OWASP Code Review Guide Web Repository
HTML
106
star
68

www-project-proactive-controls

OWASP Foundation Web Respository
Shell
104
star
69

raider

OWASP Raider: a novel framework for manipulating the HTTP processes of persistent sessions
Python
103
star
70

OWASP-Testing-Guide

OWASP Testing Guide
103
star
71

OWASPWebGoatPHP

A deliberately vulnerable web application for learning web application security.
PHP
99
star
72

user-security-stories

Repo to hold mapping of user-security-stories
99
star
73

KubeLight

OWASP Kubernetes security and compliance tool [WIP]
Python
97
star
74

Honeypot-Project

Python
78
star
75

www-project-webgoat

OWASP Foundation Web Respository
HTML
78
star
76

NINJA-PingU

Python
77
star
77

threat-dragon-desktop

Desktop variant of OWASP Threat Dragon
77
star
78

www-project-mobile-top-10

HTML
75
star
79

owasp-istg

The IoT Security Testing Guide (ISTG) provides a comprehensive methodology for penetration tests in the IoT field, offering flexibility to adapt innovations, and developments in the IoT market while still ensuring comparability of test results.
Python
73
star
80

www-project-csrfguard

The aim of this project is to protect Java applications against CSRF attacks with the use of Synchronizer Tokens
Java
71
star
81

SSO_Project

OWASP Single Sign-On allows a secure-by-default self-hosted SSO experience, including phishing-proof two-factor authentication, using state-of-the-art security mechanisms.
JavaScript
68
star
82

www-project-zap

OWASP Zed Attack Proxy project landing page.
HTML
67
star
83

PHP-ESAPI

Migrated from code.google.com to a more active public repository.
PHP
65
star
84

www-project-security-knowledge-framework

OWASP Foundation Web Respository
HTML
64
star
85

wpBullet

Python
63
star
86

www-project-top-10-low-code-no-code-security-risks

OWASP Low-Code/No-Code Top 10
HTML
60
star
87

www-project-threat-dragon

OWASP Foundation Threat Dragon Project Web Repository
HTML
59
star
88

www-project-top-10-ci-cd-security-risks

OWASP Foundation Web Respository
HTML
58
star
89

www-project-application-security-verification-standard

OWASP Foundation Web Respository
HTML
58
star
90

www-project-machine-learning-security-top-10

OWASP Machine Learning Security Top 10 Project
HTML
57
star
91

Container-Security-Verification-Standard

Container Security Verification Standard
Python
56
star
92

OpenCRE

CSS
55
star
93

www-project-developer-guide

OWASP Project Developer Guide - Document and Project Web pages
HTML
52
star
94

www-project-secure-coding-practices-quick-reference-guide

OWASP Foundation Project Web Repository for Secure Coding Practices Quick-reference Guide
HTML
52
star
95

www-project-devsecops-guideline

The OWASP DevSecOps Guideline explains how we can implement a secure pipeline and use best practices and introduce tools that we can use in this matter. Also, the project is trying to help us promote the shift-left security culture in our development process.
HTML
49
star
96

www-project-devsecops-maturity-model

OWASP Foundation Web Respository
HTML
48
star
97

www-project-juice-shop

OWASP Foundation Web Respository
HTML
48
star
98

packman

A documentation and tracking project with the goal of making package management systems more secure.
47
star
99

www-project-api-security

OWASP Foundation Web Repository
HTML
47
star
100

WebGoat

This is a defunct code base. The project is located at: https://github.com/WebGoat
HTML
47
star