Este producto no es compatible con el sitio Datadog seleccionado. ().
Esta página aún no está disponible en español. Estamos trabajando en su traducción. Si tienes alguna pregunta o comentario sobre nuestro actual proyecto de traducción, no dudes en ponerte en contacto con nosotros.
Allowing ingress on all ports (0-65535) greatly increases attack surface by exposing every service port to network scanning and exploitation. This can lead to unauthorized access, lateral movement, and easier compromise of instances.
This rule flags Ansible tasks using the google.cloud.gcp_compute_firewall or gcp_compute_firewall module where the rule is ingress and the allowed entry contains ports: ["0-65535"] for a firewall associated with a compute network referenced by a preceding google.cloud.gcp_compute_network/gcp_compute_network task.
The allowed.ports property must not include "0-65535". Instead, specify explicit ports or narrow ranges (for example "80", "443", or "1024-2048") and restrict access with appropriate sourceRanges or other selectors.
Secure example (allow only HTTP/HTTPS from a limited source range):
- name:Allow HTTP and HTTPS from internal rangegoogle.cloud.gcp_compute_firewall:name:allow-webnetwork:"{{ my_network }}"direction:INGRESSallowed:- IPProtocol:tcpports:["80","443"]sourceRanges:["10.0.0.0/8"]
Compliant Code Examples
- name:create a firewallgoogle.cloud.gcp_compute_firewall:name:test_objectallowed:- ip_protocol:tcpports:- '22'target_tags:- test-ssh-server- staging-ssh-serversource_tags:- test-ssh-clientsproject:test_projectauth_kind:serviceaccountservice_account_file:"/tmp/auth.pem"state:presentnetwork:"{{ my_network }}"- name:create a networkgoogle.cloud.gcp_compute_network:name:test_objectauto_create_subnetworks:'true'project:test_projectauth_kind:serviceaccountservice_account_file:"/tmp/auth.pem"state:presentregister:my_network
Non-Compliant Code Examples
- name:create a firewall2google.cloud.gcp_compute_firewall:name:test_objectallowed:- ip_protocol:tcpports:- '0-65535'target_tags:- test-ssh-server- staging-ssh-serversource_tags:- test-ssh-clientsproject:test_projectauth_kind:serviceaccountservice_account_file:"/tmp/auth.pem"state:presentnetwork:"{{ my_network2 }}"- name:create a network2google.cloud.gcp_compute_network:name:test_objectauto_create_subnetworks:'true'project:test_projectauth_kind:serviceaccountservice_account_file:"/tmp/auth.pem"state:presentregister:my_network2
1
2
rulesets:- Ansible / GCP # Rules to enforce / GCP.
Solicitar una demostración personalizada
Empezando con Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.