Skip to content

Commit a2e9f8e

Browse files
authored
Merge branch 'main' into renovate/major-all
2 parents 15eccbf + d45c0b9 commit a2e9f8e

File tree

10 files changed

+622
-67
lines changed

10 files changed

+622
-67
lines changed

konf/raw-site-staging.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
kind: Service
3+
apiVersion: v1
4+
metadata:
5+
name: ubuntu-com-security-api
6+
spec:
7+
selector:
8+
app: ubuntu-com-security-api
9+
ports:
10+
- name: http
11+
protocol: TCP
12+
port: 80
13+
targetPort: http
14+
15+
---
16+
kind: Deployment
17+
apiVersion: apps/v1
18+
metadata:
19+
name: ubuntu-com-security-api
20+
spec:
21+
replicas: 2
22+
selector:
23+
matchLabels:
24+
app: ubuntu-com-security-api
25+
template:
26+
metadata:
27+
labels:
28+
app: ubuntu-com-security-api
29+
spec:
30+
affinity:
31+
podAntiAffinity:
32+
requiredDuringSchedulingIgnoredDuringExecution:
33+
- labelSelector:
34+
matchExpressions:
35+
- key: app
36+
operator: In
37+
values:
38+
- ubuntu-com-security-api
39+
topologyKey: "kubernetes.io/hostname"
40+
containers:
41+
- name: ubuntu-com-security-api
42+
image: prod-comms.docker-registry.canonical.com/ubuntu-com-security-api:${TAG_TO_DEPLOY}
43+
44+
ports:
45+
- name: http
46+
containerPort: 80
47+
48+
env:
49+
- name: TALISKER_NETWORKS
50+
value: 10.0.0.0/8
51+
52+
- name: SECRET_KEY
53+
valueFrom:
54+
secretKeyRef:
55+
key: ubuntu-com-security-api
56+
name: secret-keys
57+
58+
- name: HTTP_PROXY
59+
value: "http://squid.internal:3128/"
60+
61+
- name: HTTPS_PROXY
62+
value: "http://squid.internal:3128/"
63+
64+
- name: NO_PROXY
65+
value: ".internal,ubuntu.com,.ubuntu.com,snapcraft.io,.snapcraft.io,jujucharms.com,.jujucharms.com,maas.io,.maas.io,conjure-up.io,.conjure-up.io,netplan.io,.netplan.io,canonical.com,.canonical.com,launchpad.net,.launchpad.net,linuxcontainers.org,.linuxcontainers.org,cloud-init.io,.cloud-init.io,vanillaframework.io,.vanillaframework.io,anbox-cloud.io,.anbox-cloud.io,juju.is,.juju.is,dqlite.io,.dqlite.io,charmhub.io,.charmhub.io"
66+
67+
- name: DATABASE_URL
68+
valueFrom:
69+
secretKeyRef:
70+
key: database_url
71+
name: usn-db-url
72+
73+
- name: SENTRY_DSN
74+
value: "https://[email protected]//48"
75+
76+
readinessProbe:
77+
httpGet:
78+
path: /_status/check
79+
port: 80
80+
periodSeconds: 5
81+
timeoutSeconds: 3
82+
83+
resources:
84+
limits:
85+
memory: 128Mi

konf/raw-site.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
kind: Service
43
apiVersion: v1
54
metadata:
@@ -14,7 +13,6 @@ spec:
1413
targetPort: http
1514

1615
---
17-
1816
kind: Deployment
1917
apiVersion: apps/v1
2018
metadata:
@@ -41,7 +39,7 @@ spec:
4139
topologyKey: "kubernetes.io/hostname"
4240
containers:
4341
- name: ubuntu-com-security-api
44-
image: prod-comms.docker-registry.canonical.com/ubuntu-com-security-api:${TAG_TO_DEPLOY}
42+
image: prod-comms.ps5.docker-registry.canonical.com/ubuntu-com-security-api:${TAG_TO_DEPLOY}
4543

4644
ports:
4745
- name: http
@@ -84,4 +82,4 @@ spec:
8482

