Descrizione
kubewarden-controller is a Kubernetes controller that allows you to dynamically register Kubewarden admission policies. The policy group feature, added to by the 1.17.0 release. By being namespaced, the AdmissionPolicyGroup has a well constrained impact on cluster resources. Hence, it’s considered safe to allow non-admin users to create and manage these resources in the namespaces they own. Kubewarden policies can be allowed to query the Kubernetes API at evaluation time; these types of policies are called “context aware“. Context aware policies can perform list and get operations against a Kubernetes cluster. The queries are done using the ServiceAccount of the Policy Server instance that hosts the policy. That means that access to the cluster is determined by the RBAC rules that apply to that ServiceAccount. The AdmissionPolicyGroup CRD allowed the deployment of context aware policies. This could allow an attacker to obtain information about resources that are out of their reach, by leveraging a higher access to the cluster granted to the ServiceAccount token used to run the policy. The impact of this vulnerability depends on the privileges that have been granted to the ServiceAccount used to run the Policy Server and assumes that users are using the recommended best practices of keeping the Policy Server's ServiceAccount least privileged. By default, the Kubewarden helm chart grants access to the following resources (cluster wide) only: Namespace, Pod, Deployment and Ingress. This vulnerability is fixed in 1.21.0.
Tipo di vulnerabilità
CWE-285
Autorizzazione impropria
Il prodotto non esegue, o esegue in modo errato, il controllo delle autorizzazioni quando un soggetto tenta di accedere a una risorsa o di compiere un’azione.
Impatto sui sistemi
| Ambito | Impatto |
| Riservatezza |
Leggere i dati dell’applicazione, Leggere file o cartelle |
| Integrità |
Modificare i dati dell’applicazione, Modificare file o cartelle |
| Controllo degli accessi |
Ottenere privilegi o assumere un’altra identità, Eseguire codice o comandi non autorizzati |
Come si previene
Architettura e progettazione
Dividi il prodotto in aree anonime, normali, privilegiate e amministrative. Riduci la superficie di attacco associando con cura ruoli, dati e funzioni, e usa un controllo degli accessi basato sui ruoli (RBAC) per far rispettare i ruoli nei punti giusti. Questo approccio non protegge dall’accesso «orizzontale»: non impedisce a un utente di attaccare altri utenti con lo stesso ruolo.
Architettura e progettazione
Ensure that you perform access control checks related to your business logic. These checks may be different than the access control checks that you apply to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor.
Architettura e progettazione · Librerie o framework
Usa una libreria o un framework collaudato che non permetta questo tipo di errore o che renda più facile evitarlo. Per esempio, valuta framework di autorizzazione come JAAS Authorization Framework e la funzione Access Control di OWASP ESAPI.
Architettura e progettazione
Nelle applicazioni web, verifica che il controllo degli accessi sia applicato correttamente lato server su ogni pagina: gli utenti non devono poter raggiungere funzioni o informazioni non autorizzate semplicemente richiedendo la pagina direttamente. Un modo per farlo è non mettere in cache le pagine con informazioni sensibili e consentirne l’accesso solo alle richieste accompagnate da un token di sessione attivo e autenticato, associato a un utente con i permessi necessari.
Configurazione del sistema · Installazione
Usa le funzioni di controllo degli accessi del sistema operativo e del server e definisci di conseguenza le liste di controllo degli accessi (ACL), partendo da una politica di negazione predefinita.
Tutte le 1.223 CVE di tipo CWE-285, con andamento e prevenzione