Generate openssl keys:
openssl req -x509 -nodes -newkey rsa:2048 -keyout mysqldump-key.priv.pem -out mysqldump-key.pub.pem
Create a mysql default file:
# ~/.mysqldump
[mysqldump]
host = host.here.com
SELECT | |
req.session_id AS [session], | |
ses.program_name AS [program], | |
sqltext.TEXT AS [query], | |
DB_NAME(req.database_id) AS [database], | |
req.status, | |
wg.name AS [resource_group], | |
req.command, | |
CONVERT(varchar(10), (req.cpu_time / 86400000)) + ':' + | |
CONVERT(varchar(10), ((req.cpu_time % 86400000) / 3600000)) + ':' + |
-- Elastic Agent Jobs | |
-- https://sqlkitty.com/elastic-jobs-azure-sql-db/ | |
-- Add target group | |
EXEC jobs.sp_add_target_group 'AzureSQLDBs'; | |
-- Add single database (or server/elastic pool) to target group | |
EXEC jobs.sp_add_target_group_member | |
@target_group_name = 'AzureSQLDBs', | |
@target_type = 'SqlDatabase', |
- name: Get Azure CLI | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Get Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: 'latest' | |
terraform_wrapper: false |
{ | |
"annotations": { | |
"list": [ | |
{ | |
"$$hashKey": "object:690", | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", |
class Hash | |
def strip | |
StripperHash.new(self) | |
end | |
end | |
class StripperHash < Hash | |
def initialize(constructor = {}) | |
if constructor.respond_to?(:to_hash) | |
super |
Generate openssl keys:
openssl req -x509 -nodes -newkey rsa:2048 -keyout mysqldump-key.priv.pem -out mysqldump-key.pub.pem
Create a mysql default file:
# ~/.mysqldump
[mysqldump]
host = host.here.com
#!/usr/bin/env bash | |
# | |
# Purpose: | |
# Maintains 7 daily and 1 weekly database backups on a remote server. | |
# | |
# Configuration: | |
# Subdirectories must be created on the remote server for each database. | |
# (This includes status & fullschema directories if applicable.) | |
# | |
# Examples: |
/* | |
******************************************************************************************************************************** | |
Credits: @Jeremy | |
Posted: http://stackoverflow.com/questions/7048839/sql-server-query-to-find-all-permissions-access-for-all-users-in-a-database | |
******************************************************************************************************************************** | |
Security Audit Report | |
1) List all access provisioned to a sql user or windows user/group directly | |
2) List all access provisioned to a sql user or windows user/group through a database or application role | |
3) List all access provisioned to the public role |
SELECT | |
req.session_id AS [session], | |
ses.program_name AS [program], | |
jobs.name AS [job], | |
sqltext.TEXT AS [query], | |
DB_NAME(req.database_id) AS [database], | |
req.status, | |
wg.name AS [resource_group], | |
req.command, | |
CONVERT(varchar(10), (req.cpu_time / 86400000)) + ':' + |
CREATE TABLE [state]( | |
[stateID] [int] IDENTITY(1,1) NOT NULL, | |
[stateCode] [nchar](2) NOT NULL, | |
[stateName] [nvarchar](128) NOT NULL, | |
CONSTRAINT [PK_state] PRIMARY KEY CLUSTERED | |
( [stateID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) | |
ON [PRIMARY] |