Skip to content

Instantly share code, notes, and snippets.

View austinsonger's full-sized avatar
🙃
Localhost

Austin Songer, CISSP austinsonger

🙃
Localhost
View GitHub Profile
@austinsonger
austinsonger / OneTimeDownloadFromGoogleDrive.gs
Last active December 3, 2024 16:49
Google App Script - Download files from Google Drive by the one time download method [File is Public for 1 Minutes and automatically Unshared]
function deletePermission() {
const forTrigger = "deletePermission";
const id = CacheService.getScriptCache().get("id");
const triggers = ScriptApp.getProjectTriggers();
triggers.forEach(function(e) {
if (e.getHandlerFunction() == forTrigger) ScriptApp.deleteTrigger(e);
});
const file = DriveApp.getFileById(id);
file.setSharing(DriveApp.Access.PRIVATE, DriveApp.Permission.NONE);
}
@austinsonger
austinsonger / TransferOwnership.gs
Last active December 3, 2024 16:50
Google App Script - Transfer Ownership of File(s) OR Entire Drive
/**
* Transfer ownership of a specific file to another user.
* @param {string} fileId The ID of the file to transfer ownership.
* @param {string} newOwnerEmail The email address of the new owner.
*/
function transferFileOwnership(fileId, newOwnerEmail) {
try {
const file = DriveApp.getFileById(fileId);
Logger.log(`Current owner of file '${file.getName()}' is: ${file.getOwner().getEmail()}`);
file.setOwner(newOwnerEmail);
@austinsonger
austinsonger / NewFilesToFolder.gs
Last active December 2, 2024 23:54
Google App Script - New File Moves files from "My Drive" to a specified folder automatically.
// ##################### Parameters for Drive Selection #####################
// - useSharedDrive
// - true: Use a shared drive as the source.
// - false: Use "My Drive" as the source.
// - sharedDriveId: Specifies the ID of the shared drive to target.
// - targetFolderId: Specifies the ID of the folder where files will be moved.
//############################################################################
function moveNewFilesToFolder(useSharedDrive = false, sharedDriveId = null, targetFolderId = "YOUR_TARGET_FOLDER_ID") {
const targetFolder = DriveApp.getFolderById(targetFolderId);
const files = useSharedDrive
@austinsonger
austinsonger / FileSharingReporting.gs
Last active December 3, 2024 01:48
Google App Script - File Sharing Report for Organization using Google Workspace [Email + Write to Google Sheet in Shared Drive]
function dailyFileSharingReportForOrg() {
const recipientEmail = "[email protected]";
const domain = "yourdomain.com";
const sharedDriveName = "Shared Drive Name";
const sheetName = "External File Sharing Log";
const today = new Date();
const yesterday = new Date(today);
yesterday.setDate(today.getDate() - 1);
@austinsonger
austinsonger / jira-ticket-google-calendar.gs
Created December 2, 2024 17:59
Create Calendar Event From Due Date within a Jira Ticket
/*
TO-DO:
- [X] Modularize Create New Function parsePayload
- [X] Modularize Create New Function constructEventDetails
- [X] Modularize Create New Function createCalendarEvent
- [X] Make Jira Ticket Reporter also the Google Calendar Event Creator
- [X] Automatically add the Ticket URL into the Calendar Event Description
- [ ] Make it sync bi-directional sync
- [ ] Separate out the global constants into a separate file "Constants.gs"
- [ ] Separate out the Calendar scheduling functions into a separate file "CalendarUtils.gs"
@austinsonger
austinsonger / oss.md
Created July 18, 2024 16:19
Evaluating Open Source Software as Dependencies

Avoid New Dependencies

  • Use existing (possibly indirect) dependencies.
  • Minimize attack surface.

Evaluate Intended Version

  • Verify software version (not personal/attacker-controlled fork).
  • Check project name and website link.
  • Verify fork relation on GitHub/GitLab.
@austinsonger
austinsonger / instructions.md
Last active December 6, 2024 19:19
Template for Custom GPT Instructions
  • Always put // before a single instruction.
  • ChatGPT will read instructions behind // but it won't include what is behind // in the response
  • Sometimes ChatGPT will add stuff from instructions in the response, but with // it won't.
// 1. Role and Purpose: As a [GPT Name], your role is to [Purpose/Function]. You are designed to [Brief Description of What the GPT Does].
// 2. Introduction: You are [GPT Name], purposed to [Purpose/Function]. You are here to assist users with [Specific Tasks or Services].
@austinsonger
austinsonger / 0. Proof of Concept - Elastic Detection: VIP - Executive impersonation in subject (untrusted).md
Last active July 2, 2024 18:38
Proof of Concept - Elastic Detection: VIP / Executive impersonation in subject (untrusted)

This detection rule is designed to identify emails where the sender's subject contains the display name of a VIP or executive from a predefined list (org_vips), and the sender has never been seen before. This rule is particularly useful for detecting Business Email Compromise (BEC) or fraud attempts targeting high-profile individuals within an organization.

Pre-requisites

  • org_vips List: A list of display names of VIPs or executives that must be manually connected to a VIP group of your upstream provider (Google Workspace).
  • Email Provider: Google Workspace.

Explanation of the Query

  1. Basic Event Filtering:
@austinsonger
austinsonger / volatilitybased.py
Created June 22, 2024 18:20
Volatility-Based Trading Signal Algorithm: This algorithm leverages multiple technical indicators to evaluate market conditions and generate a consolidated trading signal ranging from -3 to +3. Each indicator contributes to the overall score based on its specific criteria, helping traders to identify optimal entry and exit points.
import pandas as pd
import numpy as np
import ta
from ta.volatility import BollingerBands
from ta.momentum import RSIIndicator, StochasticOscillator
from ta.trend import MACD, EMAIndicator
from ta.volume import OnBalanceVolumeIndicator
def calculate_signal(df):
# Calculate Bollinger Bands
AccessKeysRotated:
- Frameworks:
- PCI DSS:
- ''
- NIST 800-53:
- ''
- HIPAA Security:
- ''
- FedRAMP:
- ''