Git Product home page Git Product logo

configurations-and-security-hardening's Introduction

Security Hardening

Here goes settings I would prefer or suggest to harden servicers, servers, hosts, endpoints, etc.

configurations-and-security-hardening's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

configurations-and-security-hardening's Issues

May be more efficient to exit DDNS script earlier if IPs haven't changed

It may save a few curl command executions to check earlier in the script if the current dynamic IPs match what's already in DNS and exit:

...
# get the basic data
ipv4=$(curl -s -X GET -4 https://ifconfig.co)
ipv6=$(curl -s -X GET -6 https://ifconfig.co)

# If the current dynamic IPs match what's already in DNS, exit the script
# Added by Thomas 2024-02-19
if [ $check_record_ipv4 == $ipv4 ]; then
        echo -e "\033[0;37m [~] No change: The current IPv4 address ${ipv4} matches the existing DNS records ${check_record_ipv4}."
        exit 0
fi
if [ $check_record_ipv6 == $ipv6 ]; then
        echo -e "\033[0;37m [~] No change: The current IPv6 address ${ipv6} matches the existing DNS records ${check_record_ipv6}."
        exit 0
fi

user_id=$(curl -s -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
               -H "Authorization: Bearer $api_token" \
               -H "Content-Type:application/json" \
          | jq -r '{"result"}[] | .id'
         )

# write down IPv4 and/or IPv6
...

Subdomain check

  • Show an error if the subdomain doesn't match the domain
  • Accept subdomain without mentioning the domain name, e.g., subdomain instead of subdomain.domain.com

script error

I have set up the A record, but it prompts an error

eeor

Error "./cloudflare: line 14: [: missing `]'"

Hello,
I am running the script on DDNS.md in order to update my DNS records for Cloudflare. Despite the script seems running properly, every time I do run it (by bash cloudflare.sh or ./cloudflare.sh) I get the following output:

# ./cloudflare 
./cloudflare: line 14: [: missing `]'
grep: ]: No such file or directory
 [+] Your public IPv4 address: 11....

I have taken a look at public docs like this, this and other ones, but I can't get rid of that unexpected warning. I am wondering if due to that the first if conditions may get ignored: it's not a big deal, but I am wondering if you may have a workaround.

Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.