Challenges and barriers when you move to the cloud include:
Below some of the best practices: - Always craete individual users, never share credentials - Do not use root user for normal operation, remove any access key for root - Use groups to assign permissions to IAM users, not to individuals - Enable logging for all cloud API calls - Audit IAM accounts in regular bases - Restrict access to cloud resources using ip addresses - Turno on billing alerts to detect suspicious events - Requets to users to use multi-factor authentatication, including command lines interfaces - Assign users and groups to have emough access permissions
Most of the cloud providers offer a Virtual Private Cloud (VPC) whic his a representation of a physical network or data center. It is used for communication between resources within a project. It also isolates resources from outside world.
In VPC, every resource receives an individual IP address. This includes: - Traffic to and from instances inside the VPC are controlled with firewall rules - Resources inside VPC communicate each other using IP addresses - Instances within VPC can communicate witht eh cloud providers APIs and services
To protect communication: - Virtual Private Networks (VPN): Offers encrypted traffic between two networks over public networks such as internet. - Web traffic Encryption: It is important to use TLS encruptio from cloud load balancers to any VMs or containers in the backend.
Note that inmutable infrastructure in here means, that instances on the cloud are replaced rather than updated: destroy-versus-updatei
To ensure object storage security: - Access control: - Grant permissions to all object requires access only - Do not make data public if it is not needed - Double check with your provider to ensure proper configuration - Use third-party audit tools to ensure no leaks - Logging: - Data retention: - Cloud providers have the ability to set user-defined retention policy - An object can be deleted once its age is greater than the retentino policy set
- Backup disks periodically
- Compress and store them in a location of your choice
- To enforce the principle of least privilege, create an user with known ID int he dockerfile and run the application process as that user
- Verify the integrity of an docker image using its SHA256
- Scan vulnerabilities on your docker images using command line tools such as Clair or Anchore in your CI/CD pipeline
- Scan your code base with static or dynamic analysis tools
- Ensure third party libraries are free of vulnerabilities
- Threat model regularly
- Construct a robust loggin pipeline
- Apply the least privilege principle in your functions
- Protect your code from DoS and Resrouce-exhaustion attacks
- Consider the following resources:
- [OWASP ServerlessGoat](https://www.owasp.org/index.php/OWASP_Serverless_Goat)
- [OWASP Serverless Top 10](https://www.owasp.org/index.php/OWASP_Serverless_Top_10_Project)
- App Metrics:
- Who logged in, from where , when
- Get attack payload submitted in the request
- HTTP error codes
- Response times
- Vulnerability scanner detection
- Host metrics:
- Resource utilization, CPU, memory, threads
- SSH access
- Port opened, closed
- Malware detection
- File creation / deletion
- Thrid party libraries installed
- Network metrics:
- Throughput
- Resource exhaustion
- Outbound network calls
- DNS queries
- Cloud API metrics:
- Who logged into
- AWS cloud trail:
- Console sign-in events
- Security group changes
- CloudTrail logging changes
- VPC changes
Here some overall indicatores: - Number of 500 erros per period of time on your backend - If number of loggin attemps with same user - Attemps to access another account
Note that logs should offer high integrity and not able to be deleted or modified easly.
Some recommendations:
Location:
Services:
Client libraries:
To consider about DoS attacks
Compliance:
General features
Google cloud identity and access management features:
Google cloud identity features:
Configuration :
IAM best practices:
https://www.modsecurity.org/ http://appsensor.org/
https://www.yubico.com/products/ https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html https://owasp.org/www-project-application-security-verification-standard/ https://www.npmjs.com/package/bcrypt https://www.synopsys.com/software-integrity.html https://pages.nist.gov/800-63-3/sp800-63-3.html https://wiki.owasp.org/index.php/Category:Access_Control https://owasp.org/www-project-secure-headers/#X-XSS-Protection https://owasp.org/www-community/HttpOnly
https://owasp.org/www-project-top-ten/ https://bobby-tables.com/