8583
resources:
8684
limits:
87-
memory: 512Mi
85+
memory: 1024Mi
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""empty message
2+
3+
Revision ID: f18a0bd8a809
4+
Revises: d1b71925b9e3
5+
Create Date: 2023-04-25 17:07:19.259029
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = 'f18a0bd8a809'
14+
down_revision = 'd1b71925b9e3'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
op.add_column('cve', sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True))
21+
22+
23+
def downgrade():
24+
op.drop_column('cve', 'updated_at')

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "LGPL v3",
44
"scripts": {
55
"clean": "rm -rf node_modules yarn-error.log css static/css *.log *.sqlite _site/ build/ .jekyll-metadata .bundle",
6-
"format-python": "black --line-length 79 webapp scripts",
6+
"format-python": "black --line-length 79 webapp tests scripts",
77
"lint-python": "flake8 webapp tests && black --check --line-length 79 webapp tests",
88
"serve": "./entrypoint 0.0.0.0:${PORT}",
99
"start": "yarn run serve",

tests/fixtures/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ def make_models():
2929
description="",
3030
ubuntu_description="",
3131
notes={},
32-
priority="unknown",
32+
priority="critical",
3333
cvss3=2.3,
3434
impact={},
35-
codename="",
35+
codename="test_name",
3636
mitigation="",
3737
references={},
3838
patches={},

tests/fixtures/payloads.py

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
This CVE is missing a status field. It should not show up
3+
in get requests for all CVEs,but should show up when you
4+
make a get request by its CVE id
5+
"""
16
cve1 = {
27
"id": "CVE-9999-0001",
38
"codename": "testcodename",
@@ -40,10 +45,13 @@
4045
"impactScore": 3.6,
4146
}
4247
},
48+
"priority": "critical",
49+
"published": "2020-08-01 12:42:54",
4350
}
4451

4552
cve2 = {
4653
"id": "CVE-9999-0002",
54+
"codename": "testcodename2",
4755
"packages": [
4856
{
4957
"debian": "https://tracker.debian.org/pkg/test_package_2",
@@ -62,6 +70,111 @@
6270
),
6371
}
6472
],
73+
"published": "2020-11-01 12:42:54",
74+
"priority": "high",
75+
"status": "active",
76+
}
77+
78+
cve3 = {
79+
"id": "CVE-9999-0003",
80+
"codename": "testcodename3",
81+
"packages": [
82+
{
83+
"debian": "https://tracker.debian.org/pkg/test_package_3",
84+
"name": "test_package_3",
85+
"source": "https://ubuntu.com/security/cve?package=test_package_3",
86+
"statuses": [
87+
{
88+
"description": "",
89+
"release_codename": "testrelease",
90+
"status": "released",
91+
}
92+
],
93+
"ubuntu": (
94+
"https://packages.ubuntu.com/search?suite=all&section=all&arch"
95+
"=any&searchon=sourcenames&keywords=test_package_3"
96+
),
97+
}
98+
],
99+
"priority": "medium",
100+
"published": "2019-12-01 12:42:54",
101+
"status": "active",
102+
}
103+
104+
cve4 = {
105+
"id": "CVE-9999-0004",
106+
"codename": "testcodename4",
107+
"packages": [
108+
{
109+
"debian": "https://tracker.debian.org/pkg/test_package_4",
110+
"name": "test_package_3",
111+
"source": "https://ubuntu.com/security/cve?package=test_package_4",
112+
"statuses": [
113+
{
114+
"description": "",
115+
"release_codename": "testrelease",
116+
"status": "released",
117+
}
118+
],
119+
"ubuntu": (
120+
"https://packages.ubuntu.com/search?suite=all&section=all&arch"
121+
"=any&searchon=sourcenames&keywords=test_package_4"
122+
),
123+
}
124+
],
125+
"priority": "medium",
126+
"published": "2022-12-01 12:42:54",
127+
"status": "active",
128+
}
129+
130+
cve5 = {
131+
"id": "CVE-9999-0005",
132+
"packages": [
133+
{
134+
"debian": "https://tracker.debian.org/pkg/test_package_5",
135+
"name": "test_package_3",
136+
"source": "https://ubuntu.com/security/cve?package=test_package_5",
137+
"statuses": [
138+
{
139+
"description": "",
140+
"release_codename": "testrelease",
141+
"status": "released",
142+
}
143+
],
144+
"ubuntu": (
145+
"https://packages.ubuntu.com/search?suite=all&section=all&arch"
146+
"=any&searchon=sourcenames&keywords=test_package_5"
147+
),
148+
}
149+
],
150+
"published": "2020-12-01 12:42:54",
151+
"priority": "low",
152+
"status": "active",
153+
}
154+
155+
cve6 = {
156+
"id": "CVE-9999-0006",
157+
"packages": [
158+
{
159+
"debian": "https://tracker.debian.org/pkg/test_package_6",
160+
"name": "test_package_3",
161+
"source": "https://ubuntu.com/security/cve?package=test_package_6",
162+
"statuses": [
163+
{
164+
"description": "",
165+
"release_codename": "testrelease",
166+
"status": "released",
167+
}
168+
],
169+
"ubuntu": (
170+
"https://packages.ubuntu.com/search?suite=all&section=all&arch"
171+
"=any&searchon=sourcenames&keywords=test_package_6"
172+
),
173+
}
174+
],
175+
"published": "2020-12-01 12:42:54",
176+
"priority": "negligible",
177+
"status": "active",
65178
}
66179

67180
notice = {

0 commit comments

Comments
 (0)