Skip to content

Commit

Permalink
Merge pull request #361 from HXSecurity/develop
Browse files Browse the repository at this point in the history
beta
  • Loading branch information
tscuite authored Jul 17, 2023
2 parents 0ca9da9 + e4b19f0 commit 6f61c42
Show file tree
Hide file tree
Showing 35 changed files with 1,945 additions and 680 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# base api
VUE_APP_BASE_API = '/api/v1'
VUE_APP_BASE_API_V2 = '/api/v2'
VUE_APP_BASE_SCA_V2 = '/api/sca/v2'
VUE_APP_BASE_SCA_V1 = '/api/sca/v1'
VUE_APP_UPLOAD = '/upload'
VUE_APP_OPEN_API = '/openapi'
VUE_APP_ATOM_API = '/atom-webapi'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,27 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: |
registry.cn-hongkong.aliyuncs.com/huoxian_pub/dongtai-web-test:1.0.${{github.run_number}}-${{ steps.version.outputs.GITHUB_REF }}
registry.cn-hongkong.aliyuncs.com/huoxian_pub/dongtai-web-test:latest-${{ steps.version.outputs.GITHUB_REF }}
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-web:${{ steps.version.outputs.GITHUB_REF }}-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-web:${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
- name: Set the value
id: release
run: |
if [ ${{ steps.version.outputs.GITHUB_REF }} = develop ] ; then echo "helm_ns=test" >> $GITHUB_ENV; echo "helm_mysql=test" >> $GITHUB_ENV
elif [ ${{ steps.version.outputs.GITHUB_REF }} = beta ] ; then echo "helm_ns=beta" >> $GITHUB_ENV; echo "helm_mysql=beta" >> $GITHUB_ENV
else echo "helm_ns=main" >> $GITHUB_ENV ; echo "helm_mysql=temp" >> $GITHUB_ENV ;fi
- uses: actions/checkout@master
- name: deploy to cluster
uses: wahyd4/kubectl-helm-action@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_TEST_DATA }}
with:
args: |
if [ ${{ steps.version.outputs.GITHUB_REF }} = beta ] ; then find deploy/deploy-eks-iast-saas-web-test.yml -type f -exec sed -i 's/iast-test/iast-beta/g' {} \;
elif [ ${{ steps.version.outputs.GITHUB_REF }} = develop ] ; then echo 'testing !!!'
else find deploy/deploy-eks-iast-saas-web-test.yml -type f -exec sed -i 's/iast-test/iast-main/g' {} \; ;fi
find deploy/deploy-eks-iast-saas-web-test.yml -type f -exec sed -i 's/VERSION/1.0.${{github.run_number}}-${{ steps.version.outputs.GITHUB_REF }}/g' {} \;
ls deploy/deploy-eks-iast-saas-web-test.yml | xargs -I {} kubectl apply -f {}
git clone https://github.com/HXSecurity/DongTai.git
helm upgrade --install huoxian --create-namespace -n iast-${{ env.helm_ns }} ./DongTai/deploy/kubernetes/helm/ \
--set develop.agentZip=${{ env.helm_ns }} --set sca.sca_token=${{ secrets.TOKEN_SCA }} --set usb.usb_token=${{ secrets.TOKEN_SCA }} --set mysql.host=iast-mysql-${{ env.helm_mysql }}.huoxian.cn \
--set tag=${{ steps.version.outputs.GITHUB_REF }}-latest --set build.web_number=iast${{github.run_number}} --values https://charts.dongtai.io/devops.yaml
- name: finish build
uses: joelwmale/webhook-action@master
with:
Expand Down
34 changes: 0 additions & 34 deletions deploy/deploy-eks-iast-saas-web-dev.yml

This file was deleted.

38 changes: 0 additions & 38 deletions deploy/deploy-eks-iast-saas-web-prod.yml

This file was deleted.

44 changes: 0 additions & 44 deletions deploy/deploy-eks-iast-saas-web-test.yml

This file was deleted.

