I hereby claim:
- I am iAugur on github.
- I am georgeboobyer (https://keybase.io/georgeboobyer) on keybase.
- I have a public key whose fingerprint is A64E B761 9907 2707 8211 6659 F5E8 C317 7EB8 BCA5
To claim this, I am signing this object:
# Steps for renaming your master branch to 'main' | |
# Adapted from | |
# https://dev.to/rhymu8354/git-renaming-the-master-branch-137b | |
# https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx | |
#---------------------------------------------------------------------------------------------# | |
# A) - Steps if you have no remote / upstream | |
# B) - Steps if you are the repo owner and have a remote / upstream | |
# C) - Steps if you are using a repo where the upstream main branch has been renamed |
I hereby claim:
To claim this, I am signing this object:
# Adapted from solution provided by http://stackoverflow.com/users/57719/chin-huang http://stackoverflow.com/a/31465939/348868 | |
# Scenario: You want to add a group to the list of the AllowGroups in ssh_config | |
# before: | |
# AllowGroups Group1 | |
# After: | |
# AllowGroups Group1 Group2 | |
- name: Add Group to AllowGroups | |
replace: | |
backup: yes |
# Examples of real attempts to access sensitive files and backups | |
/sites/default/settings | |
/sites/default/settings.php~ | |
/sites/default/settings.php.txt | |
/sites/default/settings.php.old | |
/sites/default/settings.php_old | |
/sites/default/settings.php-old | |
/sites/default/settings.php.save | |
/sites/default/settings.php.swp | |
/sites/default/settings.php.swo |
wget --spider -o wget.log -e robots=off -r -l 5 -p -S -T3 --header="X-Bypass-Cache: 1" -H --domains=live-mysite.mydomain.com --show-progress live-mysite.mydomain.com | |
# Options explained | |
# --spider: Crawl the site | |
# -o wget.log: Keep the log | |
# -e robots=off: Ignore robots.txt | |
# -r: specify recursive download | |
# -l 5: Depth to search. I.e 1 means 'crawl the homepages'. 2 means 'crawl the homepage and all pages it links to'... | |
# -p: get all images, etc. needed to display HTML page | |
# -S: print server response (to the log) |
--- | |
- hosts: servers | |
gather_facts: true | |
sudo: true | |
vars: | |
fail2ban_config_ignoreip: | |
- "127.0.0.1/8" | |
- "{{ ansible_ssh_host }}" |
A simple example of creating a list from a dictionary var using Jinja filters in an ansible play task. see article: http://www.blue-bag.com/blog/ansible-filters-taming-lists-part-1
This is a good example of how to respond to an issue with Ansible to ensure that your infrastructure is secure and that the measures you take are consistent across your inventory and are documented.
See the full article here for more details.
The example is am using is an issue that cropped up in the Logwatch report for one of our servers. Logwatch is a utility that scans your logs for patterns that may indicate malicious activity. It is commonly used in partnership with fail2Ban and IPtables to ward of common attacks. In this case the line in the log was:
Connection attempts using mod_proxy:
Following on from other Gists I have posted, this one shows a neat way of using Includes to centralise general blocking rules for Bad Bots, creepy crawlers and irritating IPs | |
see the full post at http://www.blue-bag.com/blog/apache-better-blocking-common-rules |