File tree 1 file changed +14
-4
lines changed
sig-security-tooling/cve-feed/hack
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
+ import copy
17
18
import json
18
19
import requests
19
20
from datetime import datetime
@@ -91,10 +92,19 @@ def getCVEStatus(state, state_reason):
91
92
if len (title ) > 0 :
92
93
cve ['summary' ] = title [- 1 ]
93
94
if len (title ) > 1 :
94
- cve_id = title [0 ]
95
- cve ['id' ] = cve_id
96
- cve ['external_url' ] = f'https://www.cve.org/cverecord?id={ cve_id } '
97
- cve ['_kubernetes_io' ]['google_group_url' ] = f'https://groups.google.com/g/kubernetes-announce/search?q={ cve_id } '
95
+ cve_ids = [cve_id .strip () for cve_id in title [0 ].split (',' )]
96
+ first_cve_id = cve_ids [0 ]
97
+ cve ['id' ] = first_cve_id
98
+ cve ['external_url' ] = f'https://www.cve.org/cverecord?id={ first_cve_id } '
99
+ cve ['_kubernetes_io' ]['google_group_url' ] = f'https://groups.google.com/g/kubernetes-announce/search?q={ first_cve_id } '
100
+
101
+ # Add additional entries for any remaining CVE IDs
102
+ for additional_cve_id in cve_ids [1 :]:
103
+ additional_cve = copy .deepcopy (cve )
104
+ additional_cve ['id' ] = additional_cve_id
105
+ additional_cve ['external_url' ] = f'https://www.cve.org/cverecord?id={ additional_cve_id } '
106
+ additional_cve ['_kubernetes_io' ]['google_group_url' ] = f'https://groups.google.com/g/kubernetes-announce/search?q={ additional_cve_id } '
107
+ cve_list .append (additional_cve )
98
108
cve_list .append (cve )
99
109
100
110
feed_envelope ['items' ] = cve_list
You can’t perform that action at this time.
0 commit comments