1 change: 1 addition & 0 deletions src/config/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default {
scaList: 'Component management list',
scaDetail: 'Component management details',
scanDetail: 'Scan vulnerability details',
scalistDetail: 'Scan details',
changeLogo: 'Site Identity',
setting: 'Settings',
agentManage: 'Agent',
Expand Down
3 changes: 2 additions & 1 deletion src/config/lang/zh_cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ export default {
vulnDetail: '应用漏洞详情',
sca: '组件',
scaList: '组件管理列表',
scalistDetail: '组件详情',
scaDetail: '组件管理详情',
scanDetail: '扫描漏洞详情',
setting: '系统配置',
setting: '系统设置',
changeLogo: '品牌配置',
agentManage: 'Agent',
sensitive: '敏感信息',
Expand Down
27 changes: 27 additions & 0 deletions src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ const routes: Array<RouteConfig> = [
},
component: () => import('@/views/sca/ScaList.vue'),
},
{
path: 'scalistDetail/:page/:id',
name: 'scalistDetail/:page/:id',
meta: {
i18n: 'menu.scalistDetail',
name: i18n.t('menu.vulnDetail'),
},
component: () => import('@/views/sca/ScaDialog.vue'),
},
],
},
{
Expand Down Expand Up @@ -561,6 +570,15 @@ const adminRoutes: Array<RouteConfig> = [
},
component: () => import('@/views/sca/ScaList.vue'),
},
{
path: 'scalistDetail/:page/:id',
name: 'scalistDetail/:page/:id',
meta: {
i18n: 'menu.scalistDetail',
name: i18n.t('menu.vulnDetail'),
},
component: () => import('@/views/sca/ScaDialog.vue'),
},
],
},
{
Expand Down Expand Up @@ -965,6 +983,15 @@ const userRoutes: Array<RouteConfig> = [
},
component: () => import('@/views/sca/ScaList.vue'),
},
{
path: 'scalistDetail/:page/:id',
name: 'scalistDetail/:page/:id',
meta: {
i18n: 'menu.scalistDetail',
name: i18n.t('menu.scalistDetail'),
},
component: () => import('@/views/sca/ScaDialog.vue'),
},
],
},
{
Expand Down
10 changes: 1 addition & 9 deletions src/services/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ interface ProjectListParams {
name: string
}

interface ProjectAddParams {
pid?: number | string
name: string
mode: string
agent_ids: string
scan_id: number
}

export default () =>
new (class {
// 项目列表
Expand Down Expand Up @@ -43,7 +35,7 @@ export default () =>
}

//新增项目 编辑
projectAdd(params: ProjectAddParams): Promise<iResponse> {
projectAdd(params: any): Promise<iResponse> {
return request.post('/project/add', params)
}

Expand Down
76 changes: 64 additions & 12 deletions src/services/sca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,81 @@ export default () =>
})
}

assetVuls(aggr_id: any): Promise<iResponse> {
return request.get('/asset_vuls/' + aggr_id, {
baseURL: '/openapi/sca/v1',
})
assetVuls(row: any): Promise<iResponse> {
return request.get(
`/package_vuls/${row.language_id}/${row.package_name}/${row.package_version}?page=${row.page}&page_size=${row.page_size}`,
{
baseURL: '/api/sca/v2',
}
)
}

assetProjects(aggr_id: any): Promise<iResponse> {
return request.get('/asset_projects/' + aggr_id, {
baseURL: '/openapi/sca/v1',
assetProjects(row: any): Promise<iResponse> {
if (row.project_id) {
return request.get(
`/package/${row.language_id}/${row.package_name}/${row.package_version}/relation_projects?page=${row.page}&page_size=${row.page_size}&project_id=${row.project_id}`,
{
baseURL: '/api/sca/v2',
}
)
}
return request.get(
`/package/${row.language_id}/${row.package_name}/${row.package_version}/relation_projects?page=${row.page}&page_size=${row.page_size}`,
{
baseURL: '/api/sca/v2',
}
)
}
assetProjectId(row: any): Promise<iResponse> {
return request.get(
`/package/${row.language_id}/${row.package_name}/${row.package_version}/relation_project/${row.project_id}`,
{
baseURL: '/api/sca/v2',
}
)
}
vulPackId(row: any): Promise<iResponse> {
return request.get(`/package_vul/${row.vul_id}`, {
baseURL: '/api/sca/v2',
})
}
// scaList
// scaList /api/sca/v2/package
// scaList(data: any): Promise<iResponse> {
// return request.post('/scas', data)
// }
scaList(data: any): Promise<iResponse> {
return request.post('/scas', data)
return request.post('/package/', data, {
baseURL: '/api/sca/v2',
})
}

// scaSummary
// scaSummary(data: any): Promise<iResponse> {
// return request.post('/sca/summary', data)
// }
scaSummary(data: any): Promise<iResponse> {
return request.post('/sca/summary', data)
if (data.project_id) {
return request.get(
`/package_summary?project_id=${data.project_id}&project_version_id=${data.version_id}&keyword=${data.keyword}`,
{
baseURL: '/api/sca/v2',
// baseURL: '/openapi/sca/v2',
}
)
}
return request.get(`/package_summary?keyword=${data.keyword}`, {
baseURL: '/api/sca/v2',
// baseURL: '/openapi/sca/v2',
})
}

// getScaDetail
getScaDetail(id: number): Promise<iResponse> {
return request.get(`/sca/${id}`)
getScaDetail(row: any): Promise<iResponse> {
return request.get(
`/package/${row.language_id}/${row.package_name}/${row.package_version}/detail`,
{
baseURL: '/api/sca/v2',
}
)
}
})()
Loading

0 comments on commit 6f61c42

Please sign in to comment.