Compare commits
54 Commits
refactor
...
35-pssaas-
| Author | SHA1 | Date |
|---|---|---|
|
|
ec1528cef8 | 2 years ago |
|
|
a39b3f37cc | 2 years ago |
|
|
ee54eeb57d | 2 years ago |
|
|
78b1995557 | 2 years ago |
|
|
22a3668a21 | 2 years ago |
|
|
08afd70476 | 2 years ago |
|
|
47d6ab1588 | 2 years ago |
|
|
ea5f1d6fb7 | 3 years ago |
|
|
ba3cc5f726 | 3 years ago |
|
|
6d99df5945 | 3 years ago |
|
|
29889925d1 | 3 years ago |
|
|
bdefadd090 | 3 years ago |
|
|
8548244a00 | 3 years ago |
|
|
3cf29f95b2 | 3 years ago |
|
|
97b0255c47 | 3 years ago |
|
|
798675466f | 3 years ago |
|
|
6e13d06238 | 3 years ago |
|
|
6e6f80fbc0 | 3 years ago |
|
|
0aded42dac | 3 years ago |
|
|
55f1a9bb1a | 3 years ago |
|
|
8727bff831 | 3 years ago |
|
|
82fbf480ec | 3 years ago |
|
|
721c0ad374 | 3 years ago |
|
|
ce845c9ade | 3 years ago |
|
|
f83d0a1b06 | 3 years ago |
|
|
26592328b9 | 3 years ago |
|
|
3f003048a6 | 3 years ago |
|
|
29c73976f3 | 3 years ago |
|
|
161651f61e | 3 years ago |
|
|
e8738d1cd1 | 3 years ago |
|
|
6da7606ad7 | 3 years ago |
|
|
b3feca922b | 3 years ago |
|
|
dc8de982f0 | 3 years ago |
|
|
3dff549872 | 3 years ago |
|
|
98ba0545e1 | 3 years ago |
|
|
6069d11e1c | 3 years ago |
|
|
353854b790 | 3 years ago |
|
|
fcf47f8d50 | 3 years ago |
|
|
5566213fec | 3 years ago |
|
|
b07123618d | 3 years ago |
|
|
16acdd3061 | 3 years ago |
|
|
9d18e6d9cb | 3 years ago |
|
|
f0c0b91be2 | 3 years ago |
|
|
d2386ac83a | 3 years ago |
|
|
ca186cdd04 | 3 years ago |
|
|
0a7f11d6bf | 3 years ago |
|
|
ccb33b4c64 | 3 years ago |
|
|
3392029b8c | 3 years ago |
|
|
2fb746abae | 3 years ago |
|
|
9e175ca403 | 3 years ago |
|
|
bad8b847ec | 3 years ago |
|
|
87f45b8329 | 3 years ago |
|
|
c7bd13c3ac | 3 years ago |
|
|
421dce3b6c | 3 years ago |
37 changed files with 1071 additions and 170 deletions
@ -0,0 +1,45 @@
|
||||
{ |
||||
"product-id": "jochrist-dev-test-rhbq", |
||||
"is-managed-service": false, |
||||
"cpaas-version": "latest", |
||||
"component-list":[ |
||||
{"build-id":"AZ2HRIN2S7AAC","type":"pnc"}, |
||||
{"build-id":"AZ2JABY727AAA","type":"pnc"}, |
||||
{"build-id":"AZ2JRSQZC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ2Z2WLAK7AAC","type":"pnc"}, |
||||
{"build-id":"AZ4AMGCV27AAC","type":"pnc"}, |
||||
{"build-id":"AZ4A5CSJC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ4B7LCNC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ4CLXF4K7AAC","type":"pnc"}, |
||||
{"build-id":"AZ4CMZK6S7AAC","type":"pnc"}, |
||||
{"build-id":"AZ4C62YEC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ4DGFNK27AAC","type":"pnc"}, |
||||
{"build-id":"AZ4DIMTNS7AAC","type":"pnc"}, |
||||
{"build-id":"AZ4KSFVIC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ4VFB7XK7AAC","type":"pnc"}, |
||||
{"build-id":"AZ4WLXXFC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ5JPS7SK7AAC","type":"pnc"}, |
||||
{"build-id":"AZ5LC7M327AAC","type":"pnc"}, |
||||
{"build-id":"AZ5LQCKAC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ5LW6NGS7AAC","type":"pnc"}, |
||||
{"build-id":"AZ5MHDELK7AAC","type":"pnc"}, |
||||
{"build-id":"AZ5ONFXEC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ5P2MUBK7AAC","type":"pnc"}, |
||||
{"build-id":"AZ5QJ7VPK7AAC","type":"pnc"}, |
||||
{"build-id":"AZ5RPXHM27AAC","type":"pnc"}, |
||||
{"build-id":"AZ5SRVAG27AAC","type":"pnc"}, |
||||
{"build-id":"AZ56V4B4K7AAC","type":"pnc"}, |
||||
{"build-id":"AZ5642PZS7AAC","type":"pnc"}, |
||||
{"build-id":"AZ6ATGHXC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ6XRDLCS7AAC","type":"pnc"}, |
||||
{"build-id":"AZ6YYPCZK7AAC","type":"pnc"}, |
||||
{"build-id":"AZ62QFTQ27AAC","type":"pnc"}, |
||||
{"build-id":"AZ65EUXBC7AAC","type":"pnc"}, |
||||
{"build-id":"AZ65VXKKC7AAC","type":"pnc"}, |
||||
{"build-id":"A2ARB7X3S7AAC","type":"pnc"}, |
||||
{"build-id":"A2ARDJ7MS7AAC","type":"pnc"}, |
||||
{"build-id":"A2ARENQ4S7AAC","type":"pnc"}, |
||||
{"build-id":"A2ARFRPLC7AAC","type":"pnc"} |
||||
] |
||||
} |
||||
|
||||
@ -0,0 +1,8 @@
|
||||
apiVersion: v1 |
||||
data: |
||||
POSTGRESQL_DATABASE: oshwrapper-db |
||||
POSTGRESQL_USER: scanner |
||||
kind: ConfigMap |
||||
metadata: |
||||
name: database-envs-osh |
||||
namespace: psse-scanchain-prod |
||||
@ -0,0 +1,21 @@
|
||||
#oc create route edge --service=osh --dry-run=client -o yaml > edgeroute.yml |
||||
apiVersion: route.openshift.io/v1 |
||||
kind: Route |
||||
metadata: |
||||
creationTimestamp: null |
||||
labels: |
||||
app.kubernetes.io/name: osh |
||||
app.kubernetes.io/version: 1.0.0-SNAPSHOT |
||||
app.openshift.io/runtime: quarkus |
||||
env: prod |
||||
name: osh |
||||
spec: |
||||
port: |
||||
targetPort: http |
||||
tls: |
||||
termination: edge |
||||
to: |
||||
kind: "" |
||||
name: osh |
||||
weight: null |
||||
status: {} |
||||
@ -0,0 +1,44 @@
|
||||
#oc create configmap kerberos-config --from-file=linux-krb5.conf --dry-run=client -o yaml > kerberos-config.yaml |
||||
apiVersion: v1 |
||||
data: |
||||
linux-krb5.conf: | |
||||
includedir /etc/krb5.conf.d/ |
||||
|
||||
# depending on your config, you may wish to uncomment the following: |
||||
# includedir /var/lib/sss/pubconf/krb5.include.d/ |
||||
|
||||
[libdefaults] |
||||
default_realm = IPA.REDHAT.COM |
||||
dns_lookup_realm = true |
||||
dns_lookup_kdc = true |
||||
rdns = false |
||||
dns_canonicalize_hostname = false |
||||
ticket_lifetime = 24h |
||||
forwardable = true |
||||
udp_preference_limit = 1 |
||||
default_ccache_name = KEYRING:persistent:%{uid} |
||||
max_retries = 1 |
||||
kdc_timeout = 1500 |
||||
|
||||
[realms] |
||||
|
||||
REDHAT.COM = { |
||||
default_domain = redhat.com |
||||
dns_lookup_kdc = true |
||||
master_kdc = kerberos.corp.redhat.com |
||||
admin_server = kerberos.corp.redhat.com |
||||
} |
||||
|
||||
IPA.REDHAT.COM = { |
||||
default_domain = ipa.redhat.com |
||||
dns_lookup_kdc = true |
||||
# Trust tickets issued by legacy realm on this host |
||||
auth_to_local = RULE:[1:$1@$0](.*@REDHAT\.COM)s/@.*// |
||||
auth_to_local = DEFAULT |
||||
} |
||||
#DO NOT ADD A [domain_realms] section |
||||
#https://mojo.redhat.com/docs/DOC-1166841 |
||||
kind: ConfigMap |
||||
metadata: |
||||
creationTimestamp: null |
||||
name: kerberos-config |
||||
@ -0,0 +1,36 @@
|
||||
includedir /etc/krb5.conf.d/ |
||||
|
||||
# depending on your config, you may wish to uncomment the following: |
||||
# includedir /var/lib/sss/pubconf/krb5.include.d/ |
||||
|
||||
[libdefaults] |
||||
default_realm = IPA.REDHAT.COM |
||||
dns_lookup_realm = true |
||||
dns_lookup_kdc = true |
||||
rdns = false |
||||
dns_canonicalize_hostname = false |
||||
ticket_lifetime = 24h |
||||
forwardable = true |
||||
udp_preference_limit = 1 |
||||
default_ccache_name = KEYRING:persistent:%{uid} |
||||
max_retries = 1 |
||||
kdc_timeout = 1500 |
||||
|
||||
[realms] |
||||
|
||||
REDHAT.COM = { |
||||
default_domain = redhat.com |
||||
dns_lookup_kdc = true |
||||
master_kdc = kerberos.corp.redhat.com |
||||
admin_server = kerberos.corp.redhat.com |
||||
} |
||||
|
||||
IPA.REDHAT.COM = { |
||||
default_domain = ipa.redhat.com |
||||
dns_lookup_kdc = true |
||||
# Trust tickets issued by legacy realm on this host |
||||
auth_to_local = RULE:[1:$1@$0](.*@REDHAT\.COM)s/@.*// |
||||
auth_to_local = DEFAULT |
||||
} |
||||
#DO NOT ADD A [domain_realms] section |
||||
#https://mojo.redhat.com/docs/DOC-1166841 |
||||
@ -0,0 +1,15 @@
|
||||
apiVersion: v1 |
||||
kind: ServiceAccount |
||||
metadata: |
||||
labels: |
||||
app.kubernetes.io/name: osh |
||||
app.kubernetes.io/version: 1.0.0-SNAPSHOT |
||||
app.openshift.io/runtime: quarkus |
||||
env: prod |
||||
name: osh |
||||
namespace: psse-scanchain-prod |
||||
imagePullSecrets: |
||||
- name: pct-security-osh-wrapper-client-pull-secret |
||||
- name: osh-dockercfg-n2hr7 |
||||
secrets: |
||||
- name: osh-dockercfg-n2hr7 |
||||
@ -0,0 +1,31 @@
|
||||
kind: Role |
||||
apiVersion: rbac.authorization.k8s.io/v1 |
||||
metadata: |
||||
labels: |
||||
app.kubernetes.io/component: tekton |
||||
name: osh-wrapper-tekton |
||||
namespace: psse-scanchain-prod |
||||
rules: |
||||
- apiGroups: |
||||
- tekton.dev |
||||
resources: |
||||
- taskruns |
||||
- pipelineruns |
||||
verbs: |
||||
- create |
||||
- get |
||||
- watch |
||||
- list |
||||
--- |
||||
kind: RoleBinding |
||||
apiVersion: rbac.authorization.k8s.io/v1 |
||||
metadata: |
||||
name: osh-wrapper-tekton-rolebinding |
||||
namespace: psse-scanchain-prod |
||||
roleRef: |
||||
apiGroup: rbac.authorization.k8s.io |
||||
kind: Role |
||||
name: osh-wrapper-tekton |
||||
subjects: |
||||
- kind: ServiceAccount |
||||
name: osh |
||||
@ -0,0 +1,79 @@
|
||||
apiVersion: v1 |
||||
kind: ConfigMap |
||||
metadata: |
||||
annotations: |
||||
name: kerberos-config-osh-client |
||||
namespace: psse-scanchain-prod |
||||
data: |
||||
linux-krb5.conf: | |
||||
includedir /etc/krb5.conf.d/ |
||||
|
||||
# depending on your config, you may wish to uncomment the following: |
||||
# includedir /var/lib/sss/pubconf/krb5.include.d/ |
||||
|
||||
[libdefaults] |
||||
default_realm = IPA.REDHAT.COM |
||||
dns_lookup_realm = true |
||||
dns_lookup_kdc = true |
||||
rdns = false |
||||
dns_canonicalize_hostname = false |
||||
ticket_lifetime = 24h |
||||
forwardable = true |
||||
udp_preference_limit = 1 |
||||
default_ccache_name = FILE:/tmp/krb5cc_%{uid} |
||||
max_retries = 1 |
||||
kdc_timeout = 1500 |
||||
|
||||
[realms] |
||||
|
||||
REDHAT.COM = { |
||||
default_domain = redhat.com |
||||
dns_lookup_kdc = true |
||||
master_kdc = kerberos.corp.redhat.com |
||||
admin_server = kerberos.corp.redhat.com |
||||
} |
||||
|
||||
IPA.REDHAT.COM = { |
||||
default_domain = ipa.redhat.com |
||||
dns_lookup_kdc = true |
||||
# Trust tickets issued by legacy realm on this host |
||||
auth_to_local = RULE:[1:$1@$0](.*@REDHAT\.COM)s/@.*// |
||||
auth_to_local = DEFAULT |
||||
} |
||||
#DO NOT ADD A [domain_realms] section |
||||
#https://mojo.redhat.com/docs/DOC-1166841 |
||||
|
||||
--- |
||||
#oc create configmap osh-client-config --from-file=client.conf --dry-run=client -o yaml > osh-client-config.yaml |
||||
apiVersion: v1 |
||||
kind: ConfigMap |
||||
metadata: |
||||
name: osh-client-config |
||||
namespace: psse-scanchain-prod |
||||
data: |
||||
client.conf: |+ |
||||
# client config file for covscan |
||||
|
||||
# Hub XML-RPC address. |
||||
HUB_URL = "https://cov01.lab.eng.brq2.redhat.com/covscanhub/xmlrpc" |
||||
BREW_URL = "https://brewhub.engineering.redhat.com/brewhub" |
||||
KOJI_URL = "https://koji.fedoraproject.org/kojihub" |
||||
KOJI_PROFILES = "brew,koji" |
||||
|
||||
CIM_SERVER = "cov01.lab.eng.brq2.redhat.com" |
||||
CIM_PORT = "8080" |
||||
|
||||
DEFAULT_MOCKCONFIG = "fedora-rawhide-x86_64" |
||||
|
||||
# Hub authentication method: "krbv", "password", or "gssapi" |
||||
AUTH_METHOD = "krbv" |
||||
KRB_REALM = "IPA.REDHAT.COM" |
||||
|
||||
# Kerberos principal. If commented, default principal obtained by kinit is used. |
||||
KRB_PRINCIPAL = "HTTP/prodsec-scanchain.apps.ocp-c1.prod.psi.redhat.com" |
||||
|
||||
# Kerberos keytab file. |
||||
KRB_KEYTAB = "/kerberos/kerberos-keytab-osh" |
||||
|
||||
# Enables XML-RPC verbose flag |
||||
DEBUG_XMLRPC = 0 |
||||
@ -0,0 +1,28 @@
|
||||
apiVersion: v1 |
||||
kind: PersistentVolumeClaim |
||||
metadata: |
||||
name: osh-client-sources |
||||
namespace: psse-scanchain-prod |
||||
spec: |
||||
accessModes: |
||||
- ReadWriteMany |
||||
resources: |
||||
requests: |
||||
storage: 5Gi |
||||
storageClassName: dynamic-nfs |
||||
volumeMode: Filesystem |
||||
--- |
||||
apiVersion: v1 |
||||
kind: PersistentVolumeClaim |
||||
metadata: |
||||
name: osh-client-source-tars |
||||
namespace: psse-scanchain-prod |
||||
spec: |
||||
accessModes: |
||||
- ReadWriteMany |
||||
resources: |
||||
requests: |
||||
storage: 10Gi |
||||
storageClassName: dynamic-nfs |
||||
volumeMode: Filesystem |
||||
|
||||
@ -0,0 +1,63 @@
|
||||
apiVersion: tekton.dev/v1beta1 |
||||
kind: Task |
||||
metadata: |
||||
name: osh-scan-task |
||||
spec: |
||||
stepTemplate: |
||||
env: |
||||
- name: "HOME" |
||||
value: "/tekton/home" |
||||
params: |
||||
- name: buildId |
||||
type: string |
||||
- name: scanProfile |
||||
type: string |
||||
|
||||
volumes: |
||||
- name: osh-client-kerb-vol |
||||
secret: |
||||
defaultMode: 384 |
||||
optional: false |
||||
secretName: kerberos-keytab-osh |
||||
|
||||
- name: osh-client-kerb-config-vol |
||||
configMap: |
||||
name: kerberos-config-osh-client |
||||
items: |
||||
- key: linux-krb5.conf |
||||
path: linux-krb5.conf |
||||
defaultMode: 384 |
||||
optional: false |
||||
|
||||
- name: osh-client-config-vol |
||||
configMap: |
||||
name: osh-client-config |
||||
items: |
||||
- key: client.conf |
||||
path: client.conf |
||||
optional: false |
||||
|
||||
steps: |
||||
- name: perform-buildid-scan |
||||
image: quay.io/pct-security/osh-wrapper-client:latest |
||||
workingDir: /home/covscan |
||||
volumeMounts: |
||||
- name: osh-client-kerb-vol |
||||
mountPath: /kerberos |
||||
readOnly: true |
||||
|
||||
- name: osh-client-config-vol |
||||
mountPath: /etc/osh/client.conf |
||||
readOnly: true |
||||
subPath: client.conf |
||||
|
||||
- name: osh-client-kerb-config-vol |
||||
mountPath: /etc/krb5.conf |
||||
readOnly: true |
||||
subPath: linux-krb5.conf |
||||
|
||||
script: | |
||||
#!/bin/bash |
||||
echo $(params.buildId) |
||||
echo $(params.scanProfile) |
||||
covscan mock-build -p $(params.scanProfile) --brew-build $(params.buildId) |
||||
@ -0,0 +1,104 @@
|
||||
apiVersion: tekton.dev/v1beta1 |
||||
kind: Task |
||||
metadata: |
||||
name: osh-scan-scm-task |
||||
spec: |
||||
stepTemplate: |
||||
env: |
||||
- name: "HOME" |
||||
value: "/tekton/home" |
||||
|
||||
params: |
||||
- name: repo-url |
||||
type: string |
||||
description: The SCMURL |
||||
|
||||
- name: revision |
||||
type: string |
||||
description: The revision or tag |
||||
|
||||
- name: mock-build-params |
||||
type: string |
||||
description: Parameters pushed to mock build |
||||
default: "snyk-only-unstable --tarball-build-script=:" |
||||
|
||||
- name: archive-name |
||||
type: string |
||||
description: The name of the git archive file |
||||
default: $(context.taskRun.uid).tar.gz |
||||
|
||||
- name: tarball-storage-dir |
||||
type: string |
||||
description: What directory the scan tar gz will be put into |
||||
default: /workspace/source-tars/$(context.taskRun.name) |
||||
|
||||
- name: working-dir |
||||
type: string |
||||
description: Working directory for the task |
||||
default: /home/covscan |
||||
|
||||
workspaces: |
||||
- name: source-tars |
||||
description: This workspace contains our source tar gzips for covscan and is semi-persistant |
||||
- name: ssl-ca-directory |
||||
description: Location of CA bundle for ssl verification with internal services |
||||
|
||||
|
||||
volumes: |
||||
- name: osh-client-kerb-vol |
||||
secret: |
||||
defaultMode: 384 |
||||
optional: false |
||||
secretName: kerberos-keytab-osh |
||||
|
||||
- name: osh-client-kerb-config-vol |
||||
configMap: |
||||
name: kerberos-config-osh-client |
||||
items: |
||||
- key: linux-krb5.conf |
||||
path: linux-krb5.conf |
||||
defaultMode: 384 |
||||
optional: false |
||||
|
||||
- name: osh-client-config-vol |
||||
configMap: |
||||
name: osh-client-config |
||||
items: |
||||
- key: client.conf |
||||
path: client.conf |
||||
optional: false |
||||
|
||||
steps: |
||||
- name: perform-osh-scm-scan |
||||
image: quay.io/pct-security/osh-wrapper-client:latest |
||||
workingDir: $(params.working-dir) |
||||
|
||||
volumeMounts: |
||||
- name: osh-client-kerb-vol |
||||
mountPath: /kerberos |
||||
readOnly: true |
||||
|
||||
- name: osh-client-config-vol |
||||
mountPath: /etc/osh/client.conf |
||||
readOnly: true |
||||
subPath: client.conf |
||||
|
||||
- name: osh-client-kerb-config-vol |
||||
mountPath: /etc/krb5.conf |
||||
readOnly: true |
||||
subPath: linux-krb5.conf |
||||
|
||||
script: | |
||||
#!/bin/bash |
||||
set -x |
||||
echo $(params.working-dir) |
||||
echo $(params.repo-url) |
||||
echo $(params.revision) |
||||
echo $(params.mock-build-params) |
||||
echo $(params.archive-name) |
||||
git clone -v $(params.repo-url) -b $(params.revision) |
||||
git --git-dir=$(basename $(params.repo-url) .git)/.git archive --format=tar.gz HEAD -o $(params.working-dir)/$(params.archive-name) |
||||
mkdir $(params.tarball-storage-dir) |
||||
cp $(params.working-dir)/$(params.archive-name) $(params.tarball-storage-dir)/ |
||||
|
||||
covscan mock-build $(params.mock-build-params) $(params.working-dir)/$(params.archive-name) |
||||
@ -0,0 +1,23 @@
|
||||
apiVersion: batch/v1 |
||||
kind: CronJob |
||||
metadata: |
||||
name: tekton-terminator |
||||
namespace: pct-security-tooling |
||||
spec: |
||||
schedule: "*/50 * * * *" |
||||
concurrencyPolicy: Forbid |
||||
backoffLimit: 2 |
||||
jobTemplate: |
||||
spec: |
||||
template: |
||||
spec: |
||||
serviceAccountName: osh-wrapper-tekton-terminator-sa |
||||
containers: |
||||
- name: tekton-cleanup |
||||
image: quay.io/openshift-pipeline/openshift-pipelines-cli-tkn:1.11 |
||||
imagePullPolicy: IfNotPresent |
||||
command: |
||||
- /bin/sh |
||||
- -c |
||||
- tkn pipelinerun delete --keep 10 -f && tkn taskrun delete --keep 40 -f |
||||
restartPolicy: Never |
||||
@ -0,0 +1,43 @@
|
||||
apiVersion: v1 |
||||
kind: ServiceAccount |
||||
metadata: |
||||
namespace: pct-security-tooling |
||||
name: osh-wrapper-tekton-terminator-sa |
||||
labels: |
||||
app.kubernetes.io/name: osh-wrapper-tekton-terminator |
||||
env: stage |
||||
imagePullSecrets: |
||||
- name: pct-security-osh-wrapper-client-pull-secret |
||||
--- |
||||
kind: Role |
||||
apiVersion: rbac.authorization.k8s.io/v1 |
||||
metadata: |
||||
name: osh-wrapper-tekton-terminator |
||||
labels: |
||||
app.kubernetes.io/component: tekton |
||||
namespace: pct-security-tooling |
||||
rules: |
||||
- apiGroups: |
||||
- tekton.dev |
||||
resources: |
||||
- taskruns |
||||
- pipelineruns |
||||
verbs: |
||||
- get |
||||
- list |
||||
- delete |
||||
- update |
||||
--- |
||||
kind: RoleBinding |
||||
apiVersion: rbac.authorization.k8s.io/v1 |
||||
metadata: |
||||
name: osh-wrapper-tekton-terminator-rolebinding |
||||
namespace: pct-security-tooling |
||||
roleRef: |
||||
apiGroup: rbac.authorization.k8s.io |
||||
kind: Role |
||||
name: osh-wrapper-tekton-terminator |
||||
subjects: |
||||
- kind: ServiceAccount |
||||
name: osh-wrapper-tekton-terminator-sa |
||||
|
||||
@ -1,4 +1,35 @@
|
||||
package com.redhat.pctsec.model.api.request; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
||||
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription; |
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
||||
import jakarta.validation.Valid; |
||||
import jakarta.validation.constraints.NotNull; |
||||
import jakarta.validation.constraints.Size; |
||||
|
||||
import java.util.List; |
||||
import java.util.Set; |
||||
|
||||
|
||||
public class scanChain { |
||||
|
||||
@JsonProperty("product_name") |
||||
@JsonPropertyDescription("The product name associated with the scan.") |
||||
@NotNull |
||||
public String productName; |
||||
|
||||
@JsonProperty("urls") |
||||
@JsonDeserialize(as = java.util.LinkedHashSet.class) |
||||
@JsonPropertyDescription("List of source urls to be scanned") |
||||
@Size(min = 1) |
||||
@Valid |
||||
@NotNull |
||||
public Set<scanChainGit> urls; |
||||
|
||||
@JsonProperty("requestor") |
||||
@JsonPropertyDescription("The requesting user") |
||||
@NotNull |
||||
public String requestor; |
||||
} |
||||
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
package com.redhat.pctsec.model.api.request; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
||||
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
import jakarta.validation.constraints.NotNull; |
||||
|
||||
import java.net.URI; |
||||
|
||||
|
||||
public class scanChainGit { |
||||
|
||||
|
||||
private URI repo; |
||||
private String ref; |
||||
public scanChainGit(@NotNull URI repo, @NotNull String ref) { |
||||
this.repo = repo; |
||||
this.ref = ref; |
||||
} |
||||
|
||||
|
||||
@NotNull |
||||
@JsonProperty("url") |
||||
public URI getRepo() { |
||||
return this.repo; |
||||
} |
||||
|
||||
@NotNull |
||||
@JsonProperty("branch") |
||||
public String getRef() { |
||||
|
||||
return this.ref; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,12 @@
|
||||
package com.redhat.pctsec.model.api.service; |
||||
import jakarta.ws.rs.*; |
||||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; |
||||
import org.jboss.pnc.dto.Build; |
||||
|
||||
@Path("pnc-rest/v2/builds") |
||||
@RegisterRestClient |
||||
public interface AltPncService { |
||||
@GET |
||||
@Path("{id}") |
||||
Build getBuild(@PathParam("id") String id); |
||||
} |
||||
@ -0,0 +1,49 @@
|
||||
package com.redhat.pctsec.rest.v1alpha1; |
||||
import jakarta.ws.rs.core.Application; |
||||
import org.eclipse.microprofile.openapi.annotations.Components; |
||||
import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; |
||||
import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType; |
||||
import org.eclipse.microprofile.openapi.annotations.info.Contact; |
||||
import org.eclipse.microprofile.openapi.annotations.info.Info; |
||||
import org.eclipse.microprofile.openapi.annotations.info.License; |
||||
import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement; |
||||
import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme; |
||||
import org.eclipse.microprofile.openapi.annotations.tags.Tag; |
||||
|
||||
@OpenAPIDefinition( |
||||
tags = { |
||||
//@Tag(name="widget", description="Widget operations."),
|
||||
//@Tag(name="gasket", description="Operations related to gaskets")
|
||||
}, |
||||
info = @Info( |
||||
title="Example API", |
||||
version = "1.0.1", |
||||
contact = @Contact( |
||||
name = "Example API Support", |
||||
url = "http://exampleurl.com/contact", |
||||
email = "techsupport@example.com"), |
||||
license = @License( |
||||
name = "Apache 2.0", |
||||
url = "https://www.apache.org/licenses/LICENSE-2.0.html")), |
||||
components = @Components( |
||||
securitySchemes = { |
||||
@SecurityScheme( |
||||
securitySchemeName = "Kerberos", |
||||
type = SecuritySchemeType.HTTP, |
||||
scheme = "Negotiate" |
||||
//bearerFormat = "JWT"
|
||||
), |
||||
@SecurityScheme( |
||||
securitySchemeName = "basic", |
||||
type = SecuritySchemeType.HTTP, |
||||
scheme = "basic" |
||||
) |
||||
} |
||||
), |
||||
security = { |
||||
@SecurityRequirement(name = "Kerberos"), |
||||
@SecurityRequirement(name = "basic") |
||||
} |
||||
) |
||||
public class OshWrapperApiApplication extends Application { |
||||
} |
||||
@ -0,0 +1,19 @@
|
||||
package com.redhat.pctsec.model.test; |
||||
|
||||
import com.redhat.pctsec.model.PNCBuild; |
||||
import io.quarkus.test.junit.QuarkusTest; |
||||
import jakarta.inject.Inject; |
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
@QuarkusTest |
||||
public class PNCBuildTest { |
||||
|
||||
|
||||
|
||||
@Test |
||||
public void testBuildFetch(){ |
||||
PNCBuild pb = new PNCBuild("AZAQZSPFDRQAA"); |
||||
System.out.println(pb.SCMURL()); |
||||
System.out.println(pb.revision()); |
||||
} |
||||
} |
||||
@ -1,5 +1,6 @@
|
||||
package com.redhat.pctsec.model.osh; |
||||
package com.redhat.pctsec.model.test; |
||||
|
||||
import com.redhat.pctsec.model.osh.paramMapper; |
||||
import io.quarkus.test.junit.QuarkusTest; |
||||
import jakarta.inject.Inject; |
||||
import org.junit.jupiter.api.Test; |
||||
Loading…
Reference in new